eap_tls_common.h

Go to the documentation of this file.
00001 
00016 #ifndef EAP_TLS_COMMON_H
00017 #define EAP_TLS_COMMON_H
00018 
00019 struct eap_ssl_data {
00020         struct tls_connection *conn;
00021 
00022         u8 *tls_out;
00023         size_t tls_out_len;
00024         size_t tls_out_pos;
00025         size_t tls_out_limit;
00026         u8 *tls_in;
00027         size_t tls_in_len;
00028         size_t tls_in_left;
00029         size_t tls_in_total;
00030 
00031         int phase2;
00032         int include_tls_length; /* include TLS length field even if the TLS
00033                                  * data is not fragmented */
00034 
00035         struct eap_sm *eap;
00036 };
00037 
00038 
00039 /* EAP TLS Flags */
00040 #define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80
00041 #define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40
00042 #define EAP_TLS_FLAGS_START 0x20
00043 #define EAP_PEAP_VERSION_MASK 0x07
00044 
00045  /* could be up to 128 bytes, but only the first 64 bytes are used */
00046 #define EAP_TLS_KEY_LEN 64
00047 
00048 
00049 int eap_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
00050                      struct wpa_ssid *config);
00051 void eap_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data);
00052 u8 * eap_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
00053                         char *label, size_t len);
00054 const u8 * eap_tls_data_reassemble(
00055         struct eap_sm *sm, struct eap_ssl_data *data, const u8 *in_data,
00056         size_t in_len, size_t *out_len, int *need_more_input);
00057 int eap_tls_process_helper(struct eap_sm *sm, struct eap_ssl_data *data,
00058                            int eap_type, int peap_version,
00059                            u8 id, const u8 *in_data, size_t in_len,
00060                            u8 **out_data, size_t *out_len);
00061 u8 * eap_tls_build_ack(struct eap_ssl_data *data, size_t *respDataLen, u8 id,
00062                        int eap_type, int peap_version);
00063 int eap_tls_reauth_init(struct eap_sm *sm, struct eap_ssl_data *data);
00064 int eap_tls_status(struct eap_sm *sm, struct eap_ssl_data *data, char *buf,
00065                    size_t buflen, int verbose);
00066 const u8 * eap_tls_process_init(struct eap_sm *sm, struct eap_ssl_data *data,
00067                                 EapType eap_type, struct eap_method_ret *ret,
00068                                 const u8 *reqData, size_t reqDataLen,
00069                                 size_t *len, u8 *flags);
00070 
00071 #endif /* EAP_TLS_COMMON_H */
00072 

Generated on Sat May 6 21:13:36 2006 for wpa_supplicant by  doxygen 1.4.2