Repository navigation
[DTLS 1.3] Thread TLS Flavors through TLS 1.3 implementation - #6062
Open
atreiber94 wants to merge 1 commit into
Open
atreiber94 wants to merge 1 commit into
atreiber94 wants to merge 1 commit into
Conversation
This was referenced Oct 28, 2026
Open
atreiber94
force-pushed
the
dtls13/flavor_logic
branch
from
November 5, 2026 12:34
d5b4d1e to
d011cc6
Compare
atreiber94
marked this pull request as ready for review
November 5, 2026 12:35
atreiber94
force-pushed
the
dtls13/flavor_logic
branch
2 times, most recently
from
November 5, 2026 14:36
94ec7c9 to
ed0c628
Compare
Collaborator
|
|
reneme
force-pushed
the
dtls13/flavor_logic
branch
3 times, most recently
from
November 10, 2026 11:04
a4e74a0 to
783b2f4
Compare
Copilot stopped reviewing on behalf of
reneme due to an error
November 10, 2026 11:53
reneme
force-pushed
the
dtls13/flavor_logic
branch
3 times, most recently
from
November 10, 2026 13:42
07aeaeb to
7a30d25
Compare
atreiber94
force-pushed
the
dtls13/flavor_logic
branch
from
November 13, 2026 11:50
7a30d25 to
e5b4335
Compare
Collaborator
Author
|
Copilot comments are addressed, also removed |
atreiber94
force-pushed
the
dtls13/flavor_logic
branch
from
November 13, 2026 11:54
e5b4335 to
e16e843
Compare
Owner
|
Some merge conflicts, also should pick up the flavor changes from #6132 |
reneme
force-pushed
the
dtls13/flavor_logic
branch
from
November 16, 2026 15:55
e16e843 to
56ca88e
Compare
Collaborator
Thanks. Done now. |
atreiber94
force-pushed
the
dtls13/flavor_logic
branch
from
November 17, 2026 08:30
56ca88e to
bf23334
Compare
In preparation for DTLS 1.3 (randombit#5000), introduce all flavor-dependent logic that will be in the TLS base files: every place where the base 1.3 implementation must behave differently for DTLS now branches on TLS_Flavor, and the polymorphic layer interfaces (Channel_IO, Handshake_Layer, Record_Layer, Cipher_State) expose the hooks that the DTLS 1.3 implementation will override. The DTLS 1.3 implementation itself is not part of this change: creating a DTLS 1.3 client still throws, and DTLS 1.3 remains disabled via Policy::allow_dtls13() defaulting to false. Concretely: * Channel_Impl_13 takes a Connection_Side and TLS_Flavor; Client and Server select the 1.3 implementation for is_tls_13_or_later() versions and pass the flavor down. Cipher_State::create() and Channel_IO::create() gain (still unreachable) DTLS branches that throw Not_Implemented until the DTLS 1.3 module lands. * Client/Server Hello 1.3 handle the DTLS legacy_version, ciphersuite lists and supported_versions, skip the middlebox compatibility mode and the session ID echo for DTLS; Hello_Retry_Request may carry a Cookie for the DTLS stateless cookie exchange; Encrypted_Extensions negotiates DTLS-SRTP (RFC 5764) and the negotiated SRTP profile is stored in the session. * Channel_IO grows no-op notification hooks for the DTLS ACK and retransmission logic (protocol version committed, complete/final flight received); Record_Layer and Handshake_Layer report ingestion outcomes and support epoch-specific record protection as needed for DTLS. * KeyUpdate handling: Channel_IO::handle_key_update() becomes virtual and subsumes the schedule_read_epoch_pruning() hook, which is removed. The DTLS implementation overrides it to reject KeyUpdates beyond the epoch limit (RFC 9147 8.) and to schedule pruning of superseded read epochs itself; TLS simply updates its read keys. * Downgrade handling: the client preserves epoch-0 sequence numbers for the 1.2 implementation; random_signals_downgrade() moves to the Server_Hello base class. Handling of Hello_Verify_Request as a downgrade trigger to DTLS 1.2 is factored out into a subsequent commit, as it belongs to the DTLS 1.3 implementation itself. * PSK binder calculation handles the DTLS legacy_cookie field and the PSK importer uses the "dtls13" label prefix for DTLS 1.3. * Policy gains allow_dtls13() (default: false). The handling of ACK records (RFC 9147 7.) together with the dtls_maximum_queued_acknowledgements() policy knob is likewise factored out into a subsequent commit, as the DTLS 1.3 implementation is their only consumer. Co-Authored-By: René Meusel <rene.meusel@rohde-schwarz.com>
atreiber94
force-pushed
the
dtls13/flavor_logic
branch
from
November 17, 2026 08:31
bf23334 to
2fc213f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In preparation for DTLS 1.3 (#5000), introduce all flavor-dependent logic that will be in the TLS base files: every place where the base 1.3 implementation must behave differently for DTLS now branches on
TLS_Flavor, and the polymorphic layer interfaces (Channel_IO,Handshake_Layer,Record_Layer,Cipher_State) expose the hooks that the DTLS 1.3 implementation will override. The DTLS 1.3 implementation itself is not part of this change: creating a DTLS 1.3 client still throws, and DTLS 1.3 remains disabled viaPolicy::allow_dtls13()defaulting to false.Note that a lot of the introduced code is dead / not active yet. Reviewing it by looking at the DTLS 1.3 WIP (Rohde-Schwarz#20) may help in understanding some choices of DTLS-specific behavior that we added into the base TLS implementation here.
This is hopefully the last or second-to-last refactoring before contributing the full DTLS 1.3 implementation.
Concretely:
Channel_Impl_13takes aConnection_SideandTLS_Flavor;ClientandServerselect the 1.3 implementation foris_tls_13_or_later()versions and pass the flavor down.Cipher_State::create()andChannel_IO::create()gain (still unreachable) DTLS branches that throwNot_Implementeduntil the DTLS 1.3 module lands.legacy_version, ciphersuite lists andsupported_versions, skip the middlebox compatibility mode and the session ID echo for DTLS;Hello_Retry_Requestmay carry aCookiefor the DTLS stateless cookie exchange;Encrypted_Extensionsnegotiates DTLS-SRTP (RFC 5764) and the negotiated SRTP profile is stored in the session.Channel_IOgrows no-op notification hooks for the DTLS ACK and retransmission logic (protocol version committed, complete/final flight received);Record_LayerandHandshake_Layerreport ingestion outcomes and support epoch-specific record protection as needed for DTLS.Channel_IO::handle_key_update()becomes virtual and subsumes theschedule_read_epoch_pruning()hook, which is removed. The DTLS implementation overrides it to reject KeyUpdates beyond the epoch limit (RFC 9147 8.) and to schedule pruning of superseded read epochs itself; TLS simply updates its read keys.random_signals_downgrade()moves to theServer_Hellobase class.legacy_cookiefield and the PSK importer uses the"dtls13"label prefix for DTLS 1.3.Policygainsallow_dtls13()(default: false).