提交 4bf9781a 编写于 作者: B Bernd Edlinger

Use BN_clear_free in DH_set0_key

Reviewed-by: NPaul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9796)

(cherry picked from commit fa01370f7dc8f0a379483bbe74de11225857e5fe)
上级 8003138f
...@@ -234,11 +234,11 @@ void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) ...@@ -234,11 +234,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) int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
{ {
if (pub_key != NULL) { if (pub_key != NULL) {
BN_free(dh->pub_key); BN_clear_free(dh->pub_key);
dh->pub_key = pub_key; dh->pub_key = pub_key;
} }
if (priv_key != NULL) { if (priv_key != NULL) {
BN_free(dh->priv_key); BN_clear_free(dh->priv_key);
dh->priv_key = priv_key; dh->priv_key = priv_key;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册