GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tls: ciphers allow bang syntax · nodejs/node@52b5693

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/tls
    • secure-context.js
  • test/parallel
    • test-tls-set-ciphers.js
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.