2 * hostapd / EAP-TLS/PEAP/TTLS/FAST common functions
3 * Copyright (c) 2004-2007, 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.
15 #ifndef EAP_TLS_COMMON_H
16 #define EAP_TLS_COMMON_H
19 struct tls_connection *conn;
37 #define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80
38 #define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40
39 #define EAP_TLS_FLAGS_START 0x20
40 #define EAP_PEAP_VERSION_MASK 0x07
42 /* could be up to 128 bytes, but only the first 64 bytes are used */
43 #define EAP_TLS_KEY_LEN 64
46 int eap_server_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
48 void eap_server_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data);
49 u8 * eap_server_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
50 char *label, size_t len);
51 int eap_server_tls_data_reassemble(struct eap_sm *sm,
52 struct eap_ssl_data *data,
53 u8 **in_data, size_t *in_len);
54 int eap_server_tls_process_helper(struct eap_sm *sm, struct eap_ssl_data *data,
55 const u8 *in_data, size_t in_len);
56 int eap_server_tls_buildReq_helper(struct eap_sm *sm,
57 struct eap_ssl_data *data,
58 int eap_type, int peap_version, u8 id,
59 struct wpabuf **out_data);
60 struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type,
63 #endif /* EAP_TLS_COMMON_H */