diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/algorithms/kx.c | 8 | ||||
-rw-r--r-- | lib/auth/ecdhe.c | 10 | ||||
-rw-r--r-- | lib/constate.c | 4 |
3 files changed, 13 insertions, 9 deletions
diff --git a/lib/algorithms/kx.c b/lib/algorithms/kx.c index 2591ec193a..d2a24409d5 100644 --- a/lib/algorithms/kx.c +++ b/lib/algorithms/kx.c @@ -298,11 +298,11 @@ _gnutls_map_kx_get_cred(gnutls_kx_algorithm_t algorithm, int server) { gnutls_credentials_type_t ret = -1; if (server) { - GNUTLS_KX_MAP_LOOP(if (p->algorithm == algorithm) ret = - p->server_type); + GNUTLS_KX_MAP_LOOP(if (p->algorithm == algorithm) {ret = + p->server_type; break;}); } else { - GNUTLS_KX_MAP_LOOP(if (p->algorithm == algorithm) ret = - p->client_type); + GNUTLS_KX_MAP_LOOP(if (p->algorithm == algorithm) {ret = + p->client_type; break;}); } return ret; diff --git a/lib/auth/ecdhe.c b/lib/auth/ecdhe.c index 9f53b1b053..a045d306dc 100644 --- a/lib/auth/ecdhe.c +++ b/lib/auth/ecdhe.c @@ -193,8 +193,10 @@ int _gnutls_proc_ecdh_common_client_kx(gnutls_session_t session, return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER); } - if (data_size != 0) - return gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH); + if (data_size != 0) { + ret = gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH); + goto cleanup; + } /* generate pre-shared key */ ret = calc_ecdh_key(session, psk_key, ecurve); @@ -202,8 +204,10 @@ int _gnutls_proc_ecdh_common_client_kx(gnutls_session_t session, gnutls_assert(); goto cleanup; } - cleanup: + _gnutls_mpi_release(&session->key.proto.tls12.ecdh.x); + _gnutls_mpi_release(&session->key.proto.tls12.ecdh.y); + _gnutls_free_datum(&session->key.proto.tls12.ecdh.raw); gnutls_pk_params_clear(&session->key.proto.tls12.ecdh.params); return ret; } diff --git a/lib/constate.c b/lib/constate.c index b1925f6939..fbb047509f 100644 --- a/lib/constate.c +++ b/lib/constate.c @@ -126,13 +126,13 @@ _gnutls_set_keys(gnutls_session_t session, record_parameters_st * params, pos += hash_size; _gnutls_hard_log("INT: CLIENT MAC KEY [%d]: %s\n", - key_size, + client_write->mac_key_size, _gnutls_bin2hex(client_write->mac_key, hash_size, buf, sizeof(buf), NULL)); _gnutls_hard_log("INT: SERVER MAC KEY [%d]: %s\n", - key_size, + server_write->mac_key_size, _gnutls_bin2hex(server_write->mac_key, hash_size, buf, sizeof(buf), NULL)); |