summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2018-05-02 16:57:35 +0000
committertb <>2018-05-02 16:57:35 +0000
commit31be7a8f9204864d0a66829d4121284372c105f4 (patch)
tree6acccd395e1c8be11861dc31785d071c5dcd8a37
parentb8fcd25d8f670b12fe45071e4f1134aeee9e91c9 (diff)
downloadopenbsd-31be7a8f9204864d0a66829d4121284372c105f4.tar.gz
openbsd-31be7a8f9204864d0a66829d4121284372c105f4.tar.bz2
openbsd-31be7a8f9204864d0a66829d4121284372c105f4.zip
MFC:
Remove incorrect NULL checks in DH_set0_key(). Reported by Ondrej Sury, LibreSSL-portable issue #92. ok inoguchi, jsing
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c6
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 e02ce7455a..2153b42a3b 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.30 2018/02/22 16:41:04 jsing Exp $ */ 1/* $OpenBSD: dh_lib.c,v 1.30.2.1 2018/05/02 16:57:35 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 *
@@ -298,10 +298,6 @@ DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
298int 298int
299DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) 299DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
300{ 300{
301 if ((dh->pub_key == NULL && pub_key == NULL) ||
302 (dh->priv_key == NULL && priv_key == NULL))
303 return 0;
304
305 if (pub_key != NULL) { 301 if (pub_key != NULL) {
306 BN_free(dh->pub_key); 302 BN_free(dh->pub_key);
307 dh->pub_key = pub_key; 303 dh->pub_key = pub_key;