Skip to content

Commit 58b9217

Browse files
committed
QUIC: discarding 0-RTT keys.
For simplicity, this is done on successful decryption of a 1-RTT packet.
1 parent 250baed commit 58b9217

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/event/quic/ngx_event_quic.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,16 @@ ngx_quic_handle_payload(ngx_connection_t *c, ngx_quic_header_t *pkt)
10221022
}
10231023
}
10241024

1025+
if (pkt->level == ssl_encryption_application) {
1026+
/*
1027+
* RFC 9001, 4.9.3. Discarding 0-RTT Keys
1028+
*
1029+
* After receiving a 1-RTT packet, servers MUST discard
1030+
* 0-RTT keys within a short time
1031+
*/
1032+
ngx_quic_discard_ctx(c, ssl_encryption_early_data);
1033+
}
1034+
10251035
if (qc->closing) {
10261036
/*
10271037
* RFC 9000, 10.2. Immediate Close

0 commit comments

Comments
 (0)