Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fae1af0

Browse filesBrowse files
authored
tls: ciphers allow bang syntax
Fixes: #49699 PR-URL: #49712 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent 1a839f3 commit fae1af0
Copy full SHA for fae1af0

File tree

Expand file treeCollapse file tree

2 files changed

+11
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-6
lines changed
Open diff view settings
Collapse file

‎lib/internal/tls/secure-context.js‎

Copy file name to clipboardExpand all lines: lib/internal/tls/secure-context.js
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,21 @@ function processCiphers(ciphers, name) {
101101
ArrayPrototypeFilter(
102102
ciphers,
103103
(cipher) => {
104-
return cipher.length > 0 &&
105-
!StringPrototypeStartsWith(cipher, 'TLS_');
104+
if (cipher.length === 0) return false;
105+
if (StringPrototypeStartsWith(cipher, 'TLS_')) return false;
106+
if (StringPrototypeStartsWith(cipher, '!TLS_')) return false;
107+
return true;
106108
}), ':');
107109

108110
const cipherSuites =
109111
ArrayPrototypeJoin(
110112
ArrayPrototypeFilter(
111113
ciphers,
112114
(cipher) => {
113-
return cipher.length > 0 &&
114-
StringPrototypeStartsWith(cipher, 'TLS_');
115+
if (cipher.length === 0) return false;
116+
if (StringPrototypeStartsWith(cipher, 'TLS_')) return true;
117+
if (StringPrototypeStartsWith(cipher, '!TLS_')) return true;
118+
return false;
115119
}), ':');
116120

117121
// Specifying empty cipher suites for both TLS1.2 and TLS1.3 is invalid, its
Collapse file

‎test/parallel/test-tls-set-ciphers.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-set-ciphers.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../common');
3-
if (!common.hasCrypto)
4-
common.skip('missing crypto');
3+
if (!common.hasOpenSSL3)
4+
common.skip('missing crypto, or OpenSSL version lower than 3');
55

66
const fixtures = require('../common/fixtures');
77
const { inspect } = require('util');
@@ -85,6 +85,7 @@ test('AES256-SHA', U, 'AES256-SHA');
8585

8686
test(U, 'TLS_AES_256_GCM_SHA384', 'TLS_AES_256_GCM_SHA384');
8787
test('TLS_AES_256_GCM_SHA384', U, 'TLS_AES_256_GCM_SHA384');
88+
test('TLS_AES_256_GCM_SHA384:!TLS_CHACHA20_POLY1305_SHA256', U, 'TLS_AES_256_GCM_SHA384');
8889

8990
// Do not have shared ciphers.
9091
test('TLS_AES_256_GCM_SHA384', 'TLS_CHACHA20_POLY1305_SHA256',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.