]> git.ipfire.org Git - thirdparty/openssl.git/commit
DH private key size was one bit too large master
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:13 +0000 (11:24 +0200)
commitd6510d99ae4a8a23f54fdfb1473af6a920da8345
treee6f6dc6a98fc5ceba60309f5a2cf3dae434b62d2
parent80c664db430d882be22cd237f3e0a313ae3b15a3
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)
crypto/dh/dh_key.c