diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-08-09 09:52:21 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-08-09 15:33:01 +0200 |
commit | 4cf1b6aa2178dab6f7c2c9810cebfbf725ed8991 (patch) | |
tree | c55de24ba3a53a800adee1cbdae176f2e1143851 | |
parent | 438b2bfa1c74a6661ba3bb46e714adb7c47eaafe (diff) | |
download | gnutls-4cf1b6aa2178dab6f7c2c9810cebfbf725ed8991.tar.gz |
rsa-psk: corrected memory leak on invalid decrypt
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/auth/rsa_psk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/auth/rsa_psk.c b/lib/auth/rsa_psk.c index b118796552..9c34cf9359 100644 --- a/lib/auth/rsa_psk.c +++ b/lib/auth/rsa_psk.c @@ -336,6 +336,10 @@ _gnutls_proc_rsa_psk_client_kx(gnutls_session_t session, uint8_t * data, gnutls_assert(); _gnutls_debug_log ("auth_rsa_psk: Possible PKCS #1 format attack\n"); + if (ret >= 0) { + gnutls_free(plaintext.data); + plaintext.data = NULL; + } randomize_key = 1; } else { /* If the secret was properly formatted, then |