diff options
| author | tb <> | 2018-05-02 16:57:35 +0000 |
|---|---|---|
| committer | tb <> | 2018-05-02 16:57:35 +0000 |
| commit | e21964afb1b9e46ccf5ec0a5429736d3aabf7139 (patch) | |
| tree | 6acccd395e1c8be11861dc31785d071c5dcd8a37 /src/lib/libc | |
| parent | 1f2eb700ae7e3c6771d21629af14f1956a6238a3 (diff) | |
| download | openbsd-e21964afb1b9e46ccf5ec0a5429736d3aabf7139.tar.gz openbsd-e21964afb1b9e46ccf5ec0a5429736d3aabf7139.tar.bz2 openbsd-e21964afb1b9e46ccf5ec0a5429736d3aabf7139.zip | |
MFC:
Remove incorrect NULL checks in DH_set0_key().
Reported by Ondrej Sury, LibreSSL-portable issue #92.
ok inoguchi, jsing
Diffstat (limited to '')
| -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 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) | |||
| 298 | int | 298 | int |
| 299 | DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) | 299 | DH_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; |
