Skip to content

Commit

Permalink
QUIC CONFORMANCE: Enforce packet header reserved bits
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #21135)
  • Loading branch information
hlandau authored and paulidale committed Jul 16, 2023
1 parent 5b9452e commit 08cb9a8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ssl/quic/quic_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,18 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch)
*/
return;

/*
* RFC 9000 s. 17.2: "An endpoint MUST treat receipt of a packet that has a
* non-zero value for [the reserved bits] after removing both packet and
* header protection as a connection error of type PROTOCOL_VIOLATION."
*/
if (ossl_quic_pkt_type_is_encrypted(ch->qrx_pkt->hdr->type)
&& ch->qrx_pkt->hdr->reserved != 0) {
ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_PROTOCOL_VIOLATION,
0, "packet header reserved bits");
return;
}

/* Handle incoming packet. */
switch (ch->qrx_pkt->hdr->type) {
case QUIC_PKT_TYPE_RETRY:
Expand Down

0 comments on commit 08cb9a8

Please sign in to comment.