wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tlsv1_server_i.h
Go to the documentation of this file.
1 
5 #ifndef TLSV1_SERVER_I_H
6 #define TLSV1_SERVER_I_H
7 
8 struct tlsv1_server {
9  enum {
10  CLIENT_HELLO, SERVER_HELLO, SERVER_CERTIFICATE,
11  SERVER_KEY_EXCHANGE, SERVER_CERTIFICATE_REQUEST,
12  SERVER_HELLO_DONE, CLIENT_CERTIFICATE, CLIENT_KEY_EXCHANGE,
13  CERTIFICATE_VERIFY, CHANGE_CIPHER_SPEC, CLIENT_FINISHED,
14  SERVER_CHANGE_CIPHER_SPEC, SERVER_FINISHED,
15  ESTABLISHED, FAILED
16  } state;
17 
18  struct tlsv1_record_layer rl;
19 
20  u8 session_id[TLS_SESSION_ID_MAX_LEN];
21  size_t session_id_len;
22  u8 client_random[TLS_RANDOM_LEN];
23  u8 server_random[TLS_RANDOM_LEN];
24  u8 master_secret[TLS_MASTER_SECRET_LEN];
25 
26  u8 alert_level;
27  u8 alert_description;
28 
29  struct crypto_public_key *client_rsa_key;
30 
31  struct tls_verify_hash verify;
32 
33 #define MAX_CIPHER_COUNT 30
34  u16 cipher_suites[MAX_CIPHER_COUNT];
35  size_t num_cipher_suites;
36 
37  u16 cipher_suite;
38 
39  struct tlsv1_credentials *cred;
40 
41  int verify_peer;
42  u16 client_version;
43 
44  u8 *session_ticket;
45  size_t session_ticket_len;
46 
47  tlsv1_server_session_ticket_cb session_ticket_cb;
48  void *session_ticket_cb_ctx;
49 
50  void (*log_cb)(void *ctx, const char *msg);
51  void *log_cb_ctx;
52 
53  int use_session_ticket;
54 
55  u8 *dh_secret;
56  size_t dh_secret_len;
57 
58 #ifdef CONFIG_TESTING_OPTIONS
59  u32 test_flags;
60  int test_failure_reported;
61 #endif /* CONFIG_TESTING_OPTIONS */
62 };
63 
64 
65 void tlsv1_server_log(struct tlsv1_server *conn, const char *fmt, ...)
66 PRINTF_FORMAT(2, 3);
67 
68 void tlsv1_server_alert(struct tlsv1_server *conn, u8 level, u8 description);
69 int tlsv1_server_derive_keys(struct tlsv1_server *conn,
70  const u8 *pre_master_secret,
71  size_t pre_master_secret_len);
72 u8 * tlsv1_server_handshake_write(struct tlsv1_server *conn, size_t *out_len);
73 u8 * tlsv1_server_send_alert(struct tlsv1_server *conn, u8 level,
74  u8 description, size_t *out_len);
75 int tlsv1_server_process_handshake(struct tlsv1_server *conn, u8 ct,
76  const u8 *buf, size_t *len);
77 void tlsv1_server_get_dh_p(struct tlsv1_server *conn, const u8 **dh_p,
78  size_t *dh_p_len);
79 
80 #endif /* TLSV1_SERVER_I_H */
Definition: crypto_libtomcrypt.c:403
Definition: tlsv1_cred.h:8
Definition: tlsv1_record.h:27
Definition: tlsv1_server_i.h:8
Definition: tlsv1_common.h:231