5 #ifndef EAP_TLS_COMMON_H
6 #define EAP_TLS_COMMON_H
88 #define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80
89 #define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40
90 #define EAP_TLS_FLAGS_START 0x20
91 #define EAP_TLS_VERSION_MASK 0x07
94 #define EAP_TLS_KEY_LEN 64
97 #define EAP_UNAUTH_TLS_TYPE 255
98 #define EAP_WFA_UNAUTH_TLS_TYPE 254
105 const char *label,
size_t len);
110 EapType eap_type,
int peap_version,
111 u8
id,
const struct wpabuf *in_data,
112 struct wpabuf **out_data);
117 char *buf,
size_t buflen,
int verbose);
122 const struct wpabuf *reqData,
123 size_t *len, u8 *flags);
127 const struct wpabuf *in_data,
128 struct wpabuf **in_decrypted);
130 EapType eap_type,
int peap_version, u8
id,
131 const struct wpabuf *in_data,
132 struct wpabuf **out_data);
size_t tls_out_limit
Maximum fragment size for outgoing TLS messages.
Definition: eap_tls_common.h:35
int include_tls_length
Whether the TLS length field is included even if the TLS data is not fragmented.
Definition: eap_tls_common.h:65
EAP return values from struct eap_method::process()
Definition: eap_i.h:32
int eap_peer_tls_process_helper(struct eap_sm *sm, struct eap_ssl_data *data, EapType eap_type, int peap_version, u8 id, const struct wpabuf *in_data, struct wpabuf **out_data)
Process TLS handshake message.
Definition: eap_tls_common.c:632
int eap_peer_select_phase2_methods(struct eap_peer_config *config, const char *prefix, struct eap_method_type **types, size_t *num_types)
Select phase 2 EAP method.
Definition: eap_tls_common.c:997
struct wpabuf * tls_out
TLS message to be sent out in fragments.
Definition: eap_tls_common.h:23
struct eap_sm * eap
EAP state machine allocated with eap_peer_sm_init()
Definition: eap_tls_common.h:71
size_t tls_out_pos
The current position in the outgoing TLS message.
Definition: eap_tls_common.h:29
u8 eap_type
EAP method used in Phase 1 (EAP_TYPE_TLS/PEAP/TTLS/FAST)
Definition: eap_tls_common.h:83
u8 * eap_peer_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data, const char *label, size_t len)
Derive a key based on TLS session data.
Definition: eap_tls_common.c:310
int eap_peer_tls_encrypt(struct eap_sm *sm, struct eap_ssl_data *data, EapType eap_type, int peap_version, u8 id, const struct wpabuf *in_data, struct wpabuf **out_data)
Encrypt phase 2 TLS message.
Definition: eap_tls_common.c:963
size_t tls_in_left
Number of remaining bytes in the incoming TLS message.
Definition: eap_tls_common.h:47
void eap_peer_tls_reset_output(struct eap_ssl_data *data)
Reset output buffers.
Definition: eap_tls_common.c:915
int eap_peer_tls_phase2_nak(struct eap_method_type *types, size_t num_types, struct eap_hdr *hdr, struct wpabuf **resp)
Generate EAP-Nak for Phase 2.
Definition: eap_tls_common.c:1080
int phase2
Whether this TLS connection is used in EAP phase 2 (tunnel)
Definition: eap_tls_common.h:59
TLS data for EAP methods.
Definition: eap_tls_common.h:12
struct wpabuf * tls_in
Received TLS message buffer for re-assembly.
Definition: eap_tls_common.h:41
int eap_peer_tls_reauth_init(struct eap_sm *sm, struct eap_ssl_data *data)
Re-initialize shared TLS for session resumption.
Definition: eap_tls_common.c:738
const u8 * eap_peer_tls_process_init(struct eap_sm *sm, struct eap_ssl_data *data, EapType eap_type, struct eap_method_ret *ret, const struct wpabuf *reqData, size_t *len, u8 *flags)
Initial validation/processing of EAP requests.
Definition: eap_tls_common.c:805
int eap_peer_tls_status(struct eap_sm *sm, struct eap_ssl_data *data, char *buf, size_t buflen, int verbose)
Get TLS status.
Definition: eap_tls_common.c:755
struct wpabuf * eap_peer_tls_build_ack(u8 id, EapType eap_type, int peap_version)
Build a TLS ACK frame.
Definition: eap_tls_common.c:717
void eap_peer_tls_reset_input(struct eap_ssl_data *data)
Reset input buffers.
Definition: eap_tls_common.c:900
u8 * eap_peer_tls_derive_session_id(struct eap_sm *sm, struct eap_ssl_data *data, u8 eap_type, size_t *len)
Derive a Session-Id based on TLS data.
Definition: eap_tls_common.c:342
int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data, struct eap_peer_config *config, u8 eap_type)
Initialize shared TLS functionality.
Definition: eap_tls_common.c:240
Definition: eap_defs.h:14
size_t tls_in_total
Total number of bytes in the incoming TLS message.
Definition: eap_tls_common.h:53
int eap_peer_tls_decrypt(struct eap_sm *sm, struct eap_ssl_data *data, const struct wpabuf *in_data, struct wpabuf **in_decrypted)
Decrypt received phase 2 TLS message.
Definition: eap_tls_common.c:931
void * ssl_ctx
TLS library context to use for the connection.
Definition: eap_tls_common.h:77
Definition: tls_gnutls.c:38
EAP state machine data.
Definition: eap_i.h:302
struct tls_connection * conn
TLS connection context data from tls_connection_init()
Definition: eap_tls_common.h:17
void eap_peer_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data)
Deinitialize shared TLS functionality.
Definition: eap_tls_common.c:288
EAP peer configuration/credentials.
Definition: eap_config.h:12