]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Use BN_clear_free in DH_set0_key
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 6 Sep 2019 22:53:24 +0000 (00:53 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 9 Sep 2019 12:43:57 +0000 (14:43 +0200)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9796)

crypto/dh/dh_lib.c

index df3166279e9732d3a55271fd9ab5a873e857536e..0382e442d5a2750dd15b30dcac79580e83743ee3 100644 (file)
@@ -235,11 +235,11 @@ void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
 {
     if (pub_key != NULL) {
-        BN_free(dh->pub_key);
+        BN_clear_free(dh->pub_key);
         dh->pub_key = pub_key;
     }
     if (priv_key != NULL) {
-        BN_free(dh->priv_key);
+        BN_clear_free(dh->priv_key);
         dh->priv_key = priv_key;
     }