summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2019-09-07 00:58:31 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2019-09-09 14:43:57 +0200
commit2b95e8efcf8b99892106070d9ac745a0a369f503 (patch)
treed0c6a3ab4cebbd7a59cacc08be021c347b9f10c9 /crypto
parentfa01370f7dc8f0a379483bbe74de11225857e5fe (diff)
downloadopenssl-new-2b95e8efcf8b99892106070d9ac745a0a369f503.tar.gz
DH_check_pub_key_ex was accidentally calling DH_check,
so results were undefined. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9796)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/dh/dh_check.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c
index 373110d263..2d19a8f120 100644
--- a/crypto/dh/dh_check.c
+++ b/crypto/dh/dh_check.c
@@ -176,7 +176,8 @@ int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key)
{
int errflags = 0;
- (void)DH_check(dh, &errflags);
+ if (!DH_check_pub_key(dh, pub_key, &errflags))
+ return 0;
if ((errflags & DH_CHECK_PUBKEY_TOO_SMALL) != 0)
DHerr(DH_F_DH_CHECK_PUB_KEY_EX, DH_R_CHECK_PUBKEY_TOO_SMALL);