From f666a1b754a028652f167573d8c6b8d7b0ecc5c7 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Fri, 20 Sep 2024 13:59:22 -0400 Subject: [PATCH] tls: fix 'ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED' typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Fabian Iwand PR-URL: https://github.com/nodejs/node/pull/52627 Fixes: https://github.com/nodejs/node/issues/52448 Refs: https://github.com/nodejs/node/pull/23188 Reviewed-By: Filip Skokan Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Marco Ippolito Reviewed-By: Rafael Gonzaga --- doc/api/errors.md | 4 ++-- doc/api/tls.md | 2 +- src/crypto/crypto_tls.cc | 2 +- src/node_errors.h | 4 ++-- test/parallel/test-tls-psk-errors.js | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 558bc46088a..78456d0d28e 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -2803,9 +2803,9 @@ event is emitted before continuing. Attempting to set a TLS protocol `minVersion` or `maxVersion` conflicts with an attempt to set the `secureProtocol` explicitly. Use one mechanism or the other. - + -### `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` +### `ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED` Failed to set PSK identity hint. Hint may be too long. diff --git a/doc/api/tls.md b/doc/api/tls.md index 6959a053031..4c06e006a95 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -2210,7 +2210,7 @@ changes: * `pskIdentityHint` {string} optional hint to send to a client to help with selecting the identity during TLS-PSK negotiation. Will be ignored in TLS 1.3. Upon failing to set pskIdentityHint `'tlsClientError'` will be - emitted with `'ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED'` code. + emitted with `'ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED'` code. * ...: Any [`tls.createSecureContext()`][] option can be provided. For servers, the identity options (`pfx`, `key`/`cert`, or `pskCallback`) are usually required. diff --git a/src/crypto/crypto_tls.cc b/src/crypto/crypto_tls.cc index 4013c1d8e2f..714efca9d8a 100644 --- a/src/crypto/crypto_tls.cc +++ b/src/crypto/crypto_tls.cc @@ -1413,7 +1413,7 @@ void TLSWrap::SetPskIdentityHint(const FunctionCallbackInfo& args) { Utf8Value hint(isolate, args[0].As()); if (!SSL_use_psk_identity_hint(p->ssl_.get(), *hint)) { - Local err = node::ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED(isolate); + Local err = node::ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED(isolate); p->MakeCallback(env->onerror_string(), 1, &err); } } diff --git a/src/node_errors.h b/src/node_errors.h index 171e2a2e090..ad86276f72d 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -104,7 +104,7 @@ void OOMErrorHandler(const char* location, const v8::OOMDetails& details); V(ERR_SCRIPT_EXECUTION_TIMEOUT, Error) \ V(ERR_STRING_TOO_LONG, Error) \ V(ERR_TLS_INVALID_PROTOCOL_METHOD, TypeError) \ - V(ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED, Error) \ + V(ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED, Error) \ V(ERR_VM_MODULE_CACHED_DATA_REJECTED, Error) \ V(ERR_VM_MODULE_LINK_FAILURE, Error) \ V(ERR_WASI_NOT_STARTED, Error) \ @@ -202,7 +202,7 @@ ERRORS_WITH_CODE(V) "--experimental-print-required-tla.") \ V(ERR_SCRIPT_EXECUTION_INTERRUPTED, \ "Script execution was interrupted by `SIGINT`") \ - V(ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED, "Failed to set PSK identity hint") \ + V(ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED, "Failed to set PSK identity hint") \ V(ERR_WASI_NOT_STARTED, "wasi.start() has not been called") \ V(ERR_WORKER_INIT_FAILED, "Worker initialization failure") \ V(ERR_PROTO_ACCESS, \ diff --git a/test/parallel/test-tls-psk-errors.js b/test/parallel/test-tls-psk-errors.js index 4864a66f555..98627c0b235 100644 --- a/test/parallel/test-tls-psk-errors.js +++ b/test/parallel/test-tls-psk-errors.js @@ -17,7 +17,7 @@ const tls = require('tls'); }); server.on('tlsClientError', (err) => { assert.ok(err instanceof Error); - assert.strictEqual(err.code, 'ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED'); + assert.strictEqual(err.code, 'ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED'); server.close(); }); server.listen(0, () => {