23 #ifndef MBEDTLS_SSL_INTERNAL_H 24 #define MBEDTLS_SSL_INTERNAL_H 28 #if defined(MBEDTLS_MD5_C) 32 #if defined(MBEDTLS_SHA1_C) 36 #if defined(MBEDTLS_SHA256_C) 40 #if defined(MBEDTLS_SHA512_C) 44 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) 48 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ 49 !defined(inline) && !defined(__cplusplus) 50 #define inline __inline 54 #define MBEDTLS_SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 56 #if defined(MBEDTLS_SSL_PROTO_SSL3) 57 #define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0 59 #if defined(MBEDTLS_SSL_PROTO_TLS1) 60 #define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1 62 #if defined(MBEDTLS_SSL_PROTO_TLS1_1) 63 #define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2 65 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) 66 #define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3 73 #define MBEDTLS_SSL_MAX_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 75 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) 76 #define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3 78 #if defined(MBEDTLS_SSL_PROTO_TLS1_1) 79 #define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2 81 #if defined(MBEDTLS_SSL_PROTO_TLS1) 82 #define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1 84 #if defined(MBEDTLS_SSL_PROTO_SSL3) 85 #define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0 91 #define MBEDTLS_SSL_INITIAL_HANDSHAKE 0 92 #define MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS 1 93 #define MBEDTLS_SSL_RENEGOTIATION_DONE 2 94 #define MBEDTLS_SSL_RENEGOTIATION_PENDING 3 104 #define MBEDTLS_SSL_RETRANS_PREPARING 0 105 #define MBEDTLS_SSL_RETRANS_SENDING 1 106 #define MBEDTLS_SSL_RETRANS_WAITING 2 107 #define MBEDTLS_SSL_RETRANS_FINISHED 3 115 #if defined(MBEDTLS_ZLIB_SUPPORT) 116 #define MBEDTLS_SSL_COMPRESSION_ADD 1024 118 #define MBEDTLS_SSL_COMPRESSION_ADD 0 121 #if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_MODE_CBC) 123 #if defined(MBEDTLS_SHA512_C) 124 #define MBEDTLS_SSL_MAC_ADD 48 125 #elif defined(MBEDTLS_SHA256_C) 126 #define MBEDTLS_SSL_MAC_ADD 32 128 #define MBEDTLS_SSL_MAC_ADD 20 132 #define MBEDTLS_SSL_MAC_ADD 16 135 #if defined(MBEDTLS_CIPHER_MODE_CBC) 136 #define MBEDTLS_SSL_PADDING_ADD 256 138 #define MBEDTLS_SSL_PADDING_ADD 0 141 #define MBEDTLS_SSL_BUFFER_LEN ( MBEDTLS_SSL_MAX_CONTENT_LEN \ 142 + MBEDTLS_SSL_COMPRESSION_ADD \ 144 + MBEDTLS_SSL_MAC_ADD \ 145 + MBEDTLS_SSL_PADDING_ADD \ 153 #define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT (1 << 0) 154 #define MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK (1 << 1) 160 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ 161 defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) 187 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ 188 defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) 191 #if defined(MBEDTLS_DHM_C) 194 #if defined(MBEDTLS_ECDH_C) 197 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) 199 #if defined(MBEDTLS_SSL_CLI_C) 200 unsigned char *ecjpake_cache;
201 size_t ecjpake_cache_len;
204 #if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C) || \ 205 defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) 208 #if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) 212 #if defined(MBEDTLS_X509_CRT_PARSE_C) 214 #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) 221 #if defined(MBEDTLS_SSL_PROTO_DTLS) 247 #if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \ 248 defined(MBEDTLS_SSL_PROTO_TLS1_1) 252 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) 253 #if defined(MBEDTLS_SHA256_C) 256 #if defined(MBEDTLS_SHA512_C) 264 int (*
tls_prf)(
const unsigned char *, size_t,
const char *,
265 const unsigned char *, size_t,
266 unsigned char *, size_t);
279 #if defined(MBEDTLS_SSL_SESSION_TICKETS) 282 #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) 307 #if defined(MBEDTLS_SSL_PROTO_SSL3) 309 unsigned char mac_enc[20];
310 unsigned char mac_dec[20];
322 #if defined(MBEDTLS_ZLIB_SUPPORT) 323 z_stream ctx_deflate;
324 z_stream ctx_inflate;
328 #if defined(MBEDTLS_X509_CRT_PARSE_C) 340 #if defined(MBEDTLS_SSL_PROTO_DTLS) 353 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ 354 defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) 497 #if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) 501 #if defined(MBEDTLS_PK_C) 511 #if defined(MBEDTLS_ECP_C) 515 #if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) 520 #if defined(MBEDTLS_X509_CRT_PARSE_C) 561 unsigned char ver[2] );
563 const unsigned char ver[2] );
567 #if defined(MBEDTLS_SSL_PROTO_DTLS) 578 #if defined(MBEDTLS_SSL_PROTO_DTLS) 587 #if defined(MBEDTLS_SSL_PROTO_DTLS) 594 #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) 603 const unsigned char *
A = (
const unsigned char *)
a;
604 const unsigned char *
B = (
const unsigned char *)
b;
605 unsigned char diff = 0;
607 for( i = 0; i <
n; i++ )
static mbedtls_pk_context * mbedtls_ssl_own_key(mbedtls_ssl_context *ssl)
Definition: ssl_internal.h:521
int max_minor_ver
Definition: ssl_internal.h:276
#define MBEDTLS_PREMASTER_SIZE
Definition: ssl.h:386
Definition: ssl_internal.h:344
int mbedtls_ssl_write_certificate(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:4194
int mbedtls_ssl_check_curve(const mbedtls_ssl_context *ssl, mbedtls_ecp_group_id grp_id)
Definition: ssl_tls.c:7811
int extended_ms
Definition: ssl_internal.h:283
void(* calc_verify)(mbedtls_ssl_context *, unsigned char *)
Definition: ssl_internal.h:262
mbedtls_ssl_handshake_params * handshake
Definition: ssl.h:800
unsigned int in_flight_start_seq
Definition: ssl_internal.h:236
mbedtls_pk_type_t mbedtls_ssl_pk_alg_from_sig(unsigned char sig)
Definition: ssl_tls.c:7673
void mbedtls_ssl_sig_hash_set_const_hash(mbedtls_ssl_sig_hash_set_t *set, mbedtls_md_type_t md_alg)
Definition: ssl_tls.c:7732
mbedtls_md5_context fin_md5
Definition: ssl_internal.h:249
int cli_exts
Definition: ssl_internal.h:277
mbedtls_md_type_t ecdsa
Definition: ssl_internal.h:173
Definition: x509_crt.h:52
mbedtls_ssl_transform * alt_transform_out
Definition: ssl_internal.h:238
void mbedtls_ssl_recv_flight_completed(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:2646
int mbedtls_ssl_handle_message_type(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:4033
SHA-1 context structure.
Definition: sha1.h:46
mbedtls_ssl_key_cert * key_cert
Definition: ssl_internal.h:213
int new_session_ticket
Definition: ssl_internal.h:280
void mbedtls_ssl_read_version(int *major, int *minor, int transport, const unsigned char ver[2])
Definition: ssl_tls.c:7969
#define md
Definition: compat-1.3.h:1980
Ιστορικό Εικόνα Πληροφορίες Όλοι Οι Χρήστες Χειρίζονται Το Μενού Αριστερό Αναλογικό Αριστερό Αναλογικό Αριστερό Αναλογικό Y Αριστερό Αναλογικό Δεξί Αναλογικό X Δεξί Αναλογικό Δεξί Αναλογικό Y Δεξί Αναλογικό Σκανδάλη Όπλου Όπλο Aux A Όπλο Aux C Όπλο Select Όπλο D pad Κάτω Όπλο D pad Δεξιά Νεκρή Ζώνη Αναλογικού Σύνδεση Όλων Λήξη Χρόνου Σύνδεσης Hide Unbound Core Input Descriptors Κατάλογος Συσκευών Κατάλογος Ποντικιού Duty Cycle Keyboard Gamepad Mapping Enable Κουμπί B(κάτω)" ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN
size_t fixed_ivlen
Definition: ssl_internal.h:301
int mbedtls_ssl_handshake_client_step(mbedtls_ssl_context *ssl)
Definition: ssl_cli.c:3298
mbedtls_ecdh_context ecdh_ctx
Definition: ssl_internal.h:195
int mbedtls_ssl_read_record_layer(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:3757
mbedtls_ssl_flight_item * next
Definition: ssl_internal.h:349
unsigned int keylen
Definition: ssl_internal.h:298
unsigned char * p
Definition: ssl_internal.h:346
int(* tls_prf)(const unsigned char *, size_t, const char *, const unsigned char *, size_t, unsigned char *, size_t)
Definition: ssl_internal.h:264
unsigned char mbedtls_ssl_sig_from_pk_alg(mbedtls_pk_type_t type)
Definition: ssl_tls.c:7660
unsigned char retransmit_state
Definition: ssl_internal.h:233
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
int mbedtls_ssl_prepare_handshake_record(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:3071
mbedtls_key_exchange_type_t
Definition: ssl_ciphersuites.h:239
mbedtls_ssl_key_cert * sni_key_cert
Definition: ssl_internal.h:216
unsigned char randbytes[64]
Definition: ssl_internal.h:270
mbedtls_x509_crt * cert
Definition: ssl_internal.h:334
unsigned char iv_dec[16]
Definition: ssl_internal.h:305
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
mbedtls_md_context_t md_ctx_dec
Definition: ssl_internal.h:314
void(* calc_finished)(mbedtls_ssl_context *, unsigned char *, int)
Definition: ssl_internal.h:263
mbedtls_md_type_t
Definition: md.h:39
unsigned char alt_out_ctr[8]
Definition: ssl_internal.h:240
unsigned char premaster[MBEDTLS_PREMASTER_SIZE]
Definition: ssl_internal.h:271
void(* update_checksum)(mbedtls_ssl_context *, const unsigned char *, size_t)
Definition: ssl_internal.h:261
int mbedtls_ssl_fetch_input(mbedtls_ssl_context *ssl, size_t nb_want)
Definition: ssl_tls.c:2200
mbedtls_pk_type_t
Public key types.
Definition: pk.h:71
mbedtls_x509_crl * sni_ca_crl
Definition: ssl_internal.h:218
#define MBEDTLS_SSL_TRANSPORT_DATAGRAM
Definition: ssl.h:123
int mbedtls_ssl_write_record(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:2694
#define NULL
Pointer to 0.
Definition: gctypes.h:65
GLenum type
Definition: glext.h:6233
mbedtls_md_context_t md_ctx_enc
Definition: ssl_internal.h:313
int mbedtls_ssl_flush_output(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:2408
void mbedtls_ssl_optimize_checksum(mbedtls_ssl_context *ssl, const mbedtls_ssl_ciphersuite_t *ciphersuite_info)
Definition: ssl_tls.c:4804
mbedtls_sha512_context fin_sha512
Definition: ssl_internal.h:257
int mbedtls_ssl_send_fatal_handshake_failure(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:4099
void mbedtls_ssl_dtls_replay_update(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:3230
mbedtls_cipher_context_t cipher_ctx_enc
Definition: ssl_internal.h:316
int mbedtls_ssl_write_change_cipher_spec(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:4694
void mbedtls_ssl_reset_checksum(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:4833
static mbedtls_x509_crt * mbedtls_ssl_own_cert(mbedtls_ssl_context *ssl)
Definition: ssl_internal.h:533
Definition: ssl_internal.h:181
unsigned char verify_cookie_len
Definition: ssl_internal.h:227
unsigned int out_msg_seq
Definition: ssl_internal.h:222
SHA-1 cryptographic hash function.
mbedtls_sha256_context fin_sha256
Definition: ssl_internal.h:254
mbedtls_md_type_t mbedtls_ssl_sig_hash_set_find(mbedtls_ssl_sig_hash_set_t *set, mbedtls_pk_type_t sig_alg)
Definition: ssl_tls.c:7695
unsigned int transport
Definition: ssl.h:722
#define A(i)
Definition: ecp_curves.c:884
mbedtls_cipher_context_t cipher_ctx_dec
Definition: ssl_internal.h:317
int mbedtls_ssl_parse_change_cipher_spec(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:4717
int mbedtls_ssl_check_cert_usage(const mbedtls_x509_crt *cert, const mbedtls_ssl_ciphersuite_t *ciphersuite, int cert_endpoint, uint32_t *flags)
Definition: ssl_tls.c:7848
int mbedtls_ssl_set_calc_verify_md(mbedtls_ssl_context *ssl, int md)
Definition: ssl_tls.c:7991
int mbedtls_ssl_derive_keys(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:481
int mbedtls_ssl_parse_certificate(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:4310
mbedtls_md_type_t rsa
Definition: ssl_internal.h:172
int max_major_ver
Definition: ssl_internal.h:275
int mbedtls_ssl_read_record(mbedtls_ssl_context *ssl)
Update record layer.
Definition: ssl_tls.c:3715
SHA-384 and SHA-512 cryptographic hash function.
This structure is used for storing ciphersuite information.
Definition: ssl_ciphersuites.h:338
mbedtls_ssl_key_cert * key_cert
Definition: ssl.h:656
SHA-512 context structure.
Definition: sha512.h:45
void mbedtls_ssl_transform_free(mbedtls_ssl_transform *transform)
Free referenced items in an SSL transform context and clear memory.
Definition: ssl_tls.c:7205
size_t ivlen
Definition: ssl_internal.h:300
int mbedtls_ssl_resend(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:2587
size_t minlen
Definition: ssl_internal.h:299
Definition: x509_crl.h:69
unsigned char iv_enc[16]
Definition: ssl_internal.h:304
void mbedtls_ssl_update_handshake_status(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:3156
int mbedtls_ssl_write_finished(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:5227
static void mbedtls_ssl_sig_hash_set_init(mbedtls_ssl_sig_hash_set_t *set)
Definition: ssl_internal.h:368
uint32_t retransmit_timeout
Definition: ssl_internal.h:232
int mbedtls_ssl_handshake_server_step(mbedtls_ssl_context *ssl)
Definition: ssl_srv.c:3957
SHA-224 and SHA-256 cryptographic hash function.
static size_t mbedtls_ssl_hs_hdr_len(const mbedtls_ssl_context *ssl)
Definition: ssl_internal.h:576
Public key container.
Definition: pk.h:123
mbedtls_dhm_context dhm_ctx
Definition: ssl_internal.h:192
Definition: ssl_internal.h:332
int mbedtls_ssl_psk_derive_premaster(mbedtls_ssl_context *ssl, mbedtls_key_exchange_type_t key_ex)
Definition: ssl_tls.c:1080
size_t psk_len
Definition: ssl_internal.h:210
const mbedtls_ssl_config * conf
Definition: ssl.h:765
Definition: ssl_internal.h:165
GLuint GLenum GLenum transform
Definition: glext.h:10314
int mbedtls_ssl_parse_finished(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:5351
void mbedtls_ssl_write_version(int major, int minor, int transport, unsigned char ver[2])
Definition: ssl_tls.c:7947
MD5 context structure.
Definition: md5.h:46
mbedtls_md_type_t mbedtls_ssl_md_alg_from_hash(unsigned char hash)
Definition: ssl_tls.c:7745
mbedtls_x509_crt * sni_ca_chain
Definition: ssl_internal.h:217
size_t len
Definition: ssl_internal.h:347
void mbedtls_ssl_sig_hash_set_add(mbedtls_ssl_sig_hash_set_t *set, mbedtls_pk_type_t sig_alg, mbedtls_md_type_t md_alg)
Definition: ssl_tls.c:7710
mbedtls_pk_context * key
Definition: ssl_internal.h:335
size_t pmslen
Definition: ssl_internal.h:268
ECDH context structure.
Definition: ecdh.h:44
const mbedtls_ssl_ciphersuite_t * ciphersuite_info
Definition: ssl_internal.h:296
mbedtls_ssl_flight_item * flight
Definition: ssl_internal.h:234
unsigned int in_msg_seq
Definition: ssl_internal.h:223
int resume
Definition: ssl_internal.h:274
mbedtls_sha1_context fin_sha1
Definition: ssl_internal.h:250
unsigned char * hs_msg
Definition: ssl_internal.h:230
unsigned char * psk
Definition: ssl_internal.h:209
GLbitfield flags
Definition: glext.h:7828
unsigned char mbedtls_ssl_hash_from_md_alg(int md)
Definition: ssl_tls.c:7777
Definition: ssl_internal.h:291
int sni_authmode
Definition: ssl_internal.h:215
mbedtls_ssl_sig_hash_set_t hash_algs
Definition: ssl_internal.h:189
static size_t mbedtls_ssl_hdr_len(const mbedtls_ssl_context *ssl)
Definition: ssl_internal.h:565
const mbedtls_ecp_curve_info ** curves
Definition: ssl_internal.h:206
int mbedtls_ssl_dtls_replay_check(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:3205
mbedtls_ssl_flight_item * cur_msg
Definition: ssl_internal.h:235
mbedtls_ecp_group_id
Definition: ecp.h:62
void mbedtls_ssl_send_flight_completed(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:2671
GLdouble n
Definition: glext.h:8396
unsigned int uint32_t
Definition: stdint.h:126
static int mbedtls_ssl_safer_memcmp(const void *a, const void *b, size_t n)
Definition: ssl_internal.h:600
unsigned char type
Definition: ssl_internal.h:348
void mbedtls_ssl_handshake_wrapup(mbedtls_ssl_context *ssl)
Definition: ssl_tls.c:5165
int mbedtls_ssl_check_sig_hash(const mbedtls_ssl_context *ssl, mbedtls_md_type_t md)
Definition: ssl_tls.c:7831
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844
mbedtls_ssl_key_cert * next
Definition: ssl_internal.h:336
SHA-256 context structure.
Definition: sha256.h:46
size_t maclen
Definition: ssl_internal.h:302
void mbedtls_ssl_handshake_free(mbedtls_ssl_handshake_params *handshake)
Free referenced items in an SSL handshake context and clear memory.
Definition: ssl_tls.c:7238
unsigned char mbedtls_ssl_sig_from_pk(mbedtls_pk_context *pk)
Definition: ssl_tls.c:7647
unsigned char * verify_cookie
Definition: ssl_internal.h:225
DHM context structure.
Definition: dhm.h:149