|
wpa_supplicant / hostapd 2.0
|
00001 00010 #ifndef EAP_TLS_COMMON_H 00011 #define EAP_TLS_COMMON_H 00012 00017 struct eap_ssl_data { 00022 struct tls_connection *conn; 00023 00028 struct wpabuf *tls_out; 00029 00034 size_t tls_out_pos; 00035 00040 size_t tls_out_limit; 00041 00046 struct wpabuf *tls_in; 00047 00052 size_t tls_in_left; 00053 00058 size_t tls_in_total; 00059 00064 int phase2; 00065 00071 int include_tls_length; 00072 00077 struct eap_sm *eap; 00078 00083 void *ssl_ctx; 00084 }; 00085 00086 00087 /* EAP TLS Flags */ 00088 #define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80 00089 #define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40 00090 #define EAP_TLS_FLAGS_START 0x20 00091 #define EAP_TLS_VERSION_MASK 0x07 00092 00093 /* could be up to 128 bytes, but only the first 64 bytes are used */ 00094 #define EAP_TLS_KEY_LEN 64 00095 00096 00097 int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data, 00098 struct eap_peer_config *config); 00099 void eap_peer_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data); 00100 u8 * eap_peer_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data, 00101 const char *label, size_t len); 00102 int eap_peer_tls_process_helper(struct eap_sm *sm, struct eap_ssl_data *data, 00103 EapType eap_type, int peap_version, 00104 u8 id, const u8 *in_data, size_t in_len, 00105 struct wpabuf **out_data); 00106 struct wpabuf * eap_peer_tls_build_ack(u8 id, EapType eap_type, 00107 int peap_version); 00108 int eap_peer_tls_reauth_init(struct eap_sm *sm, struct eap_ssl_data *data); 00109 int eap_peer_tls_status(struct eap_sm *sm, struct eap_ssl_data *data, 00110 char *buf, size_t buflen, int verbose); 00111 const u8 * eap_peer_tls_process_init(struct eap_sm *sm, 00112 struct eap_ssl_data *data, 00113 EapType eap_type, 00114 struct eap_method_ret *ret, 00115 const struct wpabuf *reqData, 00116 size_t *len, u8 *flags); 00117 void eap_peer_tls_reset_input(struct eap_ssl_data *data); 00118 void eap_peer_tls_reset_output(struct eap_ssl_data *data); 00119 int eap_peer_tls_decrypt(struct eap_sm *sm, struct eap_ssl_data *data, 00120 const struct wpabuf *in_data, 00121 struct wpabuf **in_decrypted); 00122 int eap_peer_tls_encrypt(struct eap_sm *sm, struct eap_ssl_data *data, 00123 EapType eap_type, int peap_version, u8 id, 00124 const struct wpabuf *in_data, 00125 struct wpabuf **out_data); 00126 int eap_peer_select_phase2_methods(struct eap_peer_config *config, 00127 const char *prefix, 00128 struct eap_method_type **types, 00129 size_t *num_types); 00130 int eap_peer_tls_phase2_nak(struct eap_method_type *types, size_t num_types, 00131 struct eap_hdr *hdr, struct wpabuf **resp); 00132 00133 #endif /* EAP_TLS_COMMON_H */ 00134
1.7.3