wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tlsv1_client_i.h
Go to the documentation of this file.
1 
5 #ifndef TLSV1_CLIENT_I_H
6 #define TLSV1_CLIENT_I_H
7 
8 struct tlsv1_client {
9  enum {
10  CLIENT_HELLO, SERVER_HELLO, SERVER_CERTIFICATE,
11  SERVER_KEY_EXCHANGE, SERVER_CERTIFICATE_REQUEST,
12  SERVER_HELLO_DONE, CLIENT_KEY_EXCHANGE, CHANGE_CIPHER_SPEC,
13  SERVER_CHANGE_CIPHER_SPEC, SERVER_FINISHED, ACK_FINISHED,
14  ESTABLISHED, FAILED
15  } state;
16 
17  struct tlsv1_record_layer rl;
18 
19  u8 session_id[TLS_SESSION_ID_MAX_LEN];
20  size_t session_id_len;
21  u8 client_random[TLS_RANDOM_LEN];
22  u8 server_random[TLS_RANDOM_LEN];
23  u8 master_secret[TLS_MASTER_SECRET_LEN];
24 
25  u8 alert_level;
26  u8 alert_description;
27 
28  unsigned int certificate_requested:1;
29  unsigned int session_resumed:1;
30  unsigned int session_ticket_included:1;
31  unsigned int use_session_ticket:1;
32  unsigned int disable_time_checks:1;
33 
34  struct crypto_public_key *server_rsa_key;
35 
36  struct tls_verify_hash verify;
37 
38 #define MAX_CIPHER_COUNT 30
39  u16 cipher_suites[MAX_CIPHER_COUNT];
40  size_t num_cipher_suites;
41 
42  u16 prev_cipher_suite;
43 
44  u8 *client_hello_ext;
45  size_t client_hello_ext_len;
46 
47  /* The prime modulus used for Diffie-Hellman */
48  u8 *dh_p;
49  size_t dh_p_len;
50  /* The generator used for Diffie-Hellman */
51  u8 *dh_g;
52  size_t dh_g_len;
53  /* The server's Diffie-Hellman public value */
54  u8 *dh_ys;
55  size_t dh_ys_len;
56 
57  struct tlsv1_credentials *cred;
58 
59  tlsv1_client_session_ticket_cb session_ticket_cb;
60  void *session_ticket_cb_ctx;
61 
62  struct wpabuf *partial_input;
63 };
64 
65 
66 void tls_alert(struct tlsv1_client *conn, u8 level, u8 description);
67 void tlsv1_client_free_dh(struct tlsv1_client *conn);
68 int tls_derive_pre_master_secret(u8 *pre_master_secret);
69 int tls_derive_keys(struct tlsv1_client *conn,
70  const u8 *pre_master_secret, size_t pre_master_secret_len);
71 u8 * tls_send_client_hello(struct tlsv1_client *conn, size_t *out_len);
72 u8 * tlsv1_client_send_alert(struct tlsv1_client *conn, u8 level,
73  u8 description, size_t *out_len);
74 u8 * tlsv1_client_handshake_write(struct tlsv1_client *conn, size_t *out_len,
75  int no_appl_data);
76 int tlsv1_client_process_handshake(struct tlsv1_client *conn, u8 ct,
77  const u8 *buf, size_t *len,
78  u8 **out_data, size_t *out_len);
79 
80 #endif /* TLSV1_CLIENT_I_H */
Definition: crypto_libtomcrypt.c:403
Definition: tlsv1_cred.h:8
Definition: wpabuf.h:16
Definition: tlsv1_client_i.h:8
Definition: tlsv1_record.h:27
Definition: tlsv1_common.h:231