diff options
author | tb <> | 2018-05-02 15:48:38 +0000 |
---|---|---|
committer | tb <> | 2018-05-02 15:48:38 +0000 |
commit | 66cfd2f5d49458fe9a3bb27319840e5bd209a81e (patch) | |
tree | 6c46cdb462f2817b794578b3946dcd33eb26f7e9 /src/lib | |
parent | 14583978bcf5550ff2f4f59d14ecbc47b57bbf3f (diff) | |
download | openbsd-66cfd2f5d49458fe9a3bb27319840e5bd209a81e.tar.gz openbsd-66cfd2f5d49458fe9a3bb27319840e5bd209a81e.tar.bz2 openbsd-66cfd2f5d49458fe9a3bb27319840e5bd209a81e.zip |
Remove incorrect NULL checks in DH_set0_key().
Reported by Ondřej Surý, LibreSSL-portable issue #92.
ok inoguchi, jsing
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index 8a7f9386c7..446bc65aa2 100644 --- a/src/lib/libcrypto/dh/dh_lib.c +++ b/src/lib/libcrypto/dh/dh_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_lib.c,v 1.31 2018/04/14 07:09:21 tb Exp $ */ | 1 | /* $OpenBSD: dh_lib.c,v 1.32 2018/05/02 15:48:38 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -294,10 +294,6 @@ DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) | |||
294 | int | 294 | int |
295 | DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) | 295 | DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) |
296 | { | 296 | { |
297 | if ((dh->pub_key == NULL && pub_key == NULL) || | ||
298 | (dh->priv_key == NULL && priv_key == NULL)) | ||
299 | return 0; | ||
300 | |||
301 | if (pub_key != NULL) { | 297 | if (pub_key != NULL) { |
302 | BN_free(dh->pub_key); | 298 | BN_free(dh->pub_key); |
303 | dh->pub_key = pub_key; | 299 | dh->pub_key = pub_key; |