diff options
author | Matt Caswell <matt@openssl.org> | 2023-07-06 16:36:35 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-07-19 11:20:04 +0200 |
commit | 9e0094e2aa1b3428a12d5095132f133c078d3c3d (patch) | |
tree | f689e3cb7c4e29af012e5e678b5ba74da9397848 /include | |
parent | 709ef4093520a91f4d723aef29c857c6fd625cad (diff) |
Fix DH_check() excessive time with over sized modulus
The DH_check() function checks numerous aspects of the key or parameters
that have been supplied. Some of those checks use the supplied modulus
value even if it is excessively large.
There is already a maximum DH modulus size (10,000 bits) over which
OpenSSL will not generate or derive keys. DH_check() will however still
perform various tests for validity on such a large modulus. We introduce a
new maximum (32,768) over which DH_check() will just fail.
An application that calls DH_check() and supplies a key or parameters
obtained from an untrusted source could be vulnerable to a Denial of
Service attack.
The function DH_check() is itself called by a number of other OpenSSL
functions. An application calling any of those other functions may
similarly be affected. The other functions affected by this are
DH_check_ex() and EVP_PKEY_param_check().
CVE-2023-3446
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21451)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/dh.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/openssl/dh.h b/include/openssl/dh.h index 2c6219e7c2..da6e7b06c8 100644 --- a/include/openssl/dh.h +++ b/include/openssl/dh.h @@ -92,7 +92,11 @@ int EVP_PKEY_CTX_get0_dh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm); # include <openssl/dherr.h> # ifndef OPENSSL_DH_MAX_MODULUS_BITS -# define OPENSSL_DH_MAX_MODULUS_BITS 10000 +# define OPENSSL_DH_MAX_MODULUS_BITS 10000 +# endif + +# ifndef OPENSSL_DH_CHECK_MAX_MODULUS_BITS +# define OPENSSL_DH_CHECK_MAX_MODULUS_BITS 32768 # endif # define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024 |