31#ifndef PROTOCORE_QUIC_TLS_H
32#define PROTOCORE_QUIC_TLS_H
36#if PROTOCORE_ENABLE_HTTP3
49#define QUIC_ENC_INITIAL 0
50#define QUIC_ENC_HANDSHAKE 1
54typedef struct QuicTlsConfig
56 const uint8_t *cert_der;
58 uint8_t ed25519_seed[32];
60 uint8_t ephemeral_priv[32];
62#if PROTOCORE_ENABLE_PQC_KEX
92#if PROTOCORE_ENABLE_PQC_KEX
104 uint8_t hs_finished_hash[TLS13_SECRET_MAX];
106#if PROTOCORE_ENABLE_PQC_KEX
107 uint8_t flight_initial[1400];
109 uint8_t flight_initial[256];
111 size_t flight_initial_len;
113 size_t flight_hs_len;
123 const QuicTlsConfig *cfg;
124} QuicTlsServerServerInitArgs;
133} QuicTlsServerRecvCryptoArgs;
141} QuicTlsServerFlightArgs;
149} QuicTlsServerKeysArgs;
155} QuicTlsServerPeerParamsArgs;
189 QuicTlsServerServerInitArgs server_init_args;
190 QuicTlsServerRecvCryptoArgs recv_crypto_args;
191 QuicTlsServerFlightArgs flight_args;
192 QuicTlsServerKeysArgs keys_args;
193 QuicTlsServerPeerParamsArgs peer_params_args;
196 const uint8_t *bytes;
202extern QuicTlsServerVars QuicTlsServerV;
207 void (*
const server_init)(uint8_t *work);
208 void (*
const recv_crypto)(uint8_t *work);
209 void (*
const flight)(uint8_t *work);
210 void (*
const keys)(uint8_t *work);
211 void (*
const peer_params)(uint8_t *work);
216void protocore_quic_tls_server_server_init(uint8_t *work);
217void protocore_quic_tls_server_recv_crypto(uint8_t *work);
218void protocore_quic_tls_server_flight(uint8_t *work);
219void protocore_quic_tls_server_keys(uint8_t *work);
220void protocore_quic_tls_server_peer_params(uint8_t *work);
226static const QuicTlsServerNs QuicTlsServer __attribute__((unused)) = {
227 .server_init = protocore_quic_tls_server_server_init,
228 .recv_crypto = protocore_quic_tls_server_recv_crypto,
229 .flight = protocore_quic_tls_server_flight,
230 .keys = protocore_quic_tls_server_keys,
231 .peer_params = protocore_quic_tls_server_peer_params,
#define PROTOCORE_H3_CRYPTO_BUF
Maximum bytes of one QUIC/TLS handshake CRYPTO flight (RFC 9001).
#define PROTOCORE_QUIC_KEYS_BORROW
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_SHA512_BORROW
#define PROTOCORE_TLS13_KS_BORROW
#define PROTOCORE_TLS13_TRANSCRIPT_BORROW
TLS 1.3 key schedule (RFC 8446 sec 7.1) for the QUIC handshake.
QUIC packet protection: Initial secrets, AEAD payload protection, header protection,...
QUIC transport parameters (RFC 9000 sec 18) carried in the TLS quic_transport_parameters extension (R...
The client/server packet-protection secrets for one QUIC encryption level.
The transport parameters we encode / decode, with RFC 9000 sec 18.2 defaults applied.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS