Go to the documentation of this file.
35 #ifndef TLS13_DHE_KE_SUPPORT
36 #define TLS13_DHE_KE_SUPPORT ENABLED
37 #elif (TLS13_DHE_KE_SUPPORT != ENABLED && TLS13_DHE_KE_SUPPORT != DISABLED)
38 #error TLS13_DHE_KE_SUPPORT parameter is not valid
42 #ifndef TLS13_ECDHE_KE_SUPPORT
43 #define TLS13_ECDHE_KE_SUPPORT ENABLED
44 #elif (TLS13_ECDHE_KE_SUPPORT != ENABLED && TLS13_ECDHE_KE_SUPPORT != DISABLED)
45 #error TLS13_ECDHE_KE_SUPPORT parameter is not valid
49 #ifndef TLS13_HYBRID_KE_SUPPORT
50 #define TLS13_HYBRID_KE_SUPPORT DISABLED
51 #elif (TLS13_HYBRID_KE_SUPPORT != ENABLED && TLS13_HYBRID_KE_SUPPORT != DISABLED)
52 #error TLS13_HYBRID_KE_SUPPORT parameter is not valid
56 #ifndef TLS13_PSK_KE_SUPPORT
57 #define TLS13_PSK_KE_SUPPORT DISABLED
58 #elif (TLS13_PSK_KE_SUPPORT != ENABLED && TLS13_PSK_KE_SUPPORT != DISABLED)
59 #error TLS13_PSK_KE_SUPPORT parameter is not valid
63 #ifndef TLS13_PSK_DHE_KE_SUPPORT
64 #define TLS13_PSK_DHE_KE_SUPPORT ENABLED
65 #elif (TLS13_PSK_DHE_KE_SUPPORT != ENABLED && TLS13_PSK_DHE_KE_SUPPORT != DISABLED)
66 #error TLS13_PSK_DHE_KE_SUPPORT parameter is not valid
70 #ifndef TLS13_PSK_ECDHE_KE_SUPPORT
71 #define TLS13_PSK_ECDHE_KE_SUPPORT ENABLED
72 #elif (TLS13_PSK_ECDHE_KE_SUPPORT != ENABLED && TLS13_PSK_ECDHE_KE_SUPPORT != DISABLED)
73 #error TLS13_PSK_ECDHE_KE_SUPPORT parameter is not valid
77 #ifndef TLS13_PSK_HYBRID_KE_SUPPORT
78 #define TLS13_PSK_HYBRID_KE_SUPPORT DISABLED
79 #elif (TLS13_PSK_HYBRID_KE_SUPPORT != ENABLED && TLS13_PSK_HYBRID_KE_SUPPORT != DISABLED)
80 #error TLS13_PSK_HYBRID_KE_SUPPORT parameter is not valid
84 #ifndef TLS13_EARLY_DATA_SUPPORT
85 #define TLS13_EARLY_DATA_SUPPORT DISABLED
86 #elif (TLS13_EARLY_DATA_SUPPORT != ENABLED && TLS13_EARLY_DATA_SUPPORT != DISABLED)
87 #error TLS13_EARLY_DATA_SUPPORT parameter is not valid
91 #ifndef TLS13_MIDDLEBOX_COMPAT_SUPPORT
92 #define TLS13_MIDDLEBOX_COMPAT_SUPPORT ENABLED
93 #elif (TLS13_MIDDLEBOX_COMPAT_SUPPORT != ENABLED && TLS13_MIDDLEBOX_COMPAT_SUPPORT != DISABLED)
94 #error TLS13_MIDDLEBOX_COMPAT_SUPPORT parameter is not valid
98 #ifndef TLS13_MAX_COOKIE_SIZE
99 #define TLS13_MAX_COOKIE_SIZE 256
100 #elif (TLS13_MAX_COOKIE_SIZE < 32)
101 #error TLS13_MAX_COOKIE_SIZE parameter is not valid
105 #ifndef TLS13_MAX_TICKET_SIZE
106 #define TLS13_MAX_TICKET_SIZE 1024
107 #elif (TLS13_MAX_TICKET_SIZE < 32)
108 #error TLS13_MAX_TICKET_SIZE parameter is not valid
112 #ifndef TLS13_MAX_TICKET_LIFETIME
113 #define TLS13_MAX_TICKET_LIFETIME 604800
114 #elif (TLS13_MAX_TICKET_LIFETIME < 0)
115 #error TLS13_MAX_TICKET_LIFETIME parameter is not valid
119 #ifndef TLS13_TICKET_AGE_TOLERANCE
120 #define TLS13_TICKET_AGE_TOLERANCE 5000
121 #elif (TLS13_TICKET_AGE_TOLERANCE < 0)
122 #error TLS13_TICKET_AGE_TOLERANCE parameter is not valid
126 #ifndef TLS13_NEW_SESSION_TICKET_COUNT
127 #define TLS13_NEW_SESSION_TICKET_COUNT 2
128 #elif (TLS13_NEW_SESSION_TICKET_COUNT < 0)
129 #error TLS13_NEW_SESSION_TICKET_COUNT parameter is not valid
133 #if (TLS_SHA384_SUPPORT == ENABLED)
134 #define TLS13_MAX_HKDF_DIGEST_SIZE 48
136 #define TLS13_MAX_HKDF_DIGEST_SIZE 32
168 #if defined(__CCRX__)
170 #elif defined(__CWCC__) || defined(_WIN32)
171 #pragma pack(push, 1)
293 uint16_t serverVersion;
313 uint16_t extensionsLen;
337 uint8_t requestUpdate;
370 #if defined(__CCRX__)
372 #elif defined(__CWCC__) || defined(_WIN32)
383 size_t clientHelloLen,
size_t truncatedClientHelloLen,
392 const uint8_t *keyShare,
size_t length);
398 void *record,
const uint8_t *
data,
size_t dataLen, uint8_t *mac);
410 uint16_t namedGroup);
413 uint16_t namedGroup);
uint32_t ticketLifetime
Lifetime of the ticket.
#define TLS13_MAX_HKDF_DIGEST_SIZE
error_t tls13ComputeMac(TlsContext *context, TlsEncryptionEngine *encryptionEngine, void *record, const uint8_t *data, size_t dataLen, uint8_t *mac)
Compute message authentication code.
const EcCurveInfo * tls13GetTraditionalAlgo(TlsContext *context, uint16_t namedGroup)
Get the traditional algorithm used by the hybrid key exchange method.
error_t tls13GenerateKeyShare(TlsContext *context, uint16_t namedGroup)
Key share generation.
uint8_t ticketNonce[]
A per-ticket value that is unique across all tickets issued.
error_t tls13DigestClientHello1(TlsContext *context)
Hash ClientHello1 in the transcript when HelloRetryRequest is used.
typedef __packed_struct
Cookie.
error_t tls13ParseCertExtensions(const uint8_t *p, size_t length, size_t *consumed)
Parse certificate extensions.
size_t ticketPskLen
Length of the PSK associated with the ticket.
error_t tls13Encapsulate(TlsContext *context, uint16_t namedGroup, const uint8_t *keyShare, size_t length)
Encapsulation algorithm.
Tls13KeyUpdateRequest
Key update requests.
uint8_t ticketPsk[TLS13_MAX_HKDF_DIGEST_SIZE]
PSK associated with the ticket.
@ TLS_PSK_KEY_EXCH_MODE_PSK_KE
@ TLS_PSK_KEY_EXCH_MODE_PSK_DHE_KE
bool_t tls13IsGroupSupported(TlsContext *context, uint16_t namedGroup)
Check whether a given named group is supported.
Elliptic curve parameters.
Tls13PskKeyExchMode
PSK key exchange modes.
Tls13PlaintextSessionState
systime_t ticketTimestamp
Timestamp to manage ticket lifetime.
const KemAlgo * tls13GetNextGenAlgo(TlsContext *context, uint16_t namedGroup)
Get the next-gen algorithm used by the hybrid key exchange method.
error_t tls13Decapsulate(TlsContext *context, const uint8_t *keyShare, size_t length)
Decapsulation algorithm.
uint32_t systime_t
System time.
error_t tls13GenerateSharedSecret(TlsContext *context, const uint8_t *keyShare, size_t length)
(EC)DHE shared secret generation
error_t tls13ComputePskBinder(TlsContext *context, const void *clientHello, size_t clientHelloLen, size_t truncatedClientHelloLen, const Tls13PskIdentity *identity, uint8_t *binder, size_t binderLen)
Compute PSK binder value.
bool_t tls13IsEcdheGroupSupported(TlsContext *context, uint16_t namedGroup)
Check whether a given ECDHE group is supported.
uint16_t cipherSuite
Cipher suite identifier.
bool_t tls13IsPskValid(TlsContext *context)
Check whether an externally established PSK is valid.
bool_t tls13IsFfdheGroupSupported(TlsContext *context, uint16_t namedGroup)
Check whether a given FFDHE group is supported.
@ TLS_KEY_UPDATE_REQUESTED
Common interface for key encapsulation mechanisms (KEM)
const uint8_t tls11DowngradeRandom[8]
const uint8_t tls12DowngradeRandom[8]
void * Tls13EndOfEarlyData
EndOfEarlyData message.
@ TLS_KEY_UPDATE_NOT_REQUESTED
bool_t tls13IsHybridKeMethodSupported(TlsContext *context, uint16_t namedGroup)
Check whether a given hybrid key exchange method is supported.
uint32_t ticketAgeAdd
Random value used to obscure the age of the ticket.
#define TlsEncryptionEngine
error_t tls13CheckDuplicateKeyShare(uint16_t namedGroup, const uint8_t *p, size_t length)
Check whether the specified key share group is a duplicate.
error_t tls13FormatCertExtensions(uint8_t *p, size_t *written)
Format certificate extensions.
const uint8_t tls13HelloRetryRequestRandom[32]