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];
59 QuicTransportParams params;
60 uint8_t ephemeral_priv[32];
62#if PROTOCORE_ENABLE_PQC_KEX
91#if PROTOCORE_ENABLE_PQC_KEX
94 embed_bool hs_keys_ready;
95 embed_bool ap_keys_ready;
103 uint8_t hs_finished_hash[TLS13_SECRET_MAX];
105#if PROTOCORE_ENABLE_PQC_KEX
106 uint8_t flight_initial[1400];
108 uint8_t flight_initial[256];
110 size_t flight_initial_len;
112 size_t flight_hs_len;
115 embed_bool have_peer;
122 const QuicTlsConfig *cfg;
123} QuicTlsServerServerInitArgs;
132} QuicTlsServerRecvCryptoArgs;
140} QuicTlsServerFlightArgs;
147 embed_bool is_server;
148} QuicTlsServerKeysArgs;
154} QuicTlsServerPeerParamsArgs;
188 QuicTlsServerServerInitArgs server_init_args;
189 QuicTlsServerRecvCryptoArgs recv_crypto_args;
190 QuicTlsServerFlightArgs flight_args;
191 QuicTlsServerKeysArgs keys_args;
192 QuicTlsServerPeerParamsArgs peer_params_args;
195 const uint8_t *bytes;
201extern QuicTlsServerVars QuicTlsServerV;
206 void (*
const server_init)(
const uint8_t *work);
207 void (*
const recv_crypto)(uint8_t *work);
208 void (*
const flight)(
const uint8_t *work);
209 void (*
const keys)(
const uint8_t *work);
210 void (*
const peer_params)(
const uint8_t *work);
215void protocore_quic_tls_server_server_init(
const uint8_t *work);
216void protocore_quic_tls_server_recv_crypto(uint8_t *work);
217void protocore_quic_tls_server_flight(
const uint8_t *work);
218void protocore_quic_tls_server_keys(
const uint8_t *work);
219void protocore_quic_tls_server_peer_params(
const uint8_t *work);
225static const QuicTlsServerNs QuicTlsServer __attribute__((unused)) = {
226 .server_init = protocore_quic_tls_server_server_init,
227 .recv_crypto = protocore_quic_tls_server_recv_crypto,
228 .flight = protocore_quic_tls_server_flight,
229 .keys = protocore_quic_tls_server_keys,
230 .peer_params = protocore_quic_tls_server_peer_params,
#define PROTOCORE_H3_CRYPTO_BUF
Maximum bytes of one QUIC/TLS handshake CRYPTO flight (RFC 9001).
EMBED_ENUM_BYTE(ProtoConn, PROTO_NONE=0, PROTO_HTTP=1, PROTO_TELNET=2, PROTO_SSH=3, PROTO_MODBUS=4, PROTO_OPCUA=5, PROTO_SSH_RFWD=6, PROTO_RELAY=7, PROTO_BRIDGE=8, PROTO_NTRIP_CASTER=9, PROTO_MESH=10, PROTO_UDP=11,)
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_QUIC_KEYS_BORROW
#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.