openssl/ssl/quic
Neil Horman 89e2c6f61e Fix encryption level ordering
It was noticed recently that the enum for QUIC encryption levels doesn't
match the ordering that is outlined in the RFC.  RFC 9000 s. 12.2 and
RFC 9002 s 14.4.1 indicate that encryption level ordering is
INITIAL/0RTT/HANDSHAKE/1RTT, but our enum is in the order
INITAL/HANDSHAKE/0RTT/1RTT.

Our enum isn't a direct wire translation, so as long as the wire->enum
mapping done in ossl_quic_pkt_type_to_enc_level is done consistently it
ideally wouldn't matter, but because we do coalescing in
ossl_quic_tx_packetiser_generate by iterating through all the values in
the enum, its possible we may coalesce in the wrong order when we do
start implementing 0RTT support.

Fix it by adjusting the enum properly to match the RFC order.  This also
necessitates and adjustment to the archetypes array, which is a two
dimensional array indexed by encryption level and frame archetype
(PROBE/NORMAL/ACK ONLY).  Moving the 0RTT enc level to index 1 requires
moving the (formerly) index 2 0RTT array row to be at index 1.

Fixes #26324

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26334)
2025-01-08 11:17:01 -05:00
..
build.info
cc_newreno.c
json_enc.c
qlog_event_helpers.c
qlog.c
quic_ackm.c
quic_cfq.c
quic_channel_local.h
quic_channel.c
quic_demux.c use-of-uninitialized-value in quic_tserver_test 2025-01-06 20:46:08 +01:00
quic_engine_local.h
quic_engine.c
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
quic_reactor.c
quic_record_rx.c
quic_record_shared.c
quic_record_shared.h
quic_record_tx.c
quic_record_util.c
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
quic_thread_assist.c
quic_tls.c
quic_trace.c
quic_tserver.c
quic_txp.c Fix encryption level ordering 2025-01-08 11:17:01 -05: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