summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-10-05 11:11:16 +0200
committerTomas Mraz <tomas@openssl.org>2023-10-11 16:22:27 +0200
commiteaee1765a49c6a8ba728e3e2d18bb67bff8aaa55 (patch)
tree0d92e2ae517662c7646414ee704bc4f7c3d29337 /crypto/dh
parent715242b1ca2b7267a70fb13c3544a84b947a6e81 (diff)
DH_check_pub_key() should not fail when setting result code
The semantics of ossl_ffc_validate_public_key() and ossl_ffc_validate_public_key_partial() needs to be changed to not return error on non-fatal problems. Fixes #22287 Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22291)
Diffstat (limited to 'crypto/dh')
-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 f4173e2137..7ba2beae7f 100644
--- a/crypto/dh/dh_check.c
+++ b/crypto/dh/dh_check.c
@@ -259,7 +259,8 @@ int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret)
*/
int ossl_dh_check_pub_key_partial(const DH *dh, const BIGNUM *pub_key, int *ret)
{
- return ossl_ffc_validate_public_key_partial(&dh->params, pub_key, ret);
+ return ossl_ffc_validate_public_key_partial(&dh->params, pub_key, ret)
+ && *ret == 0;
}
int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret)