Repository navigation
[DTLS 1.3] Prep the Transcript_Hash_state + introduce strong record types - #6006
Merged
reneme merged 5 commits intoOct 6, 2026
Merged
Conversation
reneme
commented
Oct 6, 2026
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Successful handshakes can dereference a reset transcript optional, and additional transcript and type-invariant regressions remain unresolved.
Review effort: Balanced
Findings: 2
Open (5)
What changed in this PR
Prepares TLS 1.3 internals for future DTLS 1.3 support through typed transcript components, optional transcript lifetime, and typed record variants.
Changes:
- Splits handshake headers from message bodies during transcript hashing.
- Introduces typed TLS record variants and record-number types.
- Makes channel transcript state optional after handshake completion.
| File | Description |
|---|---|
src/tests/test_tls_transcript_hash_13.cpp |
Updates transcript-hash tests. |
src/tests/test_tls_record_layer_13.cpp |
Tests typed record variants. |
src/tests/test_tls_handshake_layer_13.cpp |
Supplies TLS flavor to transcript state. |
src/tests/test_tls_cipher_state.cpp |
Validates decrypted record variants. |
src/lib/tls/tls13/tls_types_13.h |
Adds handshake and record strong types. |
src/lib/tls/tls13/tls_transcript_hash_13.h |
Revises transcript-hash API and buffering. |
src/lib/tls/tls13/tls_transcript_hash_13.cpp |
Implements split transcript processing. |
src/lib/tls/tls13/tls_server_impl_13.cpp |
Adapts server transcript ownership. |
src/lib/tls/tls13/tls_record_layer_13.h |
Exposes variant-based record results. |
src/lib/tls/tls13/tls_record_layer_13.cpp |
Returns annotated record alternatives. |
src/lib/tls/tls13/tls_record_13.h |
Defines typed record alternatives. |
src/lib/tls/tls13/tls_record_13.cpp |
Maps content types to record variants. |
src/lib/tls/tls13/tls_messages_13.h |
Adds TLS flavor to ClientHello construction. |
src/lib/tls/tls13/tls_handshake_layer_13.cpp |
Splits headers before transcript updates. |
src/lib/tls/tls13/tls_client_impl_13.cpp |
Adapts client transcript ownership. |
src/lib/tls/tls13/tls_cipher_state.h |
Returns typed decrypted records. |
src/lib/tls/tls13/tls_cipher_state.cpp |
Annotates decrypted record content. |
src/lib/tls/tls13/tls_channel_impl_13.h |
Makes transcript state optional. |
src/lib/tls/tls13/tls_channel_impl_13.cpp |
Handles variant records and transcript state. |
src/lib/tls/tls13/msg_client_hello_13.cpp |
Propagates TLS flavor for PSK binders. |
src/lib/tls/tls_magic.h |
Adds handshake constants and MessageHash. |
src/lib/tls/tls_magic.cpp |
Stringifies MessageHash. |
src/lib/tls/tls_handshake_transitions.cpp |
Adds transition-mask support. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
reneme
force-pushed
the
dtls13/typed_records_transcript
branch
from
October 6, 2026 13:45
027989c to
c0b250c
Compare
This is a 'virtual handshake message type' used to calculate a transcript hash based on a previous ClientHello in the HelloRetryRequest case. Co-Authored-By: Amos Treiber <amos.treiber@rohde-schwarz.com>
reneme
force-pushed
the
dtls13/typed_records_transcript
branch
from
October 6, 2026 13:47
c0b250c to
69d964a
Compare
This introduces a bunch of subclasses to the generic Record_Content struct, one for each supported record type (AppData, Handshake, CCS, Alert). In a later patch this will be used for type safe dispatching of those types. Co-Authored-By: Amos Treiber <amos.treiber@rohde-schwarz.com>
This allows resetting the transcript hash state after the handshake completed. Co-Authored-By: René Meusel <rene.meusel@rohde-schwarz.com>
reneme
force-pushed
the
dtls13/typed_records_transcript
branch
from
October 6, 2026 14:04
69d964a to
9698d8e
Compare
Transcript_Hash_State::update() now takes the 4-byte handshake protocol header and the serialized handshake message as separate, strongly typed parameters. This is a preparatory refactoring for DTLS 1.3, where the handshake protocol header carries additional fields (message_seq, fragment_offset, fragment_length) that must not be naively hashed. Also introduces strong types for marshalled handshake messages, message flights and fragments as well as DTLS record numbers in tls_types_13.h and passes the TLS_Flavor down to the transcript hash state. Co-Authored-By: René Meusel <rene.meusel@rohde-schwarz.com>
Co-Authored-By: René Meusel <rene.meusel@rohde-schwarz.com>
reneme
force-pushed
the
dtls13/typed_records_transcript
branch
from
October 6, 2026 14:46
9698d8e to
850c1ea
Compare
Open
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.



This prepares the
Transcript_Hash_Statefor DTLS 1.3 (#5000) and adds strong record types (as subclasses of theRecord_Contentstruct). The strong types are currently just unpacked at the usage location, but that'll change with the coming patches.Details;
Handshake_Type::MessageHash— introduces the virtual handshake message type (RFC 9846 4.3.11.2) used for the transcript hash in the HelloRetryRequest case.Record_Contentstrong types — adds subclasses of the genericRecord_Contentfor each record type (AppData, Handshake, CCS, Alert) to enable type-safe dispatching in a later patch.std::optional<Transcript_Hash_State>— the transcript hash state inChannel_Impl_13can now be reset after the handshake completesTranscript_Hash_State—::update()now explicitly takes the 4-byte handshake protocol header and the serialized message as separate strongly typed parameters, since DTLS 1.3 headers carry extra fields that must not be hashed.No functional changes; each commit builds and passes the tests.