2 * hostapd / EAP-TLS/PEAP/TTLS common functions
3 * Copyright (c) 2004-2005, 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_tls_ssl_init(struct eap_sm
*sm
, struct eap_ssl_data
*data
,
48 void eap_tls_ssl_deinit(struct eap_sm
*sm
, struct eap_ssl_data
*data
);
49 u8
* eap_tls_derive_key(struct eap_sm
*sm
, struct eap_ssl_data
*data
,
50 char *label
, size_t len
);
51 int eap_tls_data_reassemble(struct eap_sm
*sm
, struct eap_ssl_data
*data
,
52 u8
**in_data
, size_t *in_len
);
53 int eap_tls_process_helper(struct eap_sm
*sm
, struct eap_ssl_data
*data
,
54 u8
*in_data
, size_t in_len
);
55 int eap_tls_buildReq_helper(struct eap_sm
*sm
, struct eap_ssl_data
*data
,
56 int eap_type
, int peap_version
, u8 id
,
57 u8
**out_data
, size_t *out_len
);
58 u8
* eap_tls_build_ack(size_t *reqDataLen
, u8 id
, int eap_type
,
61 #endif /* EAP_TLS_COMMON_H */