RetroArch
ssl_internal.h
Go to the documentation of this file.
1 
23 #ifndef MBEDTLS_SSL_INTERNAL_H
24 #define MBEDTLS_SSL_INTERNAL_H
25 
26 #include "ssl.h"
27 
28 #if defined(MBEDTLS_MD5_C)
29 #include "md5.h"
30 #endif
31 
32 #if defined(MBEDTLS_SHA1_C)
33 #include "sha1.h"
34 #endif
35 
36 #if defined(MBEDTLS_SHA256_C)
37 #include "sha256.h"
38 #endif
39 
40 #if defined(MBEDTLS_SHA512_C)
41 #include "sha512.h"
42 #endif
43 
44 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
45 #include "ecjpake.h"
46 #endif
47 
48 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
49  !defined(inline) && !defined(__cplusplus)
50 #define inline __inline
51 #endif
52 
53 /* Determine minimum supported version */
54 #define MBEDTLS_SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3
55 
56 #if defined(MBEDTLS_SSL_PROTO_SSL3)
57 #define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0
58 #else
59 #if defined(MBEDTLS_SSL_PROTO_TLS1)
60 #define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1
61 #else
62 #if defined(MBEDTLS_SSL_PROTO_TLS1_1)
63 #define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2
64 #else
65 #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
66 #define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3
67 #endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
68 #endif /* MBEDTLS_SSL_PROTO_TLS1_1 */
69 #endif /* MBEDTLS_SSL_PROTO_TLS1 */
70 #endif /* MBEDTLS_SSL_PROTO_SSL3 */
71 
72 /* Determine maximum supported version */
73 #define MBEDTLS_SSL_MAX_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3
74 
75 #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
76 #define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3
77 #else
78 #if defined(MBEDTLS_SSL_PROTO_TLS1_1)
79 #define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2
80 #else
81 #if defined(MBEDTLS_SSL_PROTO_TLS1)
82 #define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1
83 #else
84 #if defined(MBEDTLS_SSL_PROTO_SSL3)
85 #define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0
86 #endif /* MBEDTLS_SSL_PROTO_SSL3 */
87 #endif /* MBEDTLS_SSL_PROTO_TLS1 */
88 #endif /* MBEDTLS_SSL_PROTO_TLS1_1 */
89 #endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
90 
91 #define MBEDTLS_SSL_INITIAL_HANDSHAKE 0
92 #define MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS 1 /* In progress */
93 #define MBEDTLS_SSL_RENEGOTIATION_DONE 2 /* Done or aborted */
94 #define MBEDTLS_SSL_RENEGOTIATION_PENDING 3 /* Requested (server only) */
95 
96 /*
97  * DTLS retransmission states, see RFC 6347 4.2.4
98  *
99  * The SENDING state is merged in PREPARING for initial sends,
100  * but is distinct for resends.
101  *
102  * Note: initial state is wrong for server, but is not used anyway.
103  */
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
108 
109 /*
110  * Allow extra bytes for record, authentication and encryption overhead:
111  * counter (8) + header (5) + IV(16) + MAC (16-48) + padding (0-256)
112  * and allow for a maximum of 1024 of compression expansion if
113  * enabled.
114  */
115 #if defined(MBEDTLS_ZLIB_SUPPORT)
116 #define MBEDTLS_SSL_COMPRESSION_ADD 1024
117 #else
118 #define MBEDTLS_SSL_COMPRESSION_ADD 0
119 #endif
120 
121 #if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_MODE_CBC)
122 /* Ciphersuites using HMAC */
123 #if defined(MBEDTLS_SHA512_C)
124 #define MBEDTLS_SSL_MAC_ADD 48 /* SHA-384 used for HMAC */
125 #elif defined(MBEDTLS_SHA256_C)
126 #define MBEDTLS_SSL_MAC_ADD 32 /* SHA-256 used for HMAC */
127 #else
128 #define MBEDTLS_SSL_MAC_ADD 20 /* SHA-1 used for HMAC */
129 #endif
130 #else
131 /* AEAD ciphersuites: GCM and CCM use a 128 bits tag */
132 #define MBEDTLS_SSL_MAC_ADD 16
133 #endif
134 
135 #if defined(MBEDTLS_CIPHER_MODE_CBC)
136 #define MBEDTLS_SSL_PADDING_ADD 256
137 #else
138 #define MBEDTLS_SSL_PADDING_ADD 0
139 #endif
140 
141 #define MBEDTLS_SSL_BUFFER_LEN ( MBEDTLS_SSL_MAX_CONTENT_LEN \
142  + MBEDTLS_SSL_COMPRESSION_ADD \
143  + 29 /* counter + header + IV */ \
144  + MBEDTLS_SSL_MAC_ADD \
145  + MBEDTLS_SSL_PADDING_ADD \
146  )
147 
148 /*
149  * TLS extension flags (for extensions with outgoing ServerHello content
150  * that need it (e.g. for RENEGOTIATION_INFO the server already knows because
151  * of state of the renegotiation flag, so no indicator is required)
152  */
153 #define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT (1 << 0)
154 #define MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK (1 << 1)
155 
156 #ifdef __cplusplus
157 extern "C" {
158 #endif
159 
160 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
161  defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED)
162 /*
163  * Abstraction for a grid of allowed signature-hash-algorithm pairs.
164  */
166 {
167  /* At the moment, we only need to remember a single suitable
168  * hash algorithm per signature algorithm. As long as that's
169  * the case - and we don't need a general lookup function -
170  * we can implement the sig-hash-set as a map from signatures
171  * to hash algorithms. */
174 };
175 #endif /* MBEDTLS_SSL_PROTO_TLS1_2 &&
176  MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED */
177 
178 /*
179  * This structure contains the parameters only needed during handshake.
180  */
182 {
183  /*
184  * Handshake specific crypto variables
185  */
186 
187 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
188  defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED)
190 #endif
191 #if defined(MBEDTLS_DHM_C)
193 #endif
194 #if defined(MBEDTLS_ECDH_C)
196 #endif
197 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
198  mbedtls_ecjpake_context ecjpake_ctx;
199 #if defined(MBEDTLS_SSL_CLI_C)
200  unsigned char *ecjpake_cache;
201  size_t ecjpake_cache_len;
202 #endif
203 #endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */
204 #if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C) || \
205  defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
207 #endif
208 #if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
209  unsigned char *psk;
210  size_t psk_len;
211 #endif
212 #if defined(MBEDTLS_X509_CRT_PARSE_C)
214 #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
219 #endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */
220 #endif /* MBEDTLS_X509_CRT_PARSE_C */
221 #if defined(MBEDTLS_SSL_PROTO_DTLS)
222  unsigned int out_msg_seq;
223  unsigned int in_msg_seq;
225  unsigned char *verify_cookie;
227  unsigned char verify_cookie_len;
230  unsigned char *hs_msg;
233  unsigned char retransmit_state;
236  unsigned int in_flight_start_seq;
240  unsigned char alt_out_ctr[8];
242 #endif /* MBEDTLS_SSL_PROTO_DTLS */
243 
244  /*
245  * Checksum contexts
246  */
247 #if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \
248  defined(MBEDTLS_SSL_PROTO_TLS1_1)
251 #endif
252 #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
253 #if defined(MBEDTLS_SHA256_C)
255 #endif
256 #if defined(MBEDTLS_SHA512_C)
258 #endif
259 #endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
260 
261  void (*update_checksum)(mbedtls_ssl_context *, const unsigned char *, size_t);
262  void (*calc_verify)(mbedtls_ssl_context *, unsigned char *);
263  void (*calc_finished)(mbedtls_ssl_context *, unsigned char *, int);
264  int (*tls_prf)(const unsigned char *, size_t, const char *,
265  const unsigned char *, size_t,
266  unsigned char *, size_t);
267 
268  size_t pmslen;
270  unsigned char randbytes[64];
274  int resume;
277  int cli_exts;
279 #if defined(MBEDTLS_SSL_SESSION_TICKETS)
281 #endif /* MBEDTLS_SSL_SESSION_TICKETS */
282 #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET)
284 #endif
285 };
286 
287 /*
288  * This structure contains a full set of runtime transform parameters
289  * either in negotiation or active.
290  */
292 {
293  /*
294  * Session specific crypto layer
295  */
298  unsigned int keylen;
299  size_t minlen;
300  size_t ivlen;
301  size_t fixed_ivlen;
302  size_t maclen;
304  unsigned char iv_enc[16];
305  unsigned char iv_dec[16];
307 #if defined(MBEDTLS_SSL_PROTO_SSL3)
308  /* Needed only for SSL v3.0 secret */
309  unsigned char mac_enc[20];
310  unsigned char mac_dec[20];
311 #endif /* MBEDTLS_SSL_PROTO_SSL3 */
312 
319  /*
320  * Session specific compression layer
321  */
322 #if defined(MBEDTLS_ZLIB_SUPPORT)
323  z_stream ctx_deflate;
324  z_stream ctx_inflate;
325 #endif
326 };
327 
328 #if defined(MBEDTLS_X509_CRT_PARSE_C)
329 /*
330  * List of certificate + private key pairs
331  */
333 {
337 };
338 #endif /* MBEDTLS_X509_CRT_PARSE_C */
339 
340 #if defined(MBEDTLS_SSL_PROTO_DTLS)
341 /*
342  * List of handshake messages kept around for resending
343  */
345 {
346  unsigned char *p;
347  size_t len;
348  unsigned char type;
350 };
351 #endif /* MBEDTLS_SSL_PROTO_DTLS */
352 
353 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
354  defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED)
355 
356 /* Find an entry in a signature-hash set matching a given hash algorithm. */
358  mbedtls_pk_type_t sig_alg );
359 /* Add a signature-hash-pair to a signature-hash set */
361  mbedtls_pk_type_t sig_alg,
362  mbedtls_md_type_t md_alg );
363 /* Allow exactly one hash algorithm for each signature. */
365  mbedtls_md_type_t md_alg );
366 
367 /* Setup an empty signature-hash set */
369 {
371 }
372 
373 #endif /* MBEDTLS_SSL_PROTO_TLS1_2) &&
374  MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED */
375 
383 
391 
395 
397 
400 
405 
480 int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want );
481 
484 
487 
490 
493 
495  const mbedtls_ssl_ciphersuite_t *ciphersuite_info );
496 
497 #if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
499 #endif
500 
501 #if defined(MBEDTLS_PK_C)
502 unsigned char mbedtls_ssl_sig_from_pk( mbedtls_pk_context *pk );
505 #endif
506 
507 mbedtls_md_type_t mbedtls_ssl_md_alg_from_hash( unsigned char hash );
508 unsigned char mbedtls_ssl_hash_from_md_alg( int md );
510 
511 #if defined(MBEDTLS_ECP_C)
513 #endif
514 
515 #if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED)
518 #endif
519 
520 #if defined(MBEDTLS_X509_CRT_PARSE_C)
522 {
523  mbedtls_ssl_key_cert *key_cert;
524 
525  if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL )
526  key_cert = ssl->handshake->key_cert;
527  else
528  key_cert = ssl->conf->key_cert;
529 
530  return( key_cert == NULL ? NULL : key_cert->key );
531 }
532 
534 {
535  mbedtls_ssl_key_cert *key_cert;
536 
537  if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL )
538  key_cert = ssl->handshake->key_cert;
539  else
540  key_cert = ssl->conf->key_cert;
541 
542  return( key_cert == NULL ? NULL : key_cert->cert );
543 }
544 
545 /*
546  * Check usage of a certificate wrt extensions:
547  * keyUsage, extendedKeyUsage (later), and nSCertType (later).
548  *
549  * Warning: cert_endpoint is the endpoint of the cert (ie, of our peer when we
550  * check a cert we received from them)!
551  *
552  * Return 0 if everything is OK, -1 if not.
553  */
555  const mbedtls_ssl_ciphersuite_t *ciphersuite,
556  int cert_endpoint,
557  uint32_t *flags );
558 #endif /* MBEDTLS_X509_CRT_PARSE_C */
559 
560 void mbedtls_ssl_write_version( int major, int minor, int transport,
561  unsigned char ver[2] );
562 void mbedtls_ssl_read_version( int *major, int *minor, int transport,
563  const unsigned char ver[2] );
564 
565 static inline size_t mbedtls_ssl_hdr_len( const mbedtls_ssl_context *ssl )
566 {
567 #if defined(MBEDTLS_SSL_PROTO_DTLS)
569  return( 13 );
570 #else
571  ((void) ssl);
572 #endif
573  return( 5 );
574 }
575 
576 static inline size_t mbedtls_ssl_hs_hdr_len( const mbedtls_ssl_context *ssl )
577 {
578 #if defined(MBEDTLS_SSL_PROTO_DTLS)
580  return( 12 );
581 #else
582  ((void) ssl);
583 #endif
584  return( 4 );
585 }
586 
587 #if defined(MBEDTLS_SSL_PROTO_DTLS)
591 #endif
592 
593 /* Visible for testing purposes only */
594 #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
597 #endif
598 
599 /* constant-time buffer comparison */
600 static inline int mbedtls_ssl_safer_memcmp( const void *a, const void *b, size_t n )
601 {
602  size_t i;
603  const unsigned char *A = (const unsigned char *) a;
604  const unsigned char *B = (const unsigned char *) b;
605  unsigned char diff = 0;
606 
607  for( i = 0; i < n; i++ )
608  diff |= A[i] ^ B[i];
609 
610  return( diff );
611 }
612 
613 #ifdef __cplusplus
614 }
615 #endif
616 
617 #endif /* ssl_internal.h */
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
Definition: ecjpake.h:69
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
Definition: md.h:40
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
SSL/TLS functions.
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
Definition: ssl.h:763
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
Definition: cipher.h:216
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
Definition: md.h:66
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
Definition: ecp.h:89
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
Elliptic curve J-PAKE.
unsigned char * verify_cookie
Definition: ssl_internal.h:225
DHM context structure.
Definition: dhm.h:149