52#ifndef QSC_TLS_CLIENT_H
53#define QSC_TLS_CLIENT_H
67QSC_CPLUSPLUS_ENABLED_START
277QSC_CPLUSPLUS_ENABLED_END
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition qsccommon.h:645
Stores a bounded ordered ALPN protocol list and its negotiation policy.
Definition tlsstate.h:102
Certificate validation and signature verification callback set.
Definition tlscert.h:148
Stores the static client policy used to initialize a TLS client state.
Definition tlsclient.h:120
qsc_tls_certificate_interface certinterface
Definition tlsclient.h:128
const qsc_tls_cipher_suite * ciphersuites
Definition tlsclient.h:121
const qsc_tls_signature_scheme * sigschemes
Definition tlsclient.h:125
qsc_tls_alpn_protocols alpn
Definition tlsclient.h:129
bool enableearlydata
Definition tlsclient.h:131
size_t ciphersuitecount
Definition tlsclient.h:122
const qsc_tls_session_ticket * offeredticket
Definition tlsclient.h:130
const char * hostname
Definition tlsclient.h:127
size_t sigschemecount
Definition tlsclient.h:126
const qsc_tls_named_group * groups
Definition tlsclient.h:123
size_t groupcount
Definition tlsclient.h:124
Stores the active TLS 1.3 client handshake and record state.
Definition tlsclient.h:139
bool helloretryrequestconsumed
Definition tlsclient.h:168
uint8_t clientrandom[32U]
Definition tlsclient.h:146
size_t peercertificatelen
Definition tlsclient.h:161
size_t selectedalpnlen
Definition tlsclient.h:160
bool earlydataoffered
Definition tlsclient.h:172
bool pskaccepted
Definition tlsclient.h:171
qsc_tls_peer_capabilities peercapabilities
Definition tlsclient.h:156
qsc_tls_client_phase phase
Definition tlsclient.h:141
uint8_t peercertificate[QSC_TLS_CERTIFICATE_MAX_SIZE]
Definition tlsclient.h:159
uint8_t clienthello[QSC_TLS_CLIENT_HELLO_BODY_MAX_SIZE+4U]
Definition tlsclient.h:148
qsc_tls_client_config config
Definition tlsclient.h:140
bool serverauthenticated
Definition tlsclient.h:166
size_t retryclienthellolen
Definition tlsclient.h:163
qsc_tls_key_exchange_state keyexchange
Definition tlsclient.h:155
bool clientrandomgenerated
Definition tlsclient.h:169
qsc_tls_signature_scheme negotiatedsigscheme
Definition tlsclient.h:145
size_t helloretryrequestlen
Definition tlsclient.h:164
uint8_t selectedalpn[QSC_TLS_MAX_ALPN_SIZE]
Definition tlsclient.h:158
qsc_tls_cipher_suite negotiatedsuite
Definition tlsclient.h:142
qsc_tls_named_group negotiatedgroup
Definition tlsclient.h:144
qsc_tls_hash_algorithm negotiatedhash
Definition tlsclient.h:143
bool changecipherspecreceived
Definition tlsclient.h:167
uint8_t helloretryrequest[QSC_TLS_SERVER_HELLO_BODY_MAX_SIZE+4U]
Definition tlsclient.h:150
bool alpnselected
Definition tlsclient.h:165
qsc_tls_transcript_state transcript
Definition tlsclient.h:151
size_t clienthellolen
Definition tlsclient.h:162
uint8_t serverrandom[32U]
Definition tlsclient.h:147
qsc_tls_key_schedule_state keyschedule
Definition tlsclient.h:152
qsc_tls_record_state readrecord
Definition tlsclient.h:153
qsc_tls_alert_description lastalert
Definition tlsclient.h:157
uint8_t retryclienthello[QSC_TLS_CLIENT_HELLO_BODY_MAX_SIZE+4U]
Definition tlsclient.h:149
qsc_tls_record_state writerecord
Definition tlsclient.h:154
bool pskoffered
Definition tlsclient.h:170
bool earlydataaccepted
Definition tlsclient.h:173
Stores ephemeral client-side state for a TLS key exchange.
Definition tlsgroups.h:96
TLS 1.3 key schedule state and derived secret container.
Definition tlskeyschedule.h:129
Stores the peer-advertised supported groups and signature-scheme capabilities.
Definition tlsstate.h:115
Stores the active TLS traffic keying material and sequence number for one record direction.
Definition tlsstate.h:88
Definition tlssession.h:85
Stores the active transcript hash context and its selected hash algorithm.
Definition tlsstate.h:72
TLS certificate bridge types and validation callbacks.
QSC_EXPORT_API qsc_tls_status qsc_tls_client_send_hello(qsc_tls_client_state *state, uint8_t *output, size_t outlen, size_t *written)
Build the initial ClientHello flight.
Definition tlsclient.c:1070
qsc_tls_client_phase
Enumerates the major phases of the TLS 1.3 client handshake.
Definition tlsclient.h:103
@ qsc_tls_client_phase_established
Definition tlsclient.h:110
@ qsc_tls_client_phase_waiting_certificate
Definition tlsclient.h:107
@ qsc_tls_client_phase_waiting_finished
Definition tlsclient.h:109
@ qsc_tls_client_phase_waiting_certificate_verify
Definition tlsclient.h:108
@ qsc_tls_client_phase_initial
Definition tlsclient.h:104
@ qsc_tls_client_phase_failed
Definition tlsclient.h:112
@ qsc_tls_client_phase_closed
Definition tlsclient.h:111
@ qsc_tls_client_phase_waiting_server_hello
Definition tlsclient.h:105
@ qsc_tls_client_phase_waiting_encrypted_extensions
Definition tlsclient.h:106
QSC_EXPORT_API qsc_tls_cipher_suite qsc_tls_client_get_negotiated_cipher_suite(const qsc_tls_client_state *state)
Get the cipher suite negotiated by the server.
Definition tlsclient.c:1830
QSC_EXPORT_API bool qsc_tls_client_is_handshake_complete(const qsc_tls_client_state *state)
Determine whether the client handshake is complete.
Definition tlsclient.c:1823
QSC_EXPORT_API qsc_tls_status qsc_tls_client_config_set_certificate_interface(qsc_tls_client_config *config, const qsc_tls_certificate_interface *iface, const char *hostname)
Initialize a TLS client handshake state.
Definition tlsclient.c:1013
QSC_EXPORT_API qsc_tls_status qsc_tls_client_process_record(qsc_tls_client_state *state, const uint8_t *input, size_t inlen, size_t *consumed, uint8_t *output, size_t outlen, size_t *written)
Process an inbound TLS record and optionally emit a response flight.
Definition tlsclient.c:1309
QSC_EXPORT_API void qsc_tls_client_dispose(qsc_tls_client_state *state)
Dispose of a TLS client handshake state.
Definition tlsclient.c:1055
TLS status code definitions and diagnostic string conversion.
qsc_tls_status
Definition tlserrors.h:65
TLS named-group descriptors and key-share helper routines.
TLS 1.3 key schedule, HKDF label derivation, traffic-secret expansion, Finished verification,...
Fixed upper bounds used by the TLS implementation.
#define QSC_TLS_MAX_ALPN_SIZE
Maximum ALPN identifier length in bytes.
Definition tlslimits.h:127
#define QSC_TLS_SERVER_HELLO_BODY_MAX_SIZE
Maximum encoded ServerHello body size for the current TLS scaffolding.
Definition tlslimits.h:343
#define QSC_TLS_CERTIFICATE_MAX_SIZE
Maximum size of a single encoded certificate.
Definition tlslimits.h:158
#define QSC_TLS_CLIENT_HELLO_BODY_MAX_SIZE
Maximum encoded ClientHello body size for the current TLS scaffolding.
Definition tlslimits.h:331
TLS record formatting and protection helpers.
TLS 1.3 session resumption ticket handling.
TLS internal state container type definitions shared across the record and handshake layers.
TLS 1.3 transcript-hash helpers.
Public TLS type definitions.
qsc_tls_cipher_suite
TLS 1.3 cipher-suite identifiers.
Definition tlstypes.h:129
qsc_tls_named_group
TLS named-group identifiers for classical, ML-KEM, and hybrid key exchange groups.
Definition tlstypes.h:159
qsc_tls_alert_description
TLS alert description codes carried in Alert protocol messages.
Definition tlstypes.h:94
qsc_tls_hash_algorithm
Identifies the transcript and HKDF hash algorithm associated with a TLS cipher suite.
Definition tlstypes.h:69
qsc_tls_signature_scheme
TLS signature-scheme identifiers.
Definition tlstypes.h:179