diff --git a/src/openssl.c b/src/openssl.c index 28d5f21..996aff3 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -256,8 +256,6 @@ int _libssh2_rsa_sha1_sign(LIBSSH2_SESSION *session, unsigned long *signature_len) { int ret; - unsigned int i; - libssh2_sha1_ctx ctx; unsigned char *sig; unsigned int sig_len; diff --git a/src/openssl.h b/src/openssl.h index f164c3c..c8637e5 100644 --- a/src/openssl.h +++ b/src/openssl.h @@ -44,6 +44,7 @@ #include #include #include +#include #ifdef OPENSSL_NO_RSA # define LIBSSH2_RSA 0 @@ -126,7 +127,7 @@ #define libssh2_hmac_final(ctx, data) HMAC_Final(&(ctx), data, NULL) #define libssh2_hmac_cleanup(ctx) HMAC_cleanup(ctx) -#define libssh2_crypto_init() 1 +#define libssh2_crypto_init() #define libssh2_rsa_ctx RSA @@ -147,11 +148,21 @@ int _libssh2_rsa_new(libssh2_rsa_ctx **rsa, unsigned long e2len, const unsigned char *coeffdata, unsigned long coefflen); +int _libssh2_rsa_new_private (libssh2_rsa_ctx **rsa, + LIBSSH2_SESSION *session, + FILE *fp, + unsigned const char *passphrase); int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx *rsa, const unsigned char *sig, unsigned long sig_len, const unsigned char *m, unsigned long m_len); +int _libssh2_rsa_sha1_sign(LIBSSH2_SESSION *session, + libssh2_rsa_ctx *rsactx, + const unsigned char *hash, + unsigned long hash_len, + unsigned char **signature, + unsigned long *signature_len); #define _libssh2_rsa_free(rsactx) RSA_free(rsactx) @@ -168,6 +179,10 @@ int _libssh2_dsa_new(libssh2_dsa_ctx **dsa, unsigned long ylen, const unsigned char *x, unsigned long x_len); +int _libssh2_dsa_new_private (libssh2_dsa_ctx **dsa, + LIBSSH2_SESSION *session, + FILE *fp, + unsigned const char *passphrase); int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx, const unsigned char *sig, unsigned long sig_len, diff --git a/src/pem.c b/src/pem.c index 65821c9..68418c0 100644 --- a/src/pem.c +++ b/src/pem.c @@ -155,7 +155,7 @@ static int read_asn1_length (const unsigned char *data, int _libssh2_pem_decode_sequence (char **data, unsigned int *datalen) { unsigned int len; - unsigned int lenlen; + int lenlen; if (*datalen < 1) { @@ -186,7 +186,7 @@ int _libssh2_pem_decode_integer (char **data, unsigned int *datalen, char **i, unsigned int *ilen) { unsigned int len; - unsigned int lenlen; + int lenlen; if (*datalen < 1) { diff --git a/src/publickey.c b/src/publickey.c index 6ca2e25..ff331f0 100644 --- a/src/publickey.c +++ b/src/publickey.c @@ -212,7 +212,8 @@ static int libssh2_publickey_response_success(LIBSSH2_PUBLICKEY *pkey) { LIBSSH2_SESSION *session = pkey->channel->session; unsigned char *data, *s; - unsigned long data_len, response; + unsigned long data_len; + int response; while (1) { if (libssh2_publickey_packet_receive(pkey, &data, &data_len)) { @@ -551,10 +552,11 @@ LIBSSH2_API int libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY *pkey, unsigned l LIBSSH2_SESSION *session = channel->session; libssh2_publickey_list *list = NULL; unsigned char *s, buffer[12], *data = NULL; - unsigned long buffer_len = 12, keys = 0, max_keys = 0, data_len, i, response; - /* packet_len(4) + + unsigned long buffer_len = 12, keys = 0, max_keys = 0, data_len, i; + /* packet_len(4) + list_len(4) + "list"(4) */ + int response; s = buffer; libssh2_htonu32(s, buffer_len - 4); s += 4;