quic: remove CryptoKey support from session keys option · nodejs/node@3ef0a5b · GitHub
Skip to content

Commit 3ef0a5b

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 bfff8cb commit 3ef0a5b

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

doc/api/quic.md

Lines changed: 5 additions & 1 deletion

lib/internal/quic/quic.js

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

9999
const {
100100
isKeyObject,
101-
isCryptoKey,
102101
} = require('internal/crypto/keys');
103102

104103
const {
@@ -143,7 +142,6 @@ const {
143142
kVersionNegotiation,
144143
kInspect,
145144
kKeyObjectHandle,
146-
kKeyObjectInner,
147145
kWantsHeaders,
148146
kWantsTrailers,
149147
} = require('internal/quic/symbols');
@@ -187,7 +185,6 @@ const onSessionHandshakeChannel = dc.channel('quic.session.handshake');
187185
/**
188186
* @typedef {import('../socketaddress.js').SocketAddress} SocketAddress
189187
* @typedef {import('../crypto/keys.js').KeyObject} KeyObject
190-
* @typedef {import('../crypto/keys.js').CryptoKey} CryptoKey
191188
*/
192189

193190
/**
@@ -260,7 +257,7 @@ const onSessionHandshakeChannel = dc.channel('quic.session.handshake');
260257
* @property {boolean} [verifyClient] Verify the client
261258
* @property {boolean} [tlsTrace] Enable TLS tracing
262259
* @property {boolean} [verifyPrivateKey] Verify the private key
263-
* @property {KeyObject|CryptoKey|Array<KeyObject|CryptoKey>} [keys] The keys
260+
* @property {KeyObject|KeyObject[]} [keys] The keys
264261
* @property {ArrayBuffer|ArrayBufferView|Array<ArrayBuffer|ArrayBufferView>} [certs] The certificates
265262
* @property {ArrayBuffer|ArrayBufferView|Array<ArrayBuffer|ArrayBufferView>} [ca] The certificate authority
266263
* @property {ArrayBuffer|ArrayBufferView|Array<ArrayBuffer|ArrayBufferView>} [crl] The certificate revocation list
@@ -2171,13 +2168,8 @@ function processTlsOptions(tls, forServer) {
21712168
throw new ERR_INVALID_ARG_VALUE('options.keys', key, 'must be a private key');
21722169
}
21732170
ArrayPrototypePush(keyHandles, key[kKeyObjectHandle]);
2174-
} else if (isCryptoKey(key)) {
2175-
if (key.type !== 'private') {
2176-
throw new ERR_INVALID_ARG_VALUE('options.keys', key, 'must be a private key');
2177-
}
2178-
ArrayPrototypePush(keyHandles, key[kKeyObjectInner][kKeyObjectHandle]);
21792171
} else {
2180-
throw new ERR_INVALID_ARG_TYPE('options.keys', ['KeyObject', 'CryptoKey'], key);
2172+
throw new ERR_INVALID_ARG_TYPE('options.keys', 'KeyObject', key);
21812173
}
21822174
}
21832175
}

lib/internal/quic/symbols.js

Lines changed: 0 additions & 2 deletions

0 commit comments

Comments
 (0)