Skip to content

Commit

Permalink
BUG/MINOR: quic: reject NEW_TOKEN frames from clients
Browse files Browse the repository at this point in the history
As specified by RFC 9000, reject NEW_TOKEN frames emitted by clients.
Close the connection with error code PROTOCOL_VIOLATION.

This must be backported up to 2.6.
  • Loading branch information
a-denoyelle committed Jan 10, 2025
1 parent a2c0c45 commit 4a5d82a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/quic_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,21 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt,

break;
case QUIC_FT_NEW_TOKEN:
/* TODO */
if (qc_is_listener(qc)) {
TRACE_ERROR("reject NEW_TOKEN frame emitted by client",
QUIC_EV_CONN_PRSHPKT, qc);

/* RFC 9000 19.7. NEW_TOKEN Frames
* Clients MUST NOT send NEW_TOKEN frames. A server MUST treat receipt
* of a NEW_TOKEN frame as a connection error of type
* PROTOCOL_VIOLATION.
*/
quic_set_connection_close(qc, quic_err_transport(QC_ERR_PROTOCOL_VIOLATION));
goto err;
}
else {
/* TODO */
}
break;
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F:
{
Expand Down

0 comments on commit 4a5d82a

Please sign in to comment.