]> git.ipfire.org Git - thirdparty/openssl.git/commit
DH private key size was one bit too large
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:24:59 +0000 (11:24 +0200)
commitad96079b7988b277f5b4eafdba7253a348721484
tree63a9c71709e789f298d014a8415cf15188774cf2
parent21e12027dba8179491e15b5281e350ea0f5a4d9b
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