Skip to content

Commit 4c206ec

Browse files
panvaaduh95
authored andcommitted
quic: remove CryptoKey support from session keys option
PR-URL: #62335 Refs: #55293 Refs: #62321 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent a6ced7d commit 4c206ec

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

doc/api/quic.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,9 +1197,13 @@ True to enable TLS keylogging output.
11971197

11981198
<!-- YAML
11991199
added: v23.8.0
1200+
changes:
1201+
- version: REPLACEME
1202+
pr-url: https://github.com/nodejs/node/pull/62335
1203+
description: CryptoKey is no longer accepted.
12001204
-->
12011205

1202-
* Type: {KeyObject|CryptoKey|KeyObject\[]|CryptoKey\[]}
1206+
* Type: {KeyObject|KeyObject\[]}
12031207

12041208
The TLS crypto keys to use for sessions.
12051209

lib/internal/quic/quic.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ const {
9393

9494
const {
9595
isKeyObject,
96-
isCryptoKey,
9796
} = require('internal/crypto/keys');
9897

9998
const {
@@ -138,7 +137,6 @@ const {
138137
kVersionNegotiation,
139138
kInspect,
140139
kKeyObjectHandle,
141-
kKeyObjectInner,
142140
kWantsHeaders,
143141
kWantsTrailers,
144142
} = require('internal/quic/symbols');
@@ -182,7 +180,6 @@ const onSessionHandshakeChannel = dc.channel('quic.session.handshake');
182180
/**
183181
* @typedef {import('../socketaddress.js').SocketAddress} SocketAddress
184182
* @typedef {import('../crypto/keys.js').KeyObject} KeyObject
185-
* @typedef {import('../crypto/keys.js').CryptoKey} CryptoKey
186183
*/
187184

188185
/**
@@ -255,7 +252,7 @@ const onSessionHandshakeChannel = dc.channel('quic.session.handshake');
255252
* @property {boolean} [verifyClient] Verify the client
256253
* @property {boolean} [tlsTrace] Enable TLS tracing
257254
* @property {boolean} [verifyPrivateKey] Verify the private key
258-
* @property {KeyObject|CryptoKey|Array<KeyObject|CryptoKey>} [keys] The keys
255+
* @property {KeyObject|KeyObject[]} [keys] The keys
259256
* @property {ArrayBuffer|ArrayBufferView|Array<ArrayBuffer|ArrayBufferView>} [certs] The certificates
260257
* @property {ArrayBuffer|ArrayBufferView|Array<ArrayBuffer|ArrayBufferView>} [ca] The certificate authority
261258
* @property {ArrayBuffer|ArrayBufferView|Array<ArrayBuffer|ArrayBufferView>} [crl] The certificate revocation list
@@ -1999,13 +1996,8 @@ function processTlsOptions(tls, forServer) {
19991996
throw new ERR_INVALID_ARG_VALUE('options.keys', key, 'must be a private key');
20001997
}
20011998
ArrayPrototypePush(keyHandles, key[kKeyObjectHandle]);
2002-
} else if (isCryptoKey(key)) {
2003-
if (key.type !== 'private') {
2004-
throw new ERR_INVALID_ARG_VALUE('options.keys', key, 'must be a private key');
2005-
}
2006-
ArrayPrototypePush(keyHandles, key[kKeyObjectInner][kKeyObjectHandle]);
20071999
} else {
2008-
throw new ERR_INVALID_ARG_TYPE('options.keys', ['KeyObject', 'CryptoKey'], key);
2000+
throw new ERR_INVALID_ARG_TYPE('options.keys', 'KeyObject', key);
20092001
}
20102002
}
20112003
}

lib/internal/quic/symbols.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const {
1010

1111
const {
1212
kHandle: kKeyObjectHandle,
13-
kKeyObject: kKeyObjectInner,
1413
} = require('internal/crypto/util');
1514

1615
// Symbols used to hide various private properties and methods from the
@@ -54,7 +53,6 @@ module.exports = {
5453
kHeaders,
5554
kInspect,
5655
kKeyObjectHandle,
57-
kKeyObjectInner,
5856
kListen,
5957
kNewSession,
6058
kNewStream,

0 commit comments

Comments
 (0)