summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2016-04-27 15:08:33 -0400
committerViktor Dukhovni <openssl-users@dukhovni.org>2016-04-27 16:16:34 -0400
commit4a397f5168d41ef4417f1430f2f5133b92f145b8 (patch)
treef3dfe1449e7c53740cc480c00849391774248d62 /crypto/dh
parent69664d6af0cdd7738f55d10fbbe46cdf15f72e0e (diff)
Fix set0 reuse test
We must test for new object == current object, not !=. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index 644508d784..9db45763fa 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -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) {