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 22db2f8..f7ab0fa 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