2 * SSL/TLS interface functions for no TLS case
3 * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
14 void * tls_init(const struct tls_config *conf)
20 void tls_deinit(void *ssl_ctx)
25 int tls_get_errors(void *tls_ctx)
31 struct tls_connection * tls_connection_init(void *tls_ctx)
37 void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn)
42 int tls_connection_established(void *tls_ctx, struct tls_connection *conn)
48 int tls_connection_shutdown(void *tls_ctx, struct tls_connection *conn)
54 int tls_connection_set_params(void *tls_ctx, struct tls_connection *conn,
55 const struct tls_connection_params *params)
61 int tls_global_set_params(void *tls_ctx,
62 const struct tls_connection_params *params)
68 int tls_global_set_verify(void *tls_ctx, int check_crl)
74 int tls_connection_set_verify(void *tls_ctx, struct tls_connection *conn,
75 int verify_peer, unsigned int flags,
76 const u8 *session_ctx, size_t session_ctx_len)
82 int tls_connection_get_random(void *tls_ctx, struct tls_connection *conn,
83 struct tls_random *data)
89 int tls_connection_prf(void *tls_ctx, struct tls_connection *conn,
90 const char *label, int server_random_first,
91 int skip_keyblock, u8 *out, size_t out_len)
97 struct wpabuf * tls_connection_handshake(void *tls_ctx,
98 struct tls_connection *conn,
99 const struct wpabuf *in_data,
100 struct wpabuf **appl_data)
106 struct wpabuf * tls_connection_server_handshake(void *tls_ctx,
107 struct tls_connection *conn,
108 const struct wpabuf *in_data,
109 struct wpabuf **appl_data)
115 struct wpabuf * tls_connection_encrypt(void *tls_ctx,
116 struct tls_connection *conn,
117 const struct wpabuf *in_data)
123 struct wpabuf * tls_connection_decrypt(void *tls_ctx,
124 struct tls_connection *conn,
125 const struct wpabuf *in_data)
131 int tls_connection_resumed(void *tls_ctx, struct tls_connection *conn)
137 int tls_connection_set_cipher_list(void *tls_ctx, struct tls_connection *conn,
144 int tls_get_version(void *ssl_ctx, struct tls_connection *conn,
145 char *buf, size_t buflen)
151 int tls_get_cipher(void *tls_ctx, struct tls_connection *conn,
152 char *buf, size_t buflen)
158 int tls_connection_enable_workaround(void *tls_ctx,
159 struct tls_connection *conn)
165 int tls_connection_client_hello_ext(void *tls_ctx, struct tls_connection *conn,
166 int ext_type, const u8 *data,
173 int tls_connection_get_failed(void *tls_ctx, struct tls_connection *conn)
179 int tls_connection_get_read_alerts(void *tls_ctx, struct tls_connection *conn)
185 int tls_connection_get_write_alerts(void *tls_ctx,
186 struct tls_connection *conn)
192 int tls_get_library_version(char *buf, size_t buf_len)
194 return os_snprintf(buf, buf_len, "none");
198 void tls_connection_set_success_data(struct tls_connection *conn,
204 void tls_connection_set_success_data_resumed(struct tls_connection *conn)
209 const struct wpabuf *
210 tls_connection_get_success_data(struct tls_connection *conn)
216 void tls_connection_remove_session(struct tls_connection *conn)