Add missing OPENSSL_clear_free before using ec->key
authorMansour Ahmadi <m.ahmadi@northeastern.edu>
Tue, 11 Dec 2018 21:18:21 +0000 (16:18 -0500)
committerMatt Caswell <matt@openssl.org>
Thu, 13 Dec 2018 10:04:57 +0000 (10:04 +0000)
Fixes #7657

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7877)

crypto/cms/cms_pwri.c

index af979b55d0713b09ba6029f133c2868549539c60..980252d107af684a844de7058e2a2ead038482c7 100644 (file)
@@ -373,6 +373,7 @@ int cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri,
             goto err;
         }
 
+        OPENSSL_clear_free(ec->key, ec->keylen);
         ec->key = key;
         ec->keylen = keylen;