Skip to content

Commit

Permalink
QUIC CONFORMANCE: RFC 9000 s. 17.2.2: Enforce no initial token from s…
Browse files Browse the repository at this point in the history
…erver

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 08cb9a8 commit fd0d593
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ssl/quic/quic_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,6 +1908,19 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch)
break;
}

if (!ch->is_server
&& ch->qrx_pkt->hdr->type == QUIC_PKT_TYPE_INITIAL
&& ch->qrx_pkt->hdr->token_len > 0) {
/*
* RFC 9000 s. 17.2.2: Clients that receive an Initial packet with a
* non-zero Token Length field MUST either discard the packet or
* generate a connection error of type PROTOCOL_VIOLATION.
*/
ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_PROTOCOL_VIOLATION,
0, "client received initial token");
break;
}

/* This packet contains frames, pass to the RXDP. */
ossl_quic_handle_frames(ch, ch->qrx_pkt); /* best effort */
break;
Expand Down

0 comments on commit fd0d593

Please sign in to comment.