From b6fc2294a1a5bd6053647afea02180147018112b Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Tue, 18 Apr 2023 19:30:56 +0100 Subject: [PATCH] QUIC RXDP: Record STOP_SENDING/RESET_STREAM event AEC codes consistently Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20765) --- include/internal/quic_stream_map.h | 12 ++++++++++++ ssl/quic/quic_rx_depack.c | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/internal/quic_stream_map.h b/include/internal/quic_stream_map.h index 51e175ffb8..152a21108d 100644 --- a/include/internal/quic_stream_map.h +++ b/include/internal/quic_stream_map.h @@ -60,6 +60,18 @@ struct quic_stream_st { */ uint64_t reset_stream_aec; + /* + * Application Error Code (AEC) for incoming STOP_SENDING frame. + * This is only valid if peer_stop_sending is 1. + */ + uint64_t peer_stop_sending_aec; + + /* + * Application Error Code (AEC) for incoming RESET_STREAM frame. + * This is only valid if peer_reset_stream is 1. + */ + uint64_t peer_reset_stream_aec; + /* Temporary value used by TXP. */ uint64_t txp_txfc_new_credit_consumed; diff --git a/ssl/quic/quic_rx_depack.c b/ssl/quic/quic_rx_depack.c index 2bc4e146e8..4b9805b01c 100644 --- a/ssl/quic/quic_rx_depack.c +++ b/ssl/quic/quic_rx_depack.c @@ -129,7 +129,9 @@ static int depack_do_frame_reset_stream(PACKET *pkt, return 0; } - stream->peer_reset_stream = 1; + stream->peer_reset_stream = 1; + stream->peer_reset_stream_aec = frame_data.app_error_code; + ossl_quic_stream_map_update_state(&ch->qsm, stream); return 1; } @@ -171,7 +173,8 @@ static int depack_do_frame_stop_sending(PACKET *pkt, return 0; } - stream->peer_stop_sending = 1; + stream->peer_stop_sending = 1; + stream->peer_stop_sending_aec = frame_data.app_error_code; /* * RFC 9000 s. 3.5: Receiving a STOP_SENDING frame means we must respond in