nx_tls13_server_session_emit_hrr.nx
buildroot/runtime/nx_tls13_server_session_emit_hrr.nx
about
nx_tls13_server_session_emit_hrr.nx -- server-side HelloRetryRequest
emitter (RFC 8446 §4.1.4).
HRR is sent when the client's ClientHello did NOT carry a key_share
for a group the server supports, but DID list such a group in
supported_groups. On the wire HRR is formatted IDENTICALLY to a
ServerHello, with two differences:
1. Random is the fixed magic value SHA-256("HelloRetryRequest")
(per RFC 8446 §4.1.3) -- supplied by tls13_hrr_magic_random.
2. The key_share extension body is JUST the 2-byte selected_group
(NamedGroup) the server wants -- no actual key_exchange entry.
This server supports exactly one group (X25519), so HRR always
selects NG_X25519; the client then re-sends ClientHello2 with an
X25519 key_share and the handshake proceeds normally.
Transcript ordering (RFC 8446 §4.4.1, the HRR special case):
1. recv_ch feeds ClientHello1 into the transcript.
2. caller calls nx_tls13_transcript_replace_with_hrr (CH1 ->
synthetic message_hash record).
3. THIS step feeds the HRR handshake body into the transcript.
4. recv_ch (CH2) feeds ClientHello2 in.
So this emitter updates the transcript with the HRR body and the
caller MUST have already done the replace_with_hrr in step 2.
State: requires SSTATE_INIT (we are between CH1 and CH2; recv_ch
returned NEED_HRR without advancing state). Does NOT advance state
-- recv_ch(CH2) advances INIT -> CH_RECEIVED next.
Per Cardinals 9 (single-responsibility), 22 (composition only):
reuses tls13_ext_emit_supported_versions_server + tls13_hrr_magic_random.
license_tier: ORIGINAL
genealogy_id: international-research-sources/ietf/rfc_8446
lineage_id: nishi_tls13_server_session_emit_hrr_q1
dependencies 7 imports · 2 importers
imports: nx_syscalls.nxnx_tls13.nxnx_tls13_hello.nxnx_tls13_hrr.nxnx_tls13_transcript.nxnx_tls13_server_session.nxnx_tls13_server_session_emit_sh.nx
imported by: nx_tls13_server_session_run.nxnx_tls13_server_session_run_h2.nx
structs
| none |
consts
| none |
functions
| 49 | func tls13_hello_retry_request_emit( |
| 128 | func nx_tls13_server_session_emit_hrr( |
| 159 | func main() -> i64 |