From fa45544467450997ec4927ccbd311ec1e9ba86dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Wed, 27 Jul 2022 22:20:02 +0200 Subject: [PATCH] doc: list supported MODP groups explicitly Instead of referring users to perl to find information about supported MODP groups in crypto_groups.h, explicitly list the groups with their respective strengths and with references to the defining RFC sections. Refs: https://github.com/nodejs/node/pull/43896 PR-URL: https://github.com/nodejs/node/pull/43986 Reviewed-By: Luigi Pinca Reviewed-By: Filip Skokan --- doc/api/crypto.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 27e57141e2d5b9..f4dd56b8d61d03 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1181,20 +1181,16 @@ const { createDiffieHellmanGroup } = require('node:crypto'); const dh = createDiffieHellmanGroup('modp1'); ``` -The name (e.g. `'modp1'`) is taken from [RFC 2412][] (modp1 and 2) and -[RFC 3526][]: - -```console -$ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h -modp1 # 768 bits -modp2 # 1024 bits -modp5 # 1536 bits -modp14 # 2048 bits -modp15 # etc. -modp16 -modp17 -modp18 -``` +The following groups are supported: + +* `'modp1'` (768 bits, [RFC 2409][] Section 6.1) +* `'modp2'` (1024 bits, [RFC 2409][] Section 6.2) +* `'modp5'` (1536 bits, [RFC 3526][] Section 2) +* `'modp14'` (2048 bits, [RFC 3526][] Section 3) +* `'modp15'` (3072 bits, [RFC 3526][] Section 4) +* `'modp16'` (4096 bits, [RFC 3526][] Section 5) +* `'modp17'` (6144 bits, [RFC 3526][] Section 6) +* `'modp18'` (8192 bits, [RFC 3526][] Section 7) ## Class: `ECDH` @@ -5993,6 +5989,7 @@ See the [list of SSL OP Flags][] for details. [Nonce-Disrespecting Adversaries]: https://github.com/nonce-disrespect/nonce-disrespect [OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html [RFC 1421]: https://www.rfc-editor.org/rfc/rfc1421.txt +[RFC 2409]: https://www.rfc-editor.org/rfc/rfc2409.txt [RFC 2412]: https://www.rfc-editor.org/rfc/rfc2412.txt [RFC 2818]: https://www.rfc-editor.org/rfc/rfc2818.txt [RFC 3526]: https://www.rfc-editor.org/rfc/rfc3526.txt