2 * SSL/TLS interface functions for no TLS case
3 * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
20 void * tls_init(const struct tls_config
*conf
)
26 void tls_deinit(void *ssl_ctx
)
31 int tls_get_errors(void *tls_ctx
)
37 struct tls_connection
* tls_connection_init(void *tls_ctx
)
43 void tls_connection_deinit(void *tls_ctx
, struct tls_connection
*conn
)
48 int tls_connection_established(void *tls_ctx
, struct tls_connection
*conn
)
54 int tls_connection_shutdown(void *tls_ctx
, struct tls_connection
*conn
)
60 int tls_connection_set_params(void *tls_ctx
, struct tls_connection
*conn
,
61 const struct tls_connection_params
*params
)
67 int tls_global_set_params(void *tls_ctx
,
68 const struct tls_connection_params
*params
)
74 int tls_global_set_verify(void *tls_ctx
, int check_crl
)
80 int tls_connection_set_verify(void *tls_ctx
, struct tls_connection
*conn
,
87 int tls_connection_set_ia(void *tls_ctx
, struct tls_connection
*conn
,
94 int tls_connection_get_keys(void *tls_ctx
, struct tls_connection
*conn
,
95 struct tls_keys
*keys
)
101 int tls_connection_prf(void *tls_ctx
, struct tls_connection
*conn
,
102 const char *label
, int server_random_first
,
103 u8
*out
, size_t out_len
)
109 struct wpabuf
* tls_connection_handshake(void *tls_ctx
,
110 struct tls_connection
*conn
,
111 const struct wpabuf
*in_data
,
112 struct wpabuf
**appl_data
)
118 struct wpabuf
* tls_connection_server_handshake(void *tls_ctx
,
119 struct tls_connection
*conn
,
120 const struct wpabuf
*in_data
,
121 struct wpabuf
**appl_data
)
127 struct wpabuf
* tls_connection_encrypt(void *tls_ctx
,
128 struct tls_connection
*conn
,
129 const struct wpabuf
*in_data
)
135 struct wpabuf
* tls_connection_decrypt(void *tls_ctx
,
136 struct tls_connection
*conn
,
137 const struct wpabuf
*in_data
)
143 int tls_connection_resumed(void *tls_ctx
, struct tls_connection
*conn
)
149 int tls_connection_set_cipher_list(void *tls_ctx
, struct tls_connection
*conn
,
156 int tls_get_cipher(void *tls_ctx
, struct tls_connection
*conn
,
157 char *buf
, size_t buflen
)
163 int tls_connection_enable_workaround(void *tls_ctx
,
164 struct tls_connection
*conn
)
170 int tls_connection_client_hello_ext(void *tls_ctx
, struct tls_connection
*conn
,
171 int ext_type
, const u8
*data
,
178 int tls_connection_get_failed(void *tls_ctx
, struct tls_connection
*conn
)
184 int tls_connection_get_read_alerts(void *tls_ctx
, struct tls_connection
*conn
)
190 int tls_connection_get_write_alerts(void *tls_ctx
,
191 struct tls_connection
*conn
)
197 int tls_connection_get_keyblock_size(void *tls_ctx
,
198 struct tls_connection
*conn
)
204 unsigned int tls_capabilities(void *tls_ctx
)
210 struct wpabuf
* tls_connection_ia_send_phase_finished(
211 void *tls_ctx
, struct tls_connection
*conn
, int final
)
217 int tls_connection_ia_final_phase_finished(void *tls_ctx
,
218 struct tls_connection
*conn
)
224 int tls_connection_ia_permute_inner_secret(void *tls_ctx
,
225 struct tls_connection
*conn
,
226 const u8
*key
, size_t key_len
)