Disconnect hostapd from building in base
[dragonfly.git] / contrib / hostapd / src / tls / tlsv1_client.h
CommitLineData
a875087d 1/*
4781064b
JM
2 * TLS v1.0/v1.1/v1.2 client (RFC 2246, RFC 4346, RFC 5246)
3 * Copyright (c) 2006-2011, Jouni Malinen <j@w1.fi>
a875087d 4 *
4781064b
JM
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
a875087d
JL
7 */
8
9#ifndef TLSV1_CLIENT_H
10#define TLSV1_CLIENT_H
11
12#include "tlsv1_cred.h"
13
14struct tlsv1_client;
15
16int tlsv1_client_global_init(void);
17void tlsv1_client_global_deinit(void);
18struct tlsv1_client * tlsv1_client_init(void);
19void tlsv1_client_deinit(struct tlsv1_client *conn);
20int tlsv1_client_established(struct tlsv1_client *conn);
21int tlsv1_client_prf(struct tlsv1_client *conn, const char *label,
22 int server_random_first, u8 *out, size_t out_len);
23u8 * tlsv1_client_handshake(struct tlsv1_client *conn,
24 const u8 *in_data, size_t in_len,
25 size_t *out_len, u8 **appl_data,
4781064b 26 size_t *appl_data_len, int *need_more_data);
a875087d
JL
27int tlsv1_client_encrypt(struct tlsv1_client *conn,
28 const u8 *in_data, size_t in_len,
29 u8 *out_data, size_t out_len);
4781064b
JM
30struct wpabuf * tlsv1_client_decrypt(struct tlsv1_client *conn,
31 const u8 *in_data, size_t in_len,
32 int *need_more_data);
a875087d
JL
33int tlsv1_client_get_cipher(struct tlsv1_client *conn, char *buf,
34 size_t buflen);
35int tlsv1_client_shutdown(struct tlsv1_client *conn);
36int tlsv1_client_resumed(struct tlsv1_client *conn);
37int tlsv1_client_hello_ext(struct tlsv1_client *conn, int ext_type,
38 const u8 *data, size_t data_len);
39int tlsv1_client_get_keys(struct tlsv1_client *conn, struct tls_keys *keys);
40int tlsv1_client_get_keyblock_size(struct tlsv1_client *conn);
41int tlsv1_client_set_cipher_list(struct tlsv1_client *conn, u8 *ciphers);
42int tlsv1_client_set_cred(struct tlsv1_client *conn,
43 struct tlsv1_credentials *cred);
4781064b 44void tlsv1_client_set_time_checks(struct tlsv1_client *conn, int enabled);
a875087d
JL
45
46typedef int (*tlsv1_client_session_ticket_cb)
47(void *ctx, const u8 *ticket, size_t len, const u8 *client_random,
48 const u8 *server_random, u8 *master_secret);
49
50void tlsv1_client_set_session_ticket_cb(struct tlsv1_client *conn,
51 tlsv1_client_session_ticket_cb cb,
52 void *ctx);
53
54#endif /* TLSV1_CLIENT_H */