# HG changeset patch # User Sergey Kandaurov # Date 1586010879 -10800 # Node ID 1bb5e8538d0c76466b9f8048e125d823fd82cacd # Parent 435fed8e24893b6fc31e58158a096fa43364ddb4 Removed excessive debugging in QUIC packet creation. While here, eliminated further difference in between. diff --git a/src/event/ngx_event_quic_protection.c b/src/event/ngx_event_quic_protection.c --- a/src/event/ngx_event_quic_protection.c +++ b/src/event/ngx_event_quic_protection.c @@ -698,8 +698,7 @@ ngx_quic_create_long_packet(ngx_quic_hea } ngx_quic_hexdump0(pkt->log, "sample", sample, 16); - ngx_quic_hexdump0(pkt->log, "mask", mask, 16); - ngx_quic_hexdump0(pkt->log, "hp_key", pkt->secret->hp.data, 16); + ngx_quic_hexdump0(pkt->log, "mask", mask, 5); /* quic-tls: 5.4.1. Header Protection Application */ ad.data[0] ^= mask[0] & 0x0f; @@ -729,6 +728,8 @@ ngx_quic_create_short_packet(ngx_quic_he ad.data = res->data; ad.len = ngx_quic_create_short_header(pkt, ad.data, out.len, &pnp); + out.data = res->data + ad.len; + ngx_quic_hexdump0(pkt->log, "ad", ad.data, ad.len); if (ngx_quic_ciphers(ssl_conn, &ciphers, pkt->level) == NGX_ERROR) { @@ -745,17 +746,13 @@ ngx_quic_create_short_packet(ngx_quic_he ngx_quic_hexdump0(pkt->log, "server_iv", pkt->secret->iv.data, 12); ngx_quic_hexdump0(pkt->log, "nonce", nonce, 12); - out.data = res->data + ad.len; - - if (ngx_quic_tls_seal(ciphers.c, pkt->secret, &out, nonce, &pkt->payload, - &ad, pkt->log) + if (ngx_quic_tls_seal(ciphers.c, pkt->secret, &out, + nonce, &pkt->payload, &ad, pkt->log) != NGX_OK) { return NGX_ERROR; } - ngx_quic_hexdump0(pkt->log, "out", out.data, out.len); - sample = &out.data[4 - pkt->num_len]; if (ngx_quic_tls_hp(pkt->log, ciphers.hp, pkt->secret, mask, sample) != NGX_OK) @@ -764,8 +761,7 @@ ngx_quic_create_short_packet(ngx_quic_he } ngx_quic_hexdump0(pkt->log, "sample", sample, 16); - ngx_quic_hexdump0(pkt->log, "mask", mask, 16); - ngx_quic_hexdump0(pkt->log, "hp_key", pkt->secret->hp.data, 16); + ngx_quic_hexdump0(pkt->log, "mask", mask, 5); /* quic-tls: 5.4.1. Header Protection Application */ ad.data[0] ^= mask[0] & 0x1f; @@ -776,8 +772,6 @@ ngx_quic_create_short_packet(ngx_quic_he res->len = ad.len + out.len; - ngx_quic_hexdump0(pkt->log, "packet", res->data, res->len); - return NGX_OK; }