Skip to content

Commit a7b4318

Browse files
mkrawczukaddaleax
authored andcommitted
crypto: add OP flag constants added in OpenSSL v1.1.1
PR-URL: #33929 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Alba Mendez <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 650adec commit a7b4318

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

doc/api/crypto.md

+25
Original file line numberDiff line numberDiff line change
@@ -3184,6 +3184,11 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
31843184
<a href="https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html">https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html</a>
31853185
for detail.</td>
31863186
</tr>
3187+
<tr>
3188+
<td><code>SSL_OP_ALLOW_NO_DHE_KEX</code></td>
3189+
<td>Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode
3190+
for TLS v1.3</td>
3191+
</tr>
31873192
<tr>
31883193
<td><code>SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION</code></td>
31893194
<td>Allows legacy insecure renegotiation between OpenSSL and unpatched
@@ -3256,10 +3261,18 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
32563261
<td><code>SSL_OP_NO_COMPRESSION</code></td>
32573262
<td>Instructs OpenSSL to disable support for SSL/TLS compression.</td>
32583263
</tr>
3264+
<tr>
3265+
<td><code>SSL_OP_NO_ENCRYPT_THEN_MAC</code></td>
3266+
<td>Instructs OpenSSL to disable encrypt-then-MAC.</td>
3267+
</tr>
32593268
<tr>
32603269
<td><code>SSL_OP_NO_QUERY_MTU</code></td>
32613270
<td></td>
32623271
</tr>
3272+
<tr>
3273+
<td><code>SSL_OP_NO_RENEGOTIATION</code></td>
3274+
<td>Instructs OpenSSL to disable renegotiation.</td>
3275+
</tr>
32633276
<tr>
32643277
<td><code>SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION</code></td>
32653278
<td>Instructs OpenSSL to always start a new session when performing
@@ -3288,6 +3301,10 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
32883301
<tr>
32893302
<td><code>SSL_OP_NO_TLSv1_2</code></td>
32903303
<td>Instructs OpenSSL to turn off TLS v1.2</td>
3304+
</tr>
3305+
<tr>
3306+
<td><code>SSL_OP_NO_TLSv1_3</code></td>
3307+
<td>Instructs OpenSSL to turn off TLS v1.3</td>
32913308
</tr>
32923309
<td><code>SSL_OP_PKCS1_CHECK_1</code></td>
32933310
<td></td>
@@ -3296,6 +3313,14 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
32963313
<td><code>SSL_OP_PKCS1_CHECK_2</code></td>
32973314
<td></td>
32983315
</tr>
3316+
<tr>
3317+
<td><code>SSL_OP_PRIORITIZE_CHACHA</code></td>
3318+
<td>Instructs OpenSSL server to prioritize ChaCha20Poly1305
3319+
when client does.
3320+
This option has no effect if
3321+
<code>SSL_OP_CIPHER_SERVER_PREFERENCE</code>
3322+
is not enabled.</td>
3323+
</tr>
32993324
<tr>
33003325
<td><code>SSL_OP_SINGLE_DH_USE</code></td>
33013326
<td>Instructs OpenSSL to always create a new key when using

src/node_constants.cc

+20
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,10 @@ void DefineCryptoConstants(Local<Object> target) {
806806
NODE_DEFINE_CONSTANT(target, SSL_OP_ALL);
807807
#endif
808808

809+
#ifdef SSL_OP_ALLOW_NO_DHE_KEX
810+
NODE_DEFINE_CONSTANT(target, SSL_OP_ALLOW_NO_DHE_KEX);
811+
#endif
812+
809813
#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
810814
NODE_DEFINE_CONSTANT(target, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION);
811815
#endif
@@ -870,10 +874,18 @@ void DefineCryptoConstants(Local<Object> target) {
870874
NODE_DEFINE_CONSTANT(target, SSL_OP_NO_COMPRESSION);
871875
#endif
872876

877+
#ifdef SSL_OP_NO_ENCRYPT_THEN_MAC
878+
NODE_DEFINE_CONSTANT(target, SSL_OP_NO_ENCRYPT_THEN_MAC);
879+
#endif
880+
873881
#ifdef SSL_OP_NO_QUERY_MTU
874882
NODE_DEFINE_CONSTANT(target, SSL_OP_NO_QUERY_MTU);
875883
#endif
876884

885+
#ifdef SSL_OP_NO_RENEGOTIATION
886+
NODE_DEFINE_CONSTANT(target, SSL_OP_NO_RENEGOTIATION);
887+
#endif
888+
877889
#ifdef SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
878890
NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
879891
#endif
@@ -902,6 +914,10 @@ void DefineCryptoConstants(Local<Object> target) {
902914
NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1_2);
903915
#endif
904916

917+
#ifdef SSL_OP_NO_TLSv1_3
918+
NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1_3);
919+
#endif
920+
905921
#ifdef SSL_OP_PKCS1_CHECK_1
906922
NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_1);
907923
#endif
@@ -910,6 +926,10 @@ void DefineCryptoConstants(Local<Object> target) {
910926
NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_2);
911927
#endif
912928

929+
#ifdef SSL_OP_PRIORITIZE_CHACHA
930+
NODE_DEFINE_CONSTANT(target, SSL_OP_PRIORITIZE_CHACHA);
931+
#endif
932+
913933
#ifdef SSL_OP_SINGLE_DH_USE
914934
NODE_DEFINE_CONSTANT(target, SSL_OP_SINGLE_DH_USE);
915935
#endif

0 commit comments

Comments
 (0)