From 3abf62b41a56b0e30f80e3fa1560397fd2cbe103 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 17 Aug 2021 22:18:18 +0900 Subject: [PATCH] nghttpx: Send stateless reset token in TP --- src/shrpx_http3_upstream.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/shrpx_http3_upstream.cc b/src/shrpx_http3_upstream.cc index e4b945ae..f312e231 100644 --- a/src/shrpx_http3_upstream.cc +++ b/src/shrpx_http3_upstream.cc @@ -477,6 +477,17 @@ int Http3Upstream::init(const UpstreamAddr *faddr, const Address &remote_addr, static_cast(quicconf.timeout.idle * NGTCP2_SECONDS); params.original_dcid = initial_hd.dcid; + auto &stateless_resetconf = quicconf.stateless_reset; + + rv = generate_quic_stateless_reset_token(params.stateless_reset_token, &scid, + stateless_resetconf.secret.data(), + stateless_resetconf.secret.size()); + if (rv != 0) { + LOG(ERROR) << "generate_quic_stateless_reset_token failed"; + return -1; + } + params.stateless_reset_token_present = 1; + auto path = ngtcp2_path{ {local_addr.len, const_cast(&local_addr.su.sa)}, {remote_addr.len, const_cast(&remote_addr.su.sa)},