From: Hugo Landau Date: Tue, 6 Jun 2023 15:25:12 +0000 (+0100) Subject: QUIC CONFORMANCE: RFC 9000 s. 19.16: RETIRE_CONNECTION_ID frames X-Git-Tag: openssl-3.2.0-alpha1~435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f37befa0480ec5d8362a5894e610a676987215b7;p=thirdparty%2Fopenssl.git QUIC CONFORMANCE: RFC 9000 s. 19.16: RETIRE_CONNECTION_ID frames Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/21135) --- diff --git a/ssl/quic/quic_rx_depack.c b/ssl/quic/quic_rx_depack.c index 76d79ef388e..11404f31461 100644 --- a/ssl/quic/quic_rx_depack.c +++ b/ssl/quic/quic_rx_depack.c @@ -851,7 +851,27 @@ static int depack_do_frame_retire_conn_id(PACKET *pkt, return 0; } - /* TODO(QUIC): Post MVP ADD CODE to send |seq_num| to the ch manager */ + /* + * RFC 9000 s. 19.16: "An endpoint cannot send this frame if it was provided + * with a zero-length connection ID by its peer. An endpoint that provides a + * zero-length connection ID MUST treat receipt of a RETIRE_CONNECTION_ID + * frame as a connection error of type PROTOCOL_VIOLATION." + * + * Since we always use a zero-length SCID as a client, there is no case + * where it is valid for a server to send this. Our server support is + * currently non-conformant and for internal testing use; simply handle it + * as a no-op in this case. + * + * TODO(QUIC): Revise and implement correctly for server support. + */ + if (!ch->is_server) { + ossl_quic_channel_raise_protocol_error(ch, + QUIC_ERR_PROTOCOL_VIOLATION, + OSSL_QUIC_FRAME_TYPE_RETIRE_CONN_ID, + "conn has zero-length CID"); + return 0; + } + return 1; }