22#ifndef MBEDTLS_SSL_INTERNAL_H
23#define MBEDTLS_SSL_INTERNAL_H
25#if !defined(MBEDTLS_CONFIG_FILE)
28#include MBEDTLS_CONFIG_FILE
34#if defined(MBEDTLS_USE_PSA_CRYPTO)
38#if defined(MBEDTLS_MD5_C)
42#if defined(MBEDTLS_SHA1_C)
46#if defined(MBEDTLS_SHA256_C)
50#if defined(MBEDTLS_SHA512_C)
54#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
58#if defined(MBEDTLS_USE_PSA_CRYPTO)
63#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
64 !defined(inline) && !defined(__cplusplus)
65#define inline __inline
69#define MBEDTLS_SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3
71#if defined(MBEDTLS_SSL_PROTO_SSL3)
72#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0
74#if defined(MBEDTLS_SSL_PROTO_TLS1)
75#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1
77#if defined(MBEDTLS_SSL_PROTO_TLS1_1)
78#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2
80#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
81#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3
87#define MBEDTLS_SSL_MIN_VALID_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1
88#define MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3
91#define MBEDTLS_SSL_MAX_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3
93#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
94#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3
96#if defined(MBEDTLS_SSL_PROTO_TLS1_1)
97#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2
99#if defined(MBEDTLS_SSL_PROTO_TLS1)
100#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1
102#if defined(MBEDTLS_SSL_PROTO_SSL3)
103#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0
110#if defined(MBEDTLS_ECP_RESTARTABLE) && \
111 defined(MBEDTLS_SSL_CLI_C) && \
112 defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
113 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
114#define MBEDTLS_SSL_ECP_RESTARTABLE_ENABLED
117#define MBEDTLS_SSL_INITIAL_HANDSHAKE 0
118#define MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS 1
119#define MBEDTLS_SSL_RENEGOTIATION_DONE 2
120#define MBEDTLS_SSL_RENEGOTIATION_PENDING 3
130#define MBEDTLS_SSL_RETRANS_PREPARING 0
131#define MBEDTLS_SSL_RETRANS_SENDING 1
132#define MBEDTLS_SSL_RETRANS_WAITING 2
133#define MBEDTLS_SSL_RETRANS_FINISHED 3
141#if defined(MBEDTLS_ZLIB_SUPPORT)
142#define MBEDTLS_SSL_COMPRESSION_ADD 1024
144#define MBEDTLS_SSL_COMPRESSION_ADD 0
148#if defined(MBEDTLS_CIPHER_MODE_CBC) && \
149 ( defined(MBEDTLS_AES_C) || \
150 defined(MBEDTLS_CAMELLIA_C) || \
151 defined(MBEDTLS_ARIA_C) || \
152 defined(MBEDTLS_DES_C) )
153#define MBEDTLS_SSL_SOME_SUITES_USE_CBC
158#if defined(MBEDTLS_SSL_SOME_SUITES_USE_CBC) && \
159 ( defined(MBEDTLS_SSL_PROTO_TLS1) || \
160 defined(MBEDTLS_SSL_PROTO_TLS1_1) || \
161 defined(MBEDTLS_SSL_PROTO_TLS1_2) )
162#define MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC
165#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) || \
166 defined(MBEDTLS_SSL_SOME_SUITES_USE_CBC)
167#define MBEDTLS_SSL_SOME_MODES_USE_MAC
170#if defined(MBEDTLS_SSL_SOME_MODES_USE_MAC)
172#if defined(MBEDTLS_SHA512_C)
173#define MBEDTLS_SSL_MAC_ADD 48
174#elif defined(MBEDTLS_SHA256_C)
175#define MBEDTLS_SSL_MAC_ADD 32
177#define MBEDTLS_SSL_MAC_ADD 20
181#define MBEDTLS_SSL_MAC_ADD 16
184#if defined(MBEDTLS_CIPHER_MODE_CBC)
185#define MBEDTLS_SSL_PADDING_ADD 256
187#define MBEDTLS_SSL_PADDING_ADD 0
190#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
191#define MBEDTLS_SSL_MAX_CID_EXPANSION MBEDTLS_SSL_CID_PADDING_GRANULARITY
193#define MBEDTLS_SSL_MAX_CID_EXPANSION 0
196#define MBEDTLS_SSL_PAYLOAD_OVERHEAD ( MBEDTLS_SSL_COMPRESSION_ADD + \
197 MBEDTLS_MAX_IV_LENGTH + \
198 MBEDTLS_SSL_MAC_ADD + \
199 MBEDTLS_SSL_PADDING_ADD + \
200 MBEDTLS_SSL_MAX_CID_EXPANSION \
203#define MBEDTLS_SSL_IN_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \
204 ( MBEDTLS_SSL_IN_CONTENT_LEN ) )
206#define MBEDTLS_SSL_OUT_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \
207 ( MBEDTLS_SSL_OUT_CONTENT_LEN ) )
210#define MBEDTLS_SSL_MAX_BUFFERED_HS 4
216#define MBEDTLS_TLS_EXT_ADV_CONTENT_LEN ( \
217 (MBEDTLS_SSL_IN_CONTENT_LEN > MBEDTLS_SSL_OUT_CONTENT_LEN) \
218 ? ( MBEDTLS_SSL_OUT_CONTENT_LEN ) \
219 : ( MBEDTLS_SSL_IN_CONTENT_LEN ) \
223#define MBEDTLS_SSL_MAX_SIG_HASH_ALG_LIST_LEN 65534
226#define MBEDTLS_SSL_MAX_CURVE_LIST_LEN 65535
232#if MBEDTLS_SSL_MAX_CONTENT_LEN > 16384
233#error "Bad configuration - record content too large."
236#if MBEDTLS_SSL_IN_CONTENT_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN
237#error "Bad configuration - incoming record content should not be larger than MBEDTLS_SSL_MAX_CONTENT_LEN."
240#if MBEDTLS_SSL_OUT_CONTENT_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN
241#error "Bad configuration - outgoing record content should not be larger than MBEDTLS_SSL_MAX_CONTENT_LEN."
244#if MBEDTLS_SSL_IN_PAYLOAD_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN + 2048
245#error "Bad configuration - incoming protected record payload too large."
248#if MBEDTLS_SSL_OUT_PAYLOAD_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN + 2048
249#error "Bad configuration - outgoing protected record payload too large."
257#define MBEDTLS_SSL_HEADER_LEN 13
259#if !defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
260#define MBEDTLS_SSL_IN_BUFFER_LEN \
261 ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_IN_PAYLOAD_LEN ) )
263#define MBEDTLS_SSL_IN_BUFFER_LEN \
264 ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_IN_PAYLOAD_LEN ) \
265 + ( MBEDTLS_SSL_CID_IN_LEN_MAX ) )
268#if !defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
269#define MBEDTLS_SSL_OUT_BUFFER_LEN \
270 ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_OUT_PAYLOAD_LEN ) )
272#define MBEDTLS_SSL_OUT_BUFFER_LEN \
273 ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_OUT_PAYLOAD_LEN ) \
274 + ( MBEDTLS_SSL_CID_OUT_LEN_MAX ) )
277#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH)
280#if defined (MBEDTLS_SSL_DTLS_CONNECTION_ID)
281 return (uint32_t) mbedtls_ssl_get_output_max_frag_len( ctx )
282 + MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD
283 + MBEDTLS_SSL_CID_OUT_LEN_MAX;
285 return (uint32_t) mbedtls_ssl_get_output_max_frag_len( ctx )
286 + MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD;
292#if defined (MBEDTLS_SSL_DTLS_CONNECTION_ID)
293 return (uint32_t) mbedtls_ssl_get_input_max_frag_len( ctx )
294 + MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD
295 + MBEDTLS_SSL_CID_IN_LEN_MAX;
297 return (uint32_t) mbedtls_ssl_get_input_max_frag_len( ctx )
298 + MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD;
303#ifdef MBEDTLS_ZLIB_SUPPORT
305#define MBEDTLS_SSL_COMPRESS_BUFFER_LEN ( \
306 ( MBEDTLS_SSL_IN_BUFFER_LEN > MBEDTLS_SSL_OUT_BUFFER_LEN ) \
307 ? MBEDTLS_SSL_IN_BUFFER_LEN \
308 : MBEDTLS_SSL_OUT_BUFFER_LEN \
317#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT (1 << 0)
318#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK (1 << 1)
331static inline int mbedtls_ssl_chk_buf_ptr(
const uint8_t *cur,
332 const uint8_t *end,
size_t need )
334 return( ( cur > end ) || ( need > (
size_t)( end - cur ) ) );
347#define MBEDTLS_SSL_CHK_BUF_PTR( cur, end, need ) \
349 if( mbedtls_ssl_chk_buf_ptr( ( cur ), ( end ), ( need ) ) != 0 ) \
351 return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ); \
359#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
360 defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
364struct mbedtls_ssl_sig_hash_set_t
377typedef int mbedtls_ssl_tls_prf_cb(
const unsigned char *secret,
size_t slen,
379 const unsigned char *random,
size_t rlen,
380 unsigned char *dstbuf,
size_t dlen );
398#define MBEDTLS_SSL_MAX_BLOCK_LENGTH 16
399#define MBEDTLS_SSL_MAX_IV_LENGTH 16
400#define MBEDTLS_SSL_MAX_KEY_LENGTH 32
433#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
434 defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
435 mbedtls_ssl_sig_hash_set_t hash_algs;
437#if defined(MBEDTLS_DHM_C)
445#if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C)
448#if defined(MBEDTLS_USE_PSA_CRYPTO)
452 unsigned char ecdh_psa_peerkey[MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH];
453 size_t ecdh_psa_peerkey_len;
457#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
459#if defined(MBEDTLS_SSL_CLI_C)
460 unsigned char *ecjpake_cache;
461 size_t ecjpake_cache_len;
464#if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C) || \
465 defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
468#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
469#if defined(MBEDTLS_USE_PSA_CRYPTO)
475#if defined(MBEDTLS_X509_CRT_PARSE_C)
476 mbedtls_ssl_key_cert *key_cert;
477#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
479 mbedtls_ssl_key_cert *sni_key_cert;
484#if defined(MBEDTLS_SSL_ECP_RESTARTABLE_ENABLED)
486 mbedtls_x509_crt_restart_ctx ecrs_ctx;
490 ssl_ecrs_ske_start_processing,
491 ssl_ecrs_cke_ecdh_calc_secret,
492 ssl_ecrs_crt_vrfy_sign,
497#if defined(MBEDTLS_X509_CRT_PARSE_C) && \
498 !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)
501#if defined(MBEDTLS_SSL_PROTO_DTLS)
502 unsigned int out_msg_seq;
503 unsigned int in_msg_seq;
505 unsigned char *verify_cookie;
507 unsigned char verify_cookie_len;
510 uint32_t retransmit_timeout;
511 unsigned char retransmit_state;
512 mbedtls_ssl_flight_item *flight;
513 mbedtls_ssl_flight_item *cur_msg;
514 unsigned char *cur_msg_p;
515 unsigned int in_flight_start_seq;
519 unsigned char alt_out_ctr[8];
522#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
529 unsigned char peer_cid[ MBEDTLS_SSL_CID_OUT_LEN_MAX ];
530 uint8_t peer_cid_len;
536 size_t total_bytes_buffered;
542 struct mbedtls_ssl_hs_buffer
544 unsigned is_valid : 1;
545 unsigned is_fragmented : 1;
546 unsigned is_complete : 1;
549 } hs[MBEDTLS_SSL_MAX_BUFFERED_HS];
566#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \
567 defined(MBEDTLS_SSL_PROTO_TLS1_1)
571#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
572#if defined(MBEDTLS_SHA256_C)
573#if defined(MBEDTLS_USE_PSA_CRYPTO)
579#if defined(MBEDTLS_SHA512_C)
580#if defined(MBEDTLS_USE_PSA_CRYPTO)
591 mbedtls_ssl_tls_prf_cb *tls_prf;
606#if defined(MBEDTLS_SSL_SESSION_TICKETS)
607 int new_session_ticket;
609#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET)
613#if defined(MBEDTLS_SSL_ASYNC_PRIVATE)
614 unsigned int async_in_progress : 1;
617#if defined(MBEDTLS_SSL_ASYNC_PRIVATE)
623 void *user_async_ctx;
627typedef struct mbedtls_ssl_hs_buffer mbedtls_ssl_hs_buffer;
742#if defined(MBEDTLS_SSL_SOME_MODES_USE_MAC)
744#if defined(MBEDTLS_SSL_PROTO_SSL3)
746 unsigned char mac_enc[20];
747 unsigned char mac_dec[20];
753#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC)
754 int encrypt_then_mac;
763#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
766 unsigned char in_cid [ MBEDTLS_SSL_CID_OUT_LEN_MAX ];
767 unsigned char out_cid[ MBEDTLS_SSL_CID_OUT_LEN_MAX ];
773#if defined(MBEDTLS_ZLIB_SUPPORT)
774 z_stream ctx_deflate;
775 z_stream ctx_inflate;
778#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
781 unsigned char randbytes[64];
789static inline int mbedtls_ssl_transform_uses_aead(
792#if defined(MBEDTLS_SSL_SOME_MODES_USE_MAC)
793 return( transform->
maclen == 0 && transform->
taglen != 0 );
820#if MBEDTLS_SSL_CID_OUT_LEN_MAX > MBEDTLS_SSL_CID_IN_LEN_MAX
821#define MBEDTLS_SSL_CID_LEN_MAX MBEDTLS_SSL_CID_OUT_LEN_MAX
823#define MBEDTLS_SSL_CID_LEN_MAX MBEDTLS_SSL_CID_IN_LEN_MAX
848#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
850 unsigned char cid[ MBEDTLS_SSL_CID_LEN_MAX ];
854#if defined(MBEDTLS_X509_CRT_PARSE_C)
858struct mbedtls_ssl_key_cert
862 mbedtls_ssl_key_cert *next;
866#if defined(MBEDTLS_SSL_PROTO_DTLS)
870struct mbedtls_ssl_flight_item
875 mbedtls_ssl_flight_item *next;
879#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
880 defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
886void mbedtls_ssl_sig_hash_set_add( mbedtls_ssl_sig_hash_set_t *set,
890void mbedtls_ssl_sig_hash_set_const_hash( mbedtls_ssl_sig_hash_set_t *set,
894static inline void mbedtls_ssl_sig_hash_set_init( mbedtls_ssl_sig_hash_set_t *set )
1008 unsigned update_hs_digest );
1027#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
1028int mbedtls_ssl_psk_derive_premaster(
mbedtls_ssl_context *ssl, mbedtls_key_exchange_type_t key_ex );
1037 const unsigned char **psk,
size_t *psk_len )
1045 else if( ssl->
conf->psk != NULL && ssl->
conf->psk_len > 0 )
1047 *psk = ssl->
conf->psk;
1048 *psk_len = ssl->
conf->psk_len;
1061#if defined(MBEDTLS_USE_PSA_CRYPTO)
1072 if( ! mbedtls_svc_key_id_is_null( ssl->
handshake->psk_opaque ) )
1075 if( ! mbedtls_svc_key_id_is_null( ssl->
conf->psk_opaque ) )
1076 return( ssl->
conf->psk_opaque );
1078 return( MBEDTLS_SVC_KEY_ID_INIT );
1084#if defined(MBEDTLS_PK_C)
1091unsigned char mbedtls_ssl_hash_from_md_alg(
int md );
1094#if defined(MBEDTLS_ECP_C)
1098#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
1103#if defined(MBEDTLS_SSL_DTLS_SRTP)
1104static inline mbedtls_ssl_srtp_profile mbedtls_ssl_check_srtp_profile_value
1105 (
const uint16_t srtp_profile_value )
1107 switch( srtp_profile_value )
1109 case MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80:
1110 case MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32:
1111 case MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80:
1112 case MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32:
1113 return srtp_profile_value;
1116 return( MBEDTLS_TLS_SRTP_UNSET );
1120#if defined(MBEDTLS_X509_CRT_PARSE_C)
1123 mbedtls_ssl_key_cert *key_cert;
1128 key_cert = ssl->
conf->key_cert;
1130 return( key_cert == NULL ? NULL : key_cert->key );
1135 mbedtls_ssl_key_cert *key_cert;
1140 key_cert = ssl->
conf->key_cert;
1142 return( key_cert == NULL ? NULL : key_cert->cert );
1160void mbedtls_ssl_write_version(
int major,
int minor,
int transport,
1161 unsigned char ver[2] );
1162void mbedtls_ssl_read_version(
int *major,
int *minor,
int transport,
1163 const unsigned char ver[2] );
1167#if !defined(MBEDTLS_SSL_PROTO_DTLS)
1171#if defined(MBEDTLS_SSL_PROTO_DTLS)
1190#if defined(MBEDTLS_SSL_PROTO_DTLS)
1199#if defined(MBEDTLS_SSL_PROTO_DTLS)
1207#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
1216static inline int mbedtls_ssl_safer_memcmp(
const void *a,
const void *b,
size_t n )
1219 volatile const unsigned char *A = (
volatile const unsigned char *) a;
1220 volatile const unsigned char *B = (
volatile const unsigned char *) b;
1221 volatile unsigned char diff = 0;
1223 for( i = 0; i < n; i++ )
1228 unsigned char x = A[i], y = B[i];
1235#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \
1236 defined(MBEDTLS_SSL_PROTO_TLS1_1)
1238 unsigned char *output,
1239 unsigned char *data,
size_t data_len );
1243#if defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_PROTO_TLS1_1) || \
1244 defined(MBEDTLS_SSL_PROTO_TLS1_2)
1247 unsigned char *hash,
size_t *hashlen,
1248 unsigned char *data,
size_t data_len,
1261 int (*f_rng)(
void *,
unsigned char *,
size_t),
1270#if defined(MBEDTLS_SSL_PROTO_DTLS)
1279#if defined(MBEDTLS_SSL_PROTO_DTLS)
1293#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
1299#if defined(MBEDTLS_SSL_RENEGOTIATION)
1303#if defined(MBEDTLS_SSL_PROTO_DTLS)
1306void mbedtls_ssl_flight_free( mbedtls_ssl_flight_item *flight );
This file contains an abstraction interface for use with the cipher primitives provided by the librar...
Configuration options (set of defines)
Platform Security Architecture cryptography module.
uint16_t psa_key_type_t
Encoding of a key type.
uint32_t psa_key_id_t
Encoding of identifiers of persistent keys.
mbedtls_ecp_group_id
Domain-parameter identifiers: curve, subgroup, and generator.
mbedtls_md_type_t
Supported message digests.
#define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED
The own private key or pre-shared key is not set, but needed.
#define MBEDTLS_SSL_TRANSPORT_DATAGRAM
MD5 message digest algorithm (hash function)
This file contains SHA-1 definitions and functions.
mbedtls_pk_type_t
Public key types.
Utility functions for the use of the PSA Crypto library.
This file contains SHA-224 and SHA-256 definitions and functions.
This file contains SHA-384 and SHA-512 definitions and functions.
void mbedtls_ssl_handshake_free(mbedtls_ssl_context *ssl)
Free referenced items in an SSL handshake context and clear memory.
void mbedtls_ssl_transform_free(mbedtls_ssl_transform *transform)
Free referenced items in an SSL transform context and clear memory.
int mbedtls_ssl_read_record(mbedtls_ssl_context *ssl, unsigned update_hs_digest)
Update record layer.
The DHM context structure.
The ECDH context structure.
EC J-PAKE context structure.
Curve information, for use by other modules.
The generic message-digest context.
The SHA-1 context structure.
The SHA-256 context structure.
The SHA-512 context structure.
This structure is used for storing ciphersuite information.
mbedtls_ssl_handshake_params * handshake
const mbedtls_ssl_config * conf
unsigned char randbytes[64]
unsigned char premaster[MBEDTLS_PREMASTER_SIZE]
The data structure holding the cryptographic material (key and IV) used for record protection in TLS ...
unsigned char client_write_key[32]
unsigned char client_write_iv[16]
unsigned char server_write_key[32]
unsigned char server_write_iv[16]
Certificate revocation list structure.
Container for an X.509 certificate.