]> git.ipfire.org Git - thirdparty/openssl.git/commit
DH_check(): Do not try checking q properties if it is obviously invalid
authorTomas Mraz <tomas@openssl.org>
Tue, 25 Jul 2023 13:22:48 +0000 (15:22 +0200)
committerTodd Short <todd.short@me.com>
Thu, 27 Jul 2023 13:48:22 +0000 (09:48 -0400)
commit1c16253f3c3a8d1e25918c3f404aae6a5b0893de
tree63b229c08d0885b73206c9f44b24ac5c3d2a6f0a
parent81d10e61a4b7d5394d08a718bf7d6bae20e818fc
DH_check(): Do not try checking q properties if it is obviously invalid

If  |q| >= |p| then the q value is obviously wrong as q
is supposed to be a prime divisor of p-1.

We check if p is overly large so this added test implies that
q is not large either when performing subsequent tests using that
q value.

Otherwise if it is too large these additional checks of the q value
such as the primality test can then trigger DoS by doing overly long
computations.

Fixes CVE-2023-3817

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/21550)
crypto/dh/dh_check.c