diff options
-rw-r--r-- | lib/gnutls_auth.c | 10 | ||||
-rw-r--r-- | lib/gnutls_mpi.c | 4 | ||||
-rw-r--r-- | lib/gnutls_pk.c | 3 | ||||
-rw-r--r-- | libextra/auth_srp.c | 8 | ||||
-rw-r--r-- | libextra/gnutls_srp.c | 5 |
5 files changed, 20 insertions, 10 deletions
diff --git a/lib/gnutls_auth.c b/lib/gnutls_auth.c index e497fca0f5..afa48c485a 100644 --- a/lib/gnutls_auth.c +++ b/lib/gnutls_auth.c @@ -305,11 +305,15 @@ int _gnutls_auth_info_set( gnutls_session session, gnutls_credentials_type type, * opaque data. */ int _gnutls_generate_key(GNUTLS_KEY key) { - _gnutls_mpi_print( NULL, &key->key.size, key->KEY); - key->key.data = gnutls_secure_malloc( key->key.size); +size_t tmp; + + _gnutls_mpi_print( NULL, &tmp, key->KEY); + key->key.data = gnutls_secure_malloc( tmp); if ( key->key.data==NULL) { return GNUTLS_E_MEMORY_ERROR; } - _gnutls_mpi_print( key->key.data, &key->key.size, key->KEY); + _gnutls_mpi_print( key->key.data, &tmp, key->KEY); + + key->key.size = tmp; return 0; } diff --git a/lib/gnutls_mpi.c b/lib/gnutls_mpi.c index 13786de2ea..fd4ebb90a5 100644 --- a/lib/gnutls_mpi.c +++ b/lib/gnutls_mpi.c @@ -88,6 +88,7 @@ int _gnutls_x509_read_int( ASN1_TYPE node, const char* value, char* tmpstr, int tmpstr_size, GNUTLS_MPI* ret_mpi) { int len, result; +size_t s_len; len = tmpstr_size - 1; result = asn1_read_value( node, value, tmpstr, &len); @@ -96,7 +97,8 @@ int len, result; return _gnutls_asn2err(result); } - if (_gnutls_mpi_scan( ret_mpi, tmpstr, &len) != 0) { + s_len = len; + if (_gnutls_mpi_scan( ret_mpi, tmpstr, &s_len) != 0) { gnutls_assert(); return GNUTLS_E_MPI_SCAN_FAILED; } diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c index 559175e15a..1b538301e3 100644 --- a/lib/gnutls_pk.c +++ b/lib/gnutls_pk.c @@ -466,7 +466,8 @@ int _gnutls_dsa_verify( const gnutls_datum* vdata, const gnutls_datum *sig_value GNUTLS_MPI * params, int params_len) { GNUTLS_MPI mdata; - int ret, k; + int ret; + size_t k; GNUTLS_MPI rs[2]; if (vdata->size != 20) { /* sha-1 only */ diff --git a/libextra/auth_srp.c b/libextra/auth_srp.c index 01fddb4ece..3e4d84c9f8 100644 --- a/libextra/auth_srp.c +++ b/libextra/auth_srp.c @@ -77,7 +77,7 @@ int _gnutls_gen_srp_server_kx(gnutls_session state, opaque ** data) SRP_PWD_ENTRY *pwd_entry; SRP_SERVER_AUTH_INFO info; ssize_t data_size; - size_t n_b; + size_t n_b, tmp_size; uint8 *data_b; if (state->security_parameters.extensions.srp_username[0] == 0) { @@ -111,12 +111,14 @@ int _gnutls_gen_srp_server_kx(gnutls_session state, opaque ** data) return GNUTLS_E_MPI_SCAN_FAILED; } - if (_gnutls_mpi_scan( &N, pwd_entry->n.data, &pwd_entry->n.size) < 0) { + tmp_size = pwd_entry->n.size; + if (_gnutls_mpi_scan( &N, pwd_entry->n.data, &tmp_size) < 0) { gnutls_assert(); return GNUTLS_E_MPI_SCAN_FAILED; } - if (_gnutls_mpi_scan( &V, pwd_entry->v.data, &pwd_entry->v.size) < 0) { + tmp_size = pwd_entry->v.size; + if (_gnutls_mpi_scan( &V, pwd_entry->v.data, &tmp_size) < 0) { gnutls_assert(); return GNUTLS_E_MPI_SCAN_FAILED; } diff --git a/libextra/gnutls_srp.c b/libextra/gnutls_srp.c index 4c8b20ff22..5d4b5703a8 100644 --- a/libextra/gnutls_srp.c +++ b/libextra/gnutls_srp.c @@ -244,7 +244,7 @@ GNUTLS_MPI _gnutls_calc_srp_A(GNUTLS_MPI * a, GNUTLS_MPI g, GNUTLS_MPI n) * The output is exactly 20 bytes */ int _gnutls_calc_srp_sha(char *username, char *password, opaque * salt, - int salt_size, int *size, void* digest) + int salt_size, size_t *size, void* digest) { GNUTLS_HASH_HANDLE td; opaque res[MAX_HASH_SIZE]; @@ -598,7 +598,8 @@ int gnutls_srp_verifier( char* username, char* password, const gnutls_datum *sal gnutls_datum * res) { GNUTLS_MPI _n, _g; -int ret, digest_size = 20; +int ret; +size_t digest_size = 20; opaque digest[20]; size_t size; |