From 02a2cbf438fa255db97a41ccb08277372bf9b9e0 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Sun, 22 Mar 2020 12:15:54 +0300 Subject: [PATCH] Fixed CRYPTO offset generation. --- src/event/ngx_event_quic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index f30bd6a97..570945755 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -45,6 +45,9 @@ struct ngx_quic_connection_s { ngx_quic_streams_t streams; ngx_uint_t max_data; + +#define SSL_ECRYPTION_LAST ((ssl_encryption_application) + 1) + uint64_t crypto_offset[SSL_ECRYPTION_LAST]; }; @@ -228,9 +231,12 @@ ngx_quic_add_handshake_data(ngx_ssl_conn_t *ssl_conn, frame->level = level; frame->type = NGX_QUIC_FT_CRYPTO; + frame->u.crypto.offset += qc->crypto_offset[level]; frame->u.crypto.len = len; frame->u.crypto.data = p; + qc->crypto_offset[level] += len; + ngx_sprintf(frame->info, "crypto, generated by SSL len=%ui level=%d", len, level); ngx_quic_queue_frame(qc, frame);