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 QLOG: Minor updates 2024-02-02 11:50:29 +00:00
cc_newreno.c Resolve some of the TODO(QUIC) items 2023-08-08 15:58:59 +02:00
json_enc.c Copyright year updates 2024-04-09 13:43:26 +02:00
qlog_event_helpers.c Copyright year updates 2024-04-09 13:43:26 +02:00
qlog.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_ackm.c If the loss detection timer has fired we may not have lost packets 2023-10-30 08:01:58 +00:00
quic_cfq.c Copyright year updates 2024-09-05 09:35:49 +02:00
quic_channel_local.h QUIC CHANNEL: Optimise struct packing 2024-02-08 16:50:01 +00:00
quic_channel.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_demux.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_engine_local.h Minor updates 2023-12-21 08:12:06 +00:00
quic_engine.c Rename list macros 2024-09-26 10:02:30 +02:00
quic_fc.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_fifd.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_impl.c Fix SSL_write_[ex|ex2] on blocking quic streams 2024-11-21 09:41:15 -05:00
quic_lcidm.c QUIC CHANNEL, LCIDM: Factor duplicate CID generation function 2023-12-21 08:12:00 +00:00
quic_local.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_method.c Copyright year updates 2023-09-07 09:59:15 +01:00
quic_port_local.h Minor updates 2023-12-21 08:12:06 +00:00
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 Copyright year updates 2023-09-07 09:59:15 +01:00
quic_record_rx.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_record_shared.c ossl_qrl_enc_level_set_provide_secret(): Avoid leaking keyslot in error condition 2023-11-06 07:47:17 +00:00
quic_record_shared.h
quic_record_tx.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_record_util.c Copyright year updates 2024-09-05 09:35:49 +02:00
quic_rstream.c Copyright year updates 2023-09-07 09:59:15 +01:00
quic_rx_depack.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_sf_list.c Copyright year updates 2023-09-07 09:59:15 +01:00
quic_srt_gen.c QUIC SRT GEN: Minor updates 2023-11-25 09:14:05 +00:00
quic_srtm.c Copyright year updates 2024-04-09 13:43:26 +02:00
quic_sstream.c QUIC SSTREAM: Fix bug in ossl_quic_sstream_is_totally_acked 2023-11-02 08:49:01 +00:00
quic_statm.c Copyright year updates 2023-09-07 09:59:15 +01:00
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 Copyright year updates 2024-04-09 13:43:26 +02:00
quic_tls.c Copyright year updates 2024-04-09 13:43:26 +02:00
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 Copyright year updates 2023-09-07 09:59:15 +01:00
quic_types.c QUIC: Move CID generation to quic_types.c 2023-12-21 08:12:06 +00:00
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 Copyright year updates 2024-04-09 13:43:26 +02:00
uint_set.c Copyright year updates 2023-09-07 09:59:15 +01:00