aboutsummaryrefslogtreecommitdiff
path: root/src/event/quic/ngx_event_quic_output.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2023-05-04 19:29:34 +0400
committerRoman Arutyunyan <arut@nginx.com>2023-05-04 19:29:34 +0400
commit13f81f9b88dd9de6d2ff10c3e4aa9a4a160ee7ed (patch)
treed6ba0f6bf8a126b6afae56a899a59dd6b93c3bd5 /src/event/quic/ngx_event_quic_output.c
parent2187e5e1d9667aa5d0c137186a3e91c3c88dfa23 (diff)
downloadnginx-13f81f9b88dd9de6d2ff10c3e4aa9a4a160ee7ed.tar.gz
nginx-13f81f9b88dd9de6d2ff10c3e4aa9a4a160ee7ed.zip
QUIC: fixed encryption level in ngx_quic_frame_sendto().
Previously, ssl_encryption_application was hardcoded. Before 9553eea74f2a, ngx_quic_frame_sendto() was used only for PATH_CHALLENGE/PATH_RESPONSE sent at the application level only. Since 9553eea74f2a, ngx_quic_frame_sendto() is also used for CONNECTION_CLOSE, which can be sent at initial level after SSL handshake error or rejection. This resulted in packet encryption error. Now level is copied from frame, which fixes the error.
Diffstat (limited to 'src/event/quic/ngx_event_quic_output.c')
-rw-r--r--src/event/quic/ngx_event_quic_output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event/quic/ngx_event_quic_output.c b/src/event/quic/ngx_event_quic_output.c
index 8cf844460..38006a9a5 100644
--- a/src/event/quic/ngx_event_quic_output.c
+++ b/src/event/quic/ngx_event_quic_output.c
@@ -1223,7 +1223,7 @@ ngx_quic_frame_sendto(ngx_connection_t *c, ngx_quic_frame_t *frame,
static u_char dst[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE];
qc = ngx_quic_get_connection(c);
- ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_application);
+ ctx = ngx_quic_get_send_ctx(qc, frame->level);
ngx_quic_init_packet(c, ctx, &pkt, path);