1#ifndef QUIC_SCHEDULE_DRIVE_KEYSCHEDULE_H
2#define QUIC_SCHEDULE_DRIVE_KEYSCHEDULE_H
#define QUIC_HKDF_PRK
pseudorandom key length
Definition hkdf.h:13
RFC 9001 5.2: Initial packet protection keys derived from the client's Destination Connection ID.
int quic_keysched_advance_handshake(quic_keysched *st, quic_span ecdhe, quic_span transcript)
ServerHello received: derive Handshake Secret from the ECDHE shared secret and the client/server hand...
int quic_keysched_advance_master(quic_keysched *st, const u8 *transcript, usz transcript_len)
Finished processed: derive Master Secret and the application traffic keys.
int quic_keysched_client_ap_secret(const quic_keysched *st, const u8 **out)
The retained client_application_traffic_secret_0, valid once stage 2 is reached (same guard as quic_k...
void quic_keysched_set_suite(quic_keysched *st, u16 suite)
Override the cipher suite advance_handshake/advance_master derive Handshake/1-RTT keys for (RFC 8446 ...
@ QUIC_KS_CLIENT_AP
client application (1-RTT) traffic keys
Definition keyschedule.h:21
@ QUIC_KS_SERVER_AP
server application (1-RTT) traffic keys
Definition keyschedule.h:22
@ QUIC_KS_CLIENT_HS
client handshake traffic keys
Definition keyschedule.h:19
@ QUIC_KS_SERVER_HS
server handshake traffic keys
Definition keyschedule.h:20
void quic_keysched_init(quic_keysched *st)
Enter the Early Secret stage.
int quic_keysched_exporter_secret(const quic_keysched *st, const u8 **out)
The retained exporter_master_secret (RFC 8446 7.1/7.5), valid once stage 2 is reached (same guard as ...
int quic_keysched_get(const quic_keysched *st, int which, const quic_initial_keys **out)
If the keys for which have been derived, point *out at them and return 1; otherwise return 0.
int quic_keysched_advance_handshake_psk(quic_keysched *st, quic_span psk, quic_span ecdhe, quic_span transcript)
Same as quic_keysched_advance_handshake, but for a PSK-resumption handshake (RFC 8446 7....
int quic_keysched_server_ap_secret(const quic_keysched *st, const u8 **out)
The retained server_application_traffic_secret_0, valid once stage 2 is reached.
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
One direction's packet protection keys (RFC 9001 5.1/5.2).
Definition initial.h:28
Key schedule state: the current stage, the Master Secret once reached, and the four traffic key sets ...
Definition keyschedule.h:29
quic_initial_keys keys[4]
traffic keys indexed by QUIC_KS_*
Definition keyschedule.h:33
u8 server_ap_secret[QUIC_HKDF_PRK]
server_application_traffic_secret_0, retained for the same reason on the send side (RFC 9001 6....
Definition keyschedule.h:38
u8 master[QUIC_HKDF_PRK]
Master Secret (derived on reaching stage 1).
Definition keyschedule.h:31
u8 client_ap_secret[QUIC_HKDF_PRK]
client_application_traffic_secret_0 (RFC 8446 7.1), retained past stage 2 so RFC 9001 6 key updates c...
Definition keyschedule.h:34
u8 exporter_secret[QUIC_HKDF_PRK]
exporter_master_secret (RFC 8446 7.1/7.5), derived alongside the application traffic secrets on reach...
Definition keyschedule.h:41
int stage
0=init/early, 1=handshake, 2=master
Definition keyschedule.h:30
u16 suite
negotiated TLS 1.3 cipher suite (RFC 8446 B.4) for the Handshake/1-RTT levels this schedule derives; ...
Definition keyschedule.h:49
Read-only view of a byte range.
Definition span.h:30
u64 usz
unsigned size (size_t equivalent)
Definition syscall.h:19
unsigned short u16
unsigned 16-bit integer
Definition syscall.h:16
unsigned char u8
unsigned 8-bit integer / byte
Definition syscall.h:17