wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eap_tls_common.h
Go to the documentation of this file.
1 
5 #ifndef EAP_TLS_COMMON_H
6 #define EAP_TLS_COMMON_H
7 
12 struct eap_ssl_data {
17  struct tls_connection *conn;
18 
23  struct wpabuf *tls_out;
24 
29  size_t tls_out_pos;
30 
35  size_t tls_out_limit;
36 
41  struct wpabuf *tls_in;
42 
47  int phase2;
48 
53  struct eap_sm *eap;
54 
55  enum { MSG, FRAG_ACK, WAIT_FRAG_ACK } state;
56  struct wpabuf tmpbuf;
57 };
58 
59 
60 /* EAP TLS Flags */
61 #define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80
62 #define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40
63 #define EAP_TLS_FLAGS_START 0x20
64 #define EAP_TLS_VERSION_MASK 0x07
65 
66  /* could be up to 128 bytes, but only the first 64 bytes are used */
67 #define EAP_TLS_KEY_LEN 64
68 
69 /* dummy type used as a flag for UNAUTH-TLS */
70 #define EAP_UNAUTH_TLS_TYPE 255
71 #define EAP_WFA_UNAUTH_TLS_TYPE 254
72 
73 
74 struct wpabuf * eap_tls_msg_alloc(EapType type, size_t payload_len,
75  u8 code, u8 identifier);
76 int eap_server_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
77  int verify_peer, int eap_type);
78 void eap_server_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data);
79 u8 * eap_server_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
80  char *label, size_t len);
82  struct eap_ssl_data *data, u8 eap_type,
83  size_t *len);
84 struct wpabuf * eap_server_tls_build_msg(struct eap_ssl_data *data,
85  int eap_type, int version, u8 id);
86 struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type, int version);
87 int eap_server_tls_phase1(struct eap_sm *sm, struct eap_ssl_data *data);
88 struct wpabuf * eap_server_tls_encrypt(struct eap_sm *sm,
89  struct eap_ssl_data *data,
90  const struct wpabuf *plain);
91 int eap_server_tls_process(struct eap_sm *sm, struct eap_ssl_data *data,
92  struct wpabuf *respData, void *priv, int eap_type,
93  int (*proc_version)(struct eap_sm *sm, void *priv,
94  int peer_version),
95  void (*proc_msg)(struct eap_sm *sm, void *priv,
96  const struct wpabuf *respData));
97 
98 #endif /* EAP_TLS_COMMON_H */
size_t tls_out_limit
Maximum fragment size for outgoing TLS messages.
Definition: eap_tls_common.h:35
struct wpabuf * tls_out
TLS message to be sent out in fragments.
Definition: eap_tls_common.h:23
u8 * eap_server_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_server_tls_common.c:137
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
Definition: wpabuf.h:16
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
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