]> 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>
Fri, 21 Jul 2023 09:39:41 +0000 (11:39 +0200)
committerMatt Caswell <matt@openssl.org>
Mon, 31 Jul 2023 13:30:37 +0000 (14:30 +0100)
commit91ddeba0f2269b017dc06c46c993a788974b1aa5
tree840ca844a027e2844c5c02c75197e0a948e8de89
parenteec805ee71356c06f9a86192fa06507c3bb92b09
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: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21551)
crypto/dh/dh_check.c