2 * WPA Supplicant / EAP-TLS/PEAP/TTLS/FAST common functions
3 * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.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;
31 int include_tls_length; /* include TLS length field even if the TLS
32 * data is not fragmented */
39 #define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80
40 #define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40
41 #define EAP_TLS_FLAGS_START 0x20
42 #define EAP_PEAP_VERSION_MASK 0x07
44 /* could be up to 128 bytes, but only the first 64 bytes are used */
45 #define EAP_TLS_KEY_LEN 64
48 int eap_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
49 struct wpa_ssid *config);
50 void eap_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data);
51 u8 * eap_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
52 char *label, size_t len);
53 const u8 * eap_tls_data_reassemble(
54 struct eap_sm *sm, struct eap_ssl_data *data, const u8 *in_data,
55 size_t in_len, size_t *out_len, int *need_more_input);
56 int eap_tls_process_helper(struct eap_sm *sm, struct eap_ssl_data *data,
57 int eap_type, int peap_version,
58 u8 id, const u8 *in_data, size_t in_len,
59 u8 **out_data, size_t *out_len);
60 u8 * eap_tls_build_ack(struct eap_ssl_data *data, size_t *respDataLen, u8 id,
61 int eap_type, int peap_version);
62 int eap_tls_reauth_init(struct eap_sm *sm, struct eap_ssl_data *data);
63 int eap_tls_status(struct eap_sm *sm, struct eap_ssl_data *data, char *buf,
64 size_t buflen, int verbose);
65 const u8 * eap_tls_process_init(struct eap_sm *sm, struct eap_ssl_data *data,
66 EapType eap_type, struct eap_method_ret *ret,
67 const u8 *reqData, size_t reqDataLen,
68 size_t *len, u8 *flags);
70 #endif /* EAP_TLS_COMMON_H */