key zeroization fix for a branch path of tls13_final_finish_mac
authorShane Lontis <shane.lontis@oracle.com>
Tue, 4 Sep 2018 05:12:13 +0000 (15:12 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 4 Sep 2018 19:06:00 +0000 (05:06 +1000)
Reviewed-by: Paul Yang <yang.yang@baishancloud.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7110)

ssl/tls13_enc.c

index 22db2f8237333292bc2a8644690679f53fbd8f4e..f7ab0fa4704003dbf111e41667b6695875b9405d 100644 (file)
@@ -271,6 +271,7 @@ size_t tls13_final_finish_mac(SSL *s, const char *str, size_t slen,
 
         key = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL, finsecret,
                                            hashlen);
+        OPENSSL_cleanse(finsecret, sizeof(finsecret));
     }
 
     if (key == NULL