Tomas Mraz 1c16253f3c 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)
2023-07-27 09:48:22 -04:00
..
2023-07-18 18:54:45 +10:00
2023-06-12 08:36:08 +02:00
2023-07-18 20:41:17 +02:00
2022-11-07 11:23:13 +01:00
2023-07-17 08:12:06 +10:00
2023-07-18 18:54:45 +10:00
2023-04-03 10:31:04 +02:00
2023-06-15 10:11:46 +10:00
2023-06-15 10:11:46 +10:00
2023-07-18 18:54:45 +10:00
2023-06-15 10:11:46 +10:00
2023-07-14 11:15:45 +10:00
2023-06-13 13:37:33 +02:00
2023-06-15 10:11:46 +10:00
2023-07-06 12:55:21 +10:00
2023-05-17 12:07:02 +02:00
2023-07-18 18:54:45 +10:00
2022-05-03 13:34:51 +01:00
2021-04-08 13:04:41 +01:00
2023-07-17 08:12:06 +10:00
2022-01-12 20:10:21 +11:00
2022-05-03 13:34:51 +01:00
2023-04-13 10:25:55 +01:00
2022-05-03 13:34:51 +01:00
2022-05-03 13:34:51 +01:00
2022-05-03 13:34:51 +01:00
2023-06-12 07:56:03 +02:00
2022-05-03 13:34:51 +01:00
2022-05-03 13:34:51 +01:00
2021-03-11 13:27:36 +00:00
2023-02-08 16:20:55 +01:00
2022-05-03 13:34:51 +01:00
2023-06-15 10:11:46 +10:00
2023-05-22 07:45:10 +01:00
2022-05-03 13:34:51 +01:00
2022-05-03 13:34:51 +01:00
2023-07-17 08:12:06 +10:00
2022-09-05 10:20:30 +10:00
2023-03-07 18:21:51 +01:00
2022-05-03 13:34:51 +01:00
2023-05-24 10:34:55 +01:00
2023-04-13 10:25:55 +01:00
2021-04-08 13:04:41 +01:00