comparison src/event/ngx_event_quic.c @ 8200:9582adbc7d70 quic

Fixed nonce in short packet protection.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 10 Mar 2020 18:40:18 +0300
parents 1297dc83a6b9
children 5c66dadb1e34
comparison
equal deleted inserted replaced
8199:1297dc83a6b9 8200:9582adbc7d70
756 default: 756 default:
757 return NGX_ERROR; 757 return NGX_ERROR;
758 } 758 }
759 759
760 nonce = ngx_pstrdup(c->pool, &pkt->secret->iv); 760 nonce = ngx_pstrdup(c->pool, &pkt->secret->iv);
761 if (pkt->level == ssl_encryption_handshake) { 761 if (pkt->level == ssl_encryption_handshake
762 || pkt->level == ssl_encryption_application)
763 {
762 nonce[11] ^= (*pkt->number - 1); 764 nonce[11] ^= (*pkt->number - 1);
763 } 765 }
764 766
765 ngx_quic_hexdump0(c->log, "server_iv", pkt->secret->iv.data, 12); 767 ngx_quic_hexdump0(c->log, "server_iv", pkt->secret->iv.data, 12);
766 ngx_quic_hexdump0(c->log, "nonce", nonce, 12); 768 ngx_quic_hexdump0(c->log, "nonce", nonce, 12);