openssl/ssl/quic
Neil Horman 2de7e1d698 Fix SSL_write_[ex|ex2] on blocking quic streams
When writing to a blocking quic stream, we sometimes get duplicate
transmitted data.  This occurs when a call to quic_write_blocking has to
wait for space to become available in the ring buffer.  When we do a
wait, the call sets *written to the value returned in args.total_written
as filled out by the calls to block_until_pred->quic_write_again.
However, the value there is based on the amount we requested, which is
only the remaining data that we didn't append in xso_sstream_write.  So
if we call quic_write_blocking with a buffer of length X, and initially
append Y bytes, and write the remainig X-Y bytes via a block_until_pred
call, then *written will return with the value X-Y, even though we wrote
the full X bytes to the ring buffer.

Fix it by recording the initial amount appended into *written, and then
add the args.total_written value if we have to wait on more space

Fixes openssl/project#924

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26023)
2024-11-21 09:41:15 -05:00
..
build.info
cc_newreno.c
json_enc.c
qlog_event_helpers.c
qlog.c
quic_ackm.c
quic_cfq.c Copyright year updates 2024-09-05 09:35:49 +02:00
quic_channel_local.h
quic_channel.c
quic_demux.c
quic_engine_local.h
quic_engine.c Rename list macros 2024-09-26 10:02:30 +02:00
quic_fc.c
quic_fifd.c
quic_impl.c Fix SSL_write_[ex|ex2] on blocking quic streams 2024-11-21 09:41:15 -05:00
quic_lcidm.c
quic_local.h
quic_method.c
quic_port_local.h
quic_port.c Keep hold of a reference to the user SSL in QUIC 2024-11-07 12:05:23 +01:00
quic_rcidm.c Rename list macros 2024-09-26 10:02:30 +02:00
quic_reactor.c
quic_record_rx.c
quic_record_shared.c
quic_record_shared.h
quic_record_tx.c
quic_record_util.c Copyright year updates 2024-09-05 09:35:49 +02:00
quic_rstream.c
quic_rx_depack.c
quic_sf_list.c
quic_srt_gen.c
quic_srtm.c
quic_sstream.c
quic_statm.c
quic_stream_map.c Add (void) cast to result of ossl_quic_rxfc_on_retire() 2024-07-08 18:17:15 +02:00
quic_thread_assist.c
quic_tls.c
quic_trace.c Copyright year updates 2024-09-05 09:35:49 +02:00
quic_tserver.c Use correctly formatted ALPN data in tserver 2024-06-27 10:30:51 +01:00
quic_txp.c txp_generate_stream_frames(): Set stream id in header early enough 2024-11-12 16:56:09 +01:00
quic_txpim.c
quic_types.c
quic_wire_pkt.c Fix memory leaks in ossl_quic_calculate_retry_integrity_tag() 2024-10-23 15:14:08 +02:00
quic_wire.c
uint_set.c