Fix set0 reuse test

We must test for new object == current object, not !=.

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Viktor Dukhovni 2016-04-27 15:08:33 -04:00
parent 69664d6af0
commit 4a397f5168
2 changed files with 2 additions and 2 deletions

View file

@ -303,7 +303,7 @@ int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
* as input parameters.
*/
if (dh->pub_key == pub_key
|| (dh->priv_key != NULL && priv_key != dh->priv_key))
|| (dh->priv_key != NULL && priv_key == dh->priv_key))
return 0;
if (pub_key != NULL) {

View file

@ -358,7 +358,7 @@ int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
* as input parameters.
*/
if (d->pub_key == pub_key
|| (d->priv_key != NULL && priv_key != d->priv_key))
|| (d->priv_key != NULL && priv_key == d->priv_key))
return 0;
if (pub_key != NULL) {