Skip to content

Commit e49d730

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update ngtcp2 to 1.23.0
PR-URL: #63777 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent e5c0790 commit e49d730

114 files changed

Lines changed: 7184 additions & 9765 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deps/ngtcp2/ngtcp2/crypto/boringssl/boringssl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ int ngtcp2_crypto_hp_mask(uint8_t *dest, const ngtcp2_crypto_cipher *hp,
432432
int ngtcp2_crypto_read_write_crypto_data(
433433
ngtcp2_conn *conn, ngtcp2_encryption_level encryption_level,
434434
const uint8_t *data, size_t datalen) {
435-
SSL *ssl = ngtcp2_conn_get_tls_native_handle(conn);
435+
SSL *ssl = ngtcp2_conn_get_tls_native_handle2(conn);
436436
int rv;
437437
int err;
438438

@@ -444,7 +444,7 @@ int ngtcp2_crypto_read_write_crypto_data(
444444
return -1;
445445
}
446446

447-
if (!ngtcp2_conn_get_handshake_completed(conn)) {
447+
if (!ngtcp2_conn_get_handshake_completed2(conn)) {
448448
retry:
449449
rv = SSL_do_handshake(ssl);
450450
if (rv <= 0) {
@@ -456,7 +456,7 @@ int ngtcp2_crypto_read_write_crypto_data(
456456
case SSL_ERROR_SSL:
457457
return -1;
458458
case SSL_ERROR_EARLY_DATA_REJECTED:
459-
assert(!ngtcp2_conn_is_server(conn));
459+
assert(!ngtcp2_conn_is_server2(conn));
460460

461461
SSL_reset_early_data_reject(ssl);
462462

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* ngtcp2
3+
*
4+
* Copyright (c) 2026 ngtcp2 contributors
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining
7+
* a copy of this software and associated documentation files (the
8+
* "Software"), to deal in the Software without restriction, including
9+
* without limitation the rights to use, copy, modify, merge, publish,
10+
* distribute, sublicense, and/or sell copies of the Software, and to
11+
* permit persons to whom the Software is furnished to do so, subject to
12+
* the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be
15+
* included in all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
*/
25+
#ifdef HAVE_CONFIG_H
26+
# include <config.h>
27+
#endif /* defined(HAVE_CONFIG_H) */
28+
29+
#include "munit.h"
30+
31+
/* include test cases' include files here */
32+
#include "shared_test.h"
33+
34+
int main(int argc, char *argv[]) {
35+
const MunitSuite suites[] = {
36+
shared_suite,
37+
{0},
38+
};
39+
const MunitSuite suite = {
40+
.prefix = "",
41+
.suites = suites,
42+
.iterations = 1,
43+
};
44+
45+
return munit_suite_main(&suite, NULL, argc, argv);
46+
}

deps/ngtcp2/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,16 @@ ngtcp2_crypto_hp_mask_cb(uint8_t *dest, const ngtcp2_crypto_cipher *hp,
338338
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_0RTT`) to
339339
* set negotiated AEAD and message digest algorithm. After the
340340
* successful call of this function, application can use
341-
* `ngtcp2_conn_get_crypto_ctx` (or `ngtcp2_conn_get_0rtt_crypto_ctx`
342-
* if |level| ==
341+
* `ngtcp2_conn_get_crypto_ctx2` (or
342+
* `ngtcp2_conn_get_0rtt_crypto_ctx2` if |level| ==
343343
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_0RTT`) to
344344
* get :type:`ngtcp2_crypto_ctx`.
345345
*
346346
* If |conn| is initialized as client, and |level| is
347347
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_1RTT`, this
348348
* function retrieves a remote QUIC transport parameters extension
349-
* from an object obtained by `ngtcp2_conn_get_tls_native_handle`, and
350-
* sets it to |conn| by calling
349+
* from an object obtained by `ngtcp2_conn_get_tls_native_handle2`,
350+
* and sets it to |conn| by calling
351351
* `ngtcp2_conn_decode_and_set_remote_transport_params`.
352352
*
353353
* This function returns 0 if it succeeds, or -1.
@@ -385,16 +385,16 @@ NGTCP2_EXTERN int ngtcp2_crypto_derive_and_install_rx_key(
385385
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_0RTT`) to
386386
* set negotiated AEAD and message digest algorithm. After the
387387
* successful call of this function, application can use
388-
* `ngtcp2_conn_get_crypto_ctx` (or `ngtcp2_conn_get_0rtt_crypto_ctx`
389-
* if |level| ==
388+
* `ngtcp2_conn_get_crypto_ctx2` (or
389+
* `ngtcp2_conn_get_0rtt_crypto_ctx2` if |level| ==
390390
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_0RTT`) to
391391
* get :type:`ngtcp2_crypto_ctx`.
392392
*
393393
* If |conn| is initialized as server, and |level| is
394394
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_1RTT`, this
395395
* function retrieves a remote QUIC transport parameters extension
396-
* from an object obtained by `ngtcp2_conn_get_tls_native_handle`, and
397-
* sets it to |conn| by calling
396+
* from an object obtained by `ngtcp2_conn_get_tls_native_handle2`,
397+
* and sets it to |conn| by calling
398398
* `ngtcp2_conn_decode_and_set_remote_transport_params`.
399399
*
400400
* This function returns 0 if it succeeds, or -1.
@@ -986,15 +986,17 @@ NGTCP2_EXTERN void ngtcp2_crypto_delete_crypto_cipher_ctx_cb(
986986
/**
987987
* @function
988988
*
989+
* .. warning::
990+
*
991+
* .. version-deprecated:: 1.22.0
992+
* Use `ngtcp2_crypto_get_path_challenge_data2_cb` instead.
993+
*
989994
* `ngtcp2_crypto_get_path_challenge_data_cb` writes unpredictable
990995
* sequence of :macro:`NGTCP2_PATH_CHALLENGE_DATALEN` bytes to |data|
991996
* which is sent with PATH_CHALLENGE frame.
992997
*
993998
* This function can be directly passed to
994999
* :member:`ngtcp2_callbacks.get_path_challenge_data` field.
995-
*
996-
* Deprecated since v1.22.0. Use
997-
* `ngtcp2_crypto_get_path_challenge_data2_cb` instead.
9981000
*/
9991001
NGTCP2_EXTERN int ngtcp2_crypto_get_path_challenge_data_cb(ngtcp2_conn *conn,
10001002
uint8_t *data,
@@ -1010,7 +1012,7 @@ NGTCP2_EXTERN int ngtcp2_crypto_get_path_challenge_data_cb(ngtcp2_conn *conn,
10101012
* This function can be directly passed to
10111013
* :member:`ngtcp2_callbacks.get_path_challenge_data2` field.
10121014
*
1013-
* This function has been available since v1.22.0.
1015+
* .. version-added:: 1.22.0
10141016
*/
10151017
NGTCP2_EXTERN int ngtcp2_crypto_get_path_challenge_data2_cb(
10161018
ngtcp2_conn *conn, ngtcp2_path_challenge_data *data, void *user_data);

deps/ngtcp2/ngtcp2/crypto/ossl/ossl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ static int crypto_ossl_ctx_write_crypto_data(ngtcp2_crypto_ossl_ctx *ossl_ctx,
440440
left = crypto_buf_left(ossl_ctx->crypto_write);
441441
}
442442

443-
n = ngtcp2_min_size((size_t)(end - data), left);
443+
n = ngtcp2_min((size_t)(end - data), left);
444444
crypto_buf_write(ossl_ctx->crypto_write, data, n);
445445
data += n;
446446
}
@@ -871,7 +871,7 @@ int ngtcp2_crypto_hp_mask(uint8_t *dest, const ngtcp2_crypto_cipher *hp,
871871
int ngtcp2_crypto_read_write_crypto_data(
872872
ngtcp2_conn *conn, ngtcp2_encryption_level encryption_level,
873873
const uint8_t *data, size_t datalen) {
874-
ngtcp2_crypto_ossl_ctx *ossl_ctx = ngtcp2_conn_get_tls_native_handle(conn);
874+
ngtcp2_crypto_ossl_ctx *ossl_ctx = ngtcp2_conn_get_tls_native_handle2(conn);
875875
SSL *ssl = ossl_ctx->ssl;
876876
int rv;
877877
int err;
@@ -881,7 +881,7 @@ int ngtcp2_crypto_read_write_crypto_data(
881881
return -1;
882882
}
883883

884-
if (!ngtcp2_conn_get_handshake_completed(conn)) {
884+
if (!ngtcp2_conn_get_handshake_completed2(conn)) {
885885
rv = SSL_do_handshake(ssl);
886886
if (rv <= 0) {
887887
err = SSL_get_error(ssl, rv);
@@ -1033,7 +1033,7 @@ static int ossl_yield_secret(SSL *ssl, uint32_t ossl_level, int direction,
10331033
}
10341034

10351035
conn = conn_ref->get_conn(conn_ref);
1036-
ossl_ctx = ngtcp2_conn_get_tls_native_handle(conn);
1036+
ossl_ctx = ngtcp2_conn_get_tls_native_handle2(conn);
10371037

10381038
if (direction) {
10391039
if (ngtcp2_crypto_derive_and_install_tx_key(conn, NULL, NULL, NULL, level,
@@ -1067,7 +1067,7 @@ static int ossl_crypto_send(SSL *ssl, const unsigned char *buf, size_t buflen,
10671067
}
10681068

10691069
conn = conn_ref->get_conn(conn_ref);
1070-
ossl_ctx = ngtcp2_conn_get_tls_native_handle(conn);
1070+
ossl_ctx = ngtcp2_conn_get_tls_native_handle2(conn);
10711071

10721072
rv = ngtcp2_conn_submit_crypto_data(conn, ossl_ctx->tx_level, buf, buflen);
10731073
if (rv != 0) {
@@ -1094,7 +1094,7 @@ static int ossl_crypto_recv_rcd(SSL *ssl, const unsigned char **buf,
10941094
}
10951095

10961096
conn = conn_ref->get_conn(conn_ref);
1097-
ossl_ctx = ngtcp2_conn_get_tls_native_handle(conn);
1097+
ossl_ctx = ngtcp2_conn_get_tls_native_handle2(conn);
10981098

10991099
crypto_ossl_ctx_read_crypto_data(ossl_ctx, buf, bytes_read);
11001100

@@ -1116,7 +1116,7 @@ static int ossl_crypto_release_rcd(SSL *ssl, size_t released, void *arg) {
11161116
}
11171117

11181118
conn = conn_ref->get_conn(conn_ref);
1119-
ossl_ctx = ngtcp2_conn_get_tls_native_handle(conn);
1119+
ossl_ctx = ngtcp2_conn_get_tls_native_handle2(conn);
11201120

11211121
crypto_ossl_ctx_release_crypto_data(ossl_ctx, released);
11221122

deps/ngtcp2/ngtcp2/crypto/picotls/picotls.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ int ngtcp2_crypto_hp_mask(uint8_t *dest, const ngtcp2_crypto_cipher *hp,
378378
int ngtcp2_crypto_read_write_crypto_data(
379379
ngtcp2_conn *conn, ngtcp2_encryption_level encryption_level,
380380
const uint8_t *data, size_t datalen) {
381-
ngtcp2_crypto_picotls_ctx *cptls = ngtcp2_conn_get_tls_native_handle(conn);
381+
ngtcp2_crypto_picotls_ctx *cptls = ngtcp2_conn_get_tls_native_handle2(conn);
382382
ptls_buffer_t sendbuf;
383383
size_t epoch_offsets[5] = {0};
384384
size_t epoch =
@@ -402,7 +402,7 @@ int ngtcp2_crypto_read_write_crypto_data(
402402
goto fin;
403403
}
404404

405-
if (!ngtcp2_conn_is_server(conn) &&
405+
if (!ngtcp2_conn_is_server2(conn) &&
406406
cptls->handshake_properties.client.early_data_acceptance ==
407407
PTLS_EARLY_DATA_REJECTED) {
408408
rv = ngtcp2_conn_tls_early_data_rejected(conn);
@@ -540,7 +540,7 @@ static int set_additional_extensions(ptls_handshake_properties_t *hsprops,
540540
return -1;
541541
}
542542

543-
nwrite = ngtcp2_conn_encode_local_transport_params(conn, buf, buflen);
543+
nwrite = ngtcp2_conn_encode_local_transport_params2(conn, buf, buflen);
544544
if (nwrite < 0) {
545545
goto fail;
546546
}
@@ -620,7 +620,7 @@ static int update_traffic_key_server_cb(ptls_update_traffic_key_t *self,
620620
* wait for the key to get the correct local transport
621621
* parameters from ngtcp2_conn.
622622
*/
623-
cptls = ngtcp2_conn_get_tls_native_handle(conn);
623+
cptls = ngtcp2_conn_get_tls_native_handle2(conn);
624624

625625
if (set_additional_extensions(&cptls->handshake_properties, conn) != 0) {
626626
return -1;

deps/ngtcp2/ngtcp2/crypto/quictls/quictls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ int ngtcp2_crypto_hp_mask(uint8_t *dest, const ngtcp2_crypto_cipher *hp,
812812
int ngtcp2_crypto_read_write_crypto_data(
813813
ngtcp2_conn *conn, ngtcp2_encryption_level encryption_level,
814814
const uint8_t *data, size_t datalen) {
815-
SSL *ssl = ngtcp2_conn_get_tls_native_handle(conn);
815+
SSL *ssl = ngtcp2_conn_get_tls_native_handle2(conn);
816816
int rv;
817817
int err;
818818

@@ -824,7 +824,7 @@ int ngtcp2_crypto_read_write_crypto_data(
824824
return -1;
825825
}
826826

827-
if (!ngtcp2_conn_get_handshake_completed(conn)) {
827+
if (!ngtcp2_conn_get_handshake_completed2(conn)) {
828828
rv = SSL_do_handshake(ssl);
829829
if (rv <= 0) {
830830
err = SSL_get_error(ssl, rv);

0 commit comments

Comments
 (0)