Skip to content

Commit

Permalink
QUIC CONFORMANCE: RFC 9000 s. 19.13: STREAM_DATA_BLOCKED Frames
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 b5b40c4 commit f084a8f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ssl/quic/quic_rx_depack.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,23 @@ static int depack_do_frame_stream_data_blocked(PACKET *pkt,
&stream))
return 0; /* error already raised for us */

if (stream == NULL)
return 1; /* old deleted stream, not a protocol violation, ignore */

if (!ossl_quic_stream_has_recv(stream)) {
/*
* RFC 9000 s. 19.14: "An endpoint that receives a STREAM_DATA_BLOCKED
* frame for a send-only stream MUST terminate the connection with error
* STREAM_STATE_ERROR."
*/
ossl_quic_channel_raise_protocol_error(ch,
QUIC_ERR_STREAM_STATE_ERROR,
OSSL_QUIC_FRAME_TYPE_STREAM_DATA_BLOCKED,
"STREAM_DATA_BLOCKED frame for "
"TX only stream");
return 0;
}

/* No-op - informative/debugging frame. */
return 1;
}
Expand Down

0 comments on commit f084a8f

Please sign in to comment.