]> git.ipfire.org Git - thirdparty/openssl.git/commit
DH private key size was one bit too large openssl-3.2
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 21 Jun 2025 10:53:56 +0000 (12:53 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 13 Aug 2025 09:25:23 +0000 (11:25 +0200)
commit9197d8f8ede2352fee811638f1aa8a88e6026879
treefa831641eaa87003295d77a16f03aafaf4b635b9
parentd4d98599c2434619f49f4d74442b3742140d8614
DH private key size was one bit too large

In the case when no q parameter was given,
the function generate_key in dh_key.c did create
one bit too much, so the priv_key value was exceeding
the DH group size q = (p-1)/2.
When the length is used in this case the limit is also
one bit too high, but for backward compatibility this
limit was left as is, instead we have to silently reduce
the value by one.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27870)

(cherry picked from commit d6510d99ae4a8a23f54fdfb1473af6a920da8345)
crypto/dh/dh_key.c