diff options
author | Jouni Malinen <j@w1.fi> | 2008-02-27 17:34:43 -0800 |
---|---|---|
committer | Jouni Malinen <jm@jm.kir.nu> | 2008-02-27 17:34:43 -0800 |
commit | 6fc6879bd55a394f807cbbe927df736c190cb8ab (patch) | |
tree | cdf50da0c58f21510a808d53502a060d911ff243 /src/eap_server/eap_tls_common.h | |
download | external_wpa_supplicant_8_ti-6fc6879bd55a394f807cbbe927df736c190cb8ab.zip external_wpa_supplicant_8_ti-6fc6879bd55a394f807cbbe927df736c190cb8ab.tar.gz external_wpa_supplicant_8_ti-6fc6879bd55a394f807cbbe927df736c190cb8ab.tar.bz2 |
Re-initialize hostapd/wpa_supplicant git repository based on 0.6.3 release
Diffstat (limited to 'src/eap_server/eap_tls_common.h')
-rw-r--r-- | src/eap_server/eap_tls_common.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/eap_server/eap_tls_common.h b/src/eap_server/eap_tls_common.h new file mode 100644 index 0000000..2470faa --- /dev/null +++ b/src/eap_server/eap_tls_common.h @@ -0,0 +1,63 @@ +/* + * hostapd / EAP-TLS/PEAP/TTLS/FAST common functions + * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef EAP_TLS_COMMON_H +#define EAP_TLS_COMMON_H + +struct eap_ssl_data { + struct tls_connection *conn; + + u8 *tls_out; + size_t tls_out_len; + size_t tls_out_pos; + size_t tls_out_limit; + u8 *tls_in; + size_t tls_in_len; + size_t tls_in_left; + size_t tls_in_total; + + int phase2; + + struct eap_sm *eap; +}; + + +/* EAP TLS Flags */ +#define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80 +#define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40 +#define EAP_TLS_FLAGS_START 0x20 +#define EAP_PEAP_VERSION_MASK 0x07 + + /* could be up to 128 bytes, but only the first 64 bytes are used */ +#define EAP_TLS_KEY_LEN 64 + + +int eap_server_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data, + int verify_peer); +void eap_server_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data); +u8 * eap_server_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data, + char *label, size_t len); +int eap_server_tls_data_reassemble(struct eap_sm *sm, + struct eap_ssl_data *data, + u8 **in_data, size_t *in_len); +int eap_server_tls_process_helper(struct eap_sm *sm, struct eap_ssl_data *data, + const u8 *in_data, size_t in_len); +int eap_server_tls_buildReq_helper(struct eap_sm *sm, + struct eap_ssl_data *data, + int eap_type, int peap_version, u8 id, + struct wpabuf **out_data); +struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type, + int peap_version); + +#endif /* EAP_TLS_COMMON_H */ |