Skip to content

Commit 865f8e8

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 ac0b949 commit 865f8e8

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
@@ -3160,6 +3160,11 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
31603160
<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>
31613161
for detail.</td>
31623162
</tr>
3163+
<tr>
3164+
<td><code>SSL_OP_ALLOW_NO_DHE_KEX</code></td>
3165+
<td>Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode
3166+
for TLS v1.3</td>
3167+
</tr>
31633168
<tr>
31643169
<td><code>SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION</code></td>
31653170
<td>Allows legacy insecure renegotiation between OpenSSL and unpatched
@@ -3232,10 +3237,18 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
32323237
<td><code>SSL_OP_NO_COMPRESSION</code></td>
32333238
<td>Instructs OpenSSL to disable support for SSL/TLS compression.</td>
32343239
</tr>
3240+
<tr>
3241+
<td><code>SSL_OP_NO_ENCRYPT_THEN_MAC</code></td>
3242+
<td>Instructs OpenSSL to disable encrypt-then-MAC.</td>
3243+
</tr>
32353244
<tr>
32363245
<td><code>SSL_OP_NO_QUERY_MTU</code></td>
32373246
<td></td>
32383247
</tr>
3248+
<tr>
3249+
<td><code>SSL_OP_NO_RENEGOTIATION</code></td>
3250+
<td>Instructs OpenSSL to disable renegotiation.</td>
3251+
</tr>
32393252
<tr>
32403253
<td><code>SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION</code></td>
32413254
<td>Instructs OpenSSL to always start a new session when performing
@@ -3264,6 +3277,10 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
32643277
<tr>
32653278
<td><code>SSL_OP_NO_TLSv1_2</code></td>
32663279
<td>Instructs OpenSSL to turn off TLS v1.2</td>
3280+
</tr>
3281+
<tr>
3282+
<td><code>SSL_OP_NO_TLSv1_3</code></td>
3283+
<td>Instructs OpenSSL to turn off TLS v1.3</td>
32673284
</tr>
32683285
<td><code>SSL_OP_PKCS1_CHECK_1</code></td>
32693286
<td></td>
@@ -3272,6 +3289,14 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
32723289
<td><code>SSL_OP_PKCS1_CHECK_2</code></td>
32733290
<td></td>
32743291
</tr>
3292+
<tr>
3293+
<td><code>SSL_OP_PRIORITIZE_CHACHA</code></td>
3294+
<td>Instructs OpenSSL server to prioritize ChaCha20Poly1305
3295+
when client does.
3296+
This option has no effect if
3297+
<code>SSL_OP_CIPHER_SERVER_PREFERENCE</code>
3298+
is not enabled.</td>
3299+
</tr>
32753300
<tr>
32763301
<td><code>SSL_OP_SINGLE_DH_USE</code></td>
32773302
<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)