File 8711-crypto-Clearify-compute_key-2-length-param-for-MODP-.patch of Package erlang
From 27637855a48bc2a989fa0a7e7f4f63120c04ae2d Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Thu, 2 Jun 2022 12:12:48 +0200
Subject: [PATCH] crypto: Clearify compute_key/2 length param for MODP groups
in OSSL 3.0
---
lib/crypto/doc/src/crypto.xml | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml
index 79ee0d404e..acc776d071 100644
--- a/lib/crypto/doc/src/crypto.xml
+++ b/lib/crypto/doc/src/crypto.xml
@@ -1075,10 +1075,30 @@ end
<p>Generates a public key of type <c>Type</c>.
See also <seemfa marker="public_key:public_key#generate_key/1">public_key:generate_key/1</seemfa>.
</p>
+ <note>
+ <p>If the linked version of cryptolib is OpenSSL 3.0</p>
+ <list type="bulleted">
+ <item>
+ <p>and the <c>Type</c> is <c>dh</c> (diffie-hellman)</p>
+ </item>
+ <item>
+ <p>and the parameter <c>P</c> (in <seetype marker="#dh_params">dh_params()</seetype>)
+ is one of the MODP groups (see <url href="https://tools.ietf.org/html/rfc3526">RFC 3526</url>)</p>
+ </item>
+ <item>
+ <p>and the optional <c>PrivateKeyBitLength</c> parameter
+ (in <seetype marker="#dh_params">dh_params()</seetype>)
+ is present,</p>
+ </item>
+ </list>
+ <p>then the optional key length parameter must be at least
+ 224, 256, 302, 352 and 400 for group sizes of
+ 2048, 3072, 4096, 6144 and 8192, respectively.</p>
+ </note>
<note>
<p>RSA key generation is only available if the runtime was
built with dirty scheduler support. Otherwise, attempting to
- generate an RSA key will raise exception <c>error:notsup</c>.</p>
+ generate an RSA key will raise the exception <c>error:notsup</c>.</p>
</note>
</desc>
</func>
--
2.35.3