wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tlsv1_client.h
Go to the documentation of this file.
1 
5 #ifndef TLSV1_CLIENT_H
6 #define TLSV1_CLIENT_H
7 
8 #include "tlsv1_cred.h"
9 
10 struct tlsv1_client;
11 
12 int tlsv1_client_global_init(void);
14 struct tlsv1_client * tlsv1_client_init(void);
15 void tlsv1_client_deinit(struct tlsv1_client *conn);
16 int tlsv1_client_established(struct tlsv1_client *conn);
17 int tlsv1_client_prf(struct tlsv1_client *conn, const char *label,
18  int server_random_first, u8 *out, size_t out_len);
19 u8 * tlsv1_client_handshake(struct tlsv1_client *conn,
20  const u8 *in_data, size_t in_len,
21  size_t *out_len, u8 **appl_data,
22  size_t *appl_data_len, int *need_more_data);
23 int tlsv1_client_encrypt(struct tlsv1_client *conn,
24  const u8 *in_data, size_t in_len,
25  u8 *out_data, size_t out_len);
26 struct wpabuf * tlsv1_client_decrypt(struct tlsv1_client *conn,
27  const u8 *in_data, size_t in_len,
28  int *need_more_data);
29 int tlsv1_client_get_cipher(struct tlsv1_client *conn, char *buf,
30  size_t buflen);
31 int tlsv1_client_shutdown(struct tlsv1_client *conn);
32 int tlsv1_client_resumed(struct tlsv1_client *conn);
33 int tlsv1_client_hello_ext(struct tlsv1_client *conn, int ext_type,
34  const u8 *data, size_t data_len);
35 int tlsv1_client_get_random(struct tlsv1_client *conn, struct tls_random *data);
37 int tlsv1_client_set_cipher_list(struct tlsv1_client *conn, u8 *ciphers);
38 int tlsv1_client_set_cred(struct tlsv1_client *conn,
39  struct tlsv1_credentials *cred);
40 void tlsv1_client_set_time_checks(struct tlsv1_client *conn, int enabled);
41 
42 typedef int (*tlsv1_client_session_ticket_cb)
43 (void *ctx, const u8 *ticket, size_t len, const u8 *client_random,
44  const u8 *server_random, u8 *master_secret);
45 
46 void tlsv1_client_set_session_ticket_cb(struct tlsv1_client *conn,
47  tlsv1_client_session_ticket_cb cb,
48  void *ctx);
49 
50 #endif /* TLSV1_CLIENT_H */
int tlsv1_client_set_cred(struct tlsv1_client *conn, struct tlsv1_credentials *cred)
Set client credentials.
Definition: tlsv1_client.c:804
int tlsv1_client_hello_ext(struct tlsv1_client *conn, int ext_type, const u8 *data, size_t data_len)
Set TLS extension for ClientHello.
Definition: tlsv1_client.c:678
int tlsv1_client_global_init(void)
Initialize TLSv1 client.
Definition: tlsv1_client.c:414
Definition: tlsv1_cred.h:8
Definition: tls.h:10
int tlsv1_client_established(struct tlsv1_client *conn)
Check whether connection has been established.
Definition: tlsv1_client.c:503
int tlsv1_client_prf(struct tlsv1_client *conn, const char *label, int server_random_first, u8 *out, size_t out_len)
Use TLS-PRF to derive keying material.
Definition: tlsv1_client.c:519
TLSv1 credentials.
struct tlsv1_client * tlsv1_client_init(void)
Initialize TLSv1 client connection.
Definition: tlsv1_client.c:438
Definition: wpabuf.h:16
Definition: tlsv1_client_i.h:8
int tlsv1_client_get_random(struct tlsv1_client *conn, struct tls_random *data)
Get random data from TLS connection.
Definition: tlsv1_client.c:719
u8 * tlsv1_client_handshake(struct tlsv1_client *conn, const u8 *in_data, size_t in_len, size_t *out_len, u8 **appl_data, size_t *appl_data_len, int *need_more_data)
Process TLS handshake.
Definition: tlsv1_client.c:135
int tlsv1_client_encrypt(struct tlsv1_client *conn, const u8 *in_data, size_t in_len, u8 *out_data, size_t out_len)
Encrypt data into TLS tunnel.
Definition: tlsv1_client.c:269
struct wpabuf * tlsv1_client_decrypt(struct tlsv1_client *conn, const u8 *in_data, size_t in_len, int *need_more_data)
Decrypt data from TLS tunnel.
Definition: tlsv1_client.c:302
void tlsv1_client_deinit(struct tlsv1_client *conn)
Deinitialize TLSv1 client connection.
Definition: tlsv1_client.c:483
int tlsv1_client_get_keyblock_size(struct tlsv1_client *conn)
Get TLS key_block size.
Definition: tlsv1_client.c:743
int tlsv1_client_get_cipher(struct tlsv1_client *conn, char *buf, size_t buflen)
Get current cipher name.
Definition: tlsv1_client.c:552
void tlsv1_client_global_deinit(void)
Deinitialize TLSv1 client.
Definition: tlsv1_client.c:428
int tlsv1_client_set_cipher_list(struct tlsv1_client *conn, u8 *ciphers)
Configure acceptable cipher suites.
Definition: tlsv1_client.c:760
int tlsv1_client_shutdown(struct tlsv1_client *conn)
Shutdown TLS connection.
Definition: tlsv1_client.c:636
int tlsv1_client_resumed(struct tlsv1_client *conn)
Was session resumption used.
Definition: tlsv1_client.c:664