]> git.ipfire.org Git - thirdparty/openssl.git/commit
Detect fin state of a QUIC stream for streams which are completely read
authorNeil Horman <nhorman@openssl.org>
Thu, 5 Sep 2024 19:49:14 +0000 (15:49 -0400)
committerNeil Horman <nhorman@openssl.org>
Fri, 13 Sep 2024 19:05:29 +0000 (15:05 -0400)
commitc8127df04cae8d6a0d913e6e5c760062817a202e
tree87c312d23f1840c3c12e15f06ef1a91b15737fac
parent8e0d479b98357bb20ab1bd073cf75f7d42531553
Detect fin state of a QUIC stream for streams which are completely read

SSL_poll indicates that a stream which has had the fin bit set on it,
should generate SSL_POLL_EVENT_R events, so that applications can detect
stream completion via SSL_read_ex and SSL_get_error returning
SSL_ERROR_ZERO_RETURN.

However, the quic polling code misses on this, as a client that
completely reads a buffer after receipt has its underlying stream buffer
freed, loosing the fin status

We can however detect stream completion still, as a stream which has
been finalized, and had all its data read will be in the
QUIC_RSTREAM_STATE_DATA_READ state, iff the fin bit was set.

Fix it by checking in test_poll_event_r for that state, and generating a
SSL_POLL_EVENT_R if its found to be true, so as to stay in line with the
docs.

Fixes openssl/private#627

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Sasa Nedvedicky <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25399)
ssl/quic/quic_impl.c