Skip to content

Commit

Permalink
tls: fix 'ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED' typo
Browse files Browse the repository at this point in the history
Co-Authored-By: Fabian Iwand <mootari@users.noreply.github.com>
PR-URL: nodejs#52627
Fixes: nodejs#52448
Refs: nodejs#23188
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
  • Loading branch information
2 people authored and tpoisseau committed Nov 21, 2024
1 parent 6ebaad6 commit e3ba0b1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<a id="ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED"></a>
<a id="ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED"></a>

### `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.

Expand Down
2 changes: 1 addition & 1 deletion doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto_tls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ void TLSWrap::SetPskIdentityHint(const FunctionCallbackInfo<Value>& args) {
Utf8Value hint(isolate, args[0].As<String>());

if (!SSL_use_psk_identity_hint(p->ssl_.get(), *hint)) {
Local<Value> err = node::ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED(isolate);
Local<Value> err = node::ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED(isolate);
p->MakeCallback(env->onerror_string(), 1, &err);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/node_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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, \
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-psk-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand Down

0 comments on commit e3ba0b1

Please sign in to comment.