eap_i.h

Go to the documentation of this file.
00001 
00016 #ifndef EAP_I_H
00017 #define EAP_I_H
00018 
00019 #include "eap.h"
00020 
00021 /* RFC 4137 - EAP Peer state machine */
00022 
00023 typedef enum {
00024         DECISION_FAIL, DECISION_COND_SUCC, DECISION_UNCOND_SUCC
00025 } EapDecision;
00026 
00027 typedef enum {
00028         METHOD_NONE, METHOD_INIT, METHOD_CONT, METHOD_MAY_CONT, METHOD_DONE
00029 } EapMethodState;
00030 
00040 struct eap_method_ret {
00045         Boolean ignore;
00046 
00051         EapMethodState methodState;
00052 
00057         EapDecision decision;
00058 
00063         Boolean allowNotifications;
00064 };
00065 
00066 
00074 struct eap_method {
00079         EapType method;
00080 
00085         const char *name;
00086 
00098         void * (*init)(struct eap_sm *sm);
00099 
00108         void (*deinit)(struct eap_sm *sm, void *priv);
00109 
00128         u8 * (*process)(struct eap_sm *sm, void *priv,
00129                         struct eap_method_ret *ret,
00130                         const u8 *reqData, size_t reqDataLen,
00131                         size_t *respDataLen);
00132 
00140         Boolean (*isKeyAvailable)(struct eap_sm *sm, void *priv);
00141 
00154         u8 * (*getKey)(struct eap_sm *sm, void *priv, size_t *len);
00155 
00171         int (*get_status)(struct eap_sm *sm, void *priv, char *buf,
00172                           size_t buflen, int verbose);
00173 
00185         Boolean (*has_reauth_data)(struct eap_sm *sm, void *priv);
00186 
00199         void (*deinit_for_reauth)(struct eap_sm *sm, void *priv);
00200 
00212         void * (*init_for_reauth)(struct eap_sm *sm, void *priv);
00213 
00226         const u8 * (*get_identity)(struct eap_sm *sm, void *priv, size_t *len);
00227 };
00228 
00229 
00234 struct eap_sm {
00235         enum {
00236                 EAP_INITIALIZE, EAP_DISABLED, EAP_IDLE, EAP_RECEIVED,
00237                 EAP_GET_METHOD, EAP_METHOD, EAP_SEND_RESPONSE, EAP_DISCARD,
00238                 EAP_IDENTITY, EAP_NOTIFICATION, EAP_RETRANSMIT, EAP_SUCCESS,
00239                 EAP_FAILURE
00240         } EAP_state;
00241         /* Long-term local variables */
00242         EapType selectedMethod;
00243         EapMethodState methodState;
00244         int lastId;
00245         u8 *lastRespData;
00246         size_t lastRespDataLen;
00247         EapDecision decision;
00248         /* Short-term local variables */
00249         Boolean rxReq;
00250         Boolean rxSuccess;
00251         Boolean rxFailure;
00252         int reqId;
00253         EapType reqMethod;
00254         Boolean ignore;
00255         /* Constants */
00256         int ClientTimeout;
00257 
00258         /* Miscellaneous variables */
00259         Boolean allowNotifications; /* peer state machine <-> methods */
00260         u8 *eapRespData; /* peer to lower layer */
00261         size_t eapRespDataLen; /* peer to lower layer */
00262         Boolean eapKeyAvailable; /* peer to lower layer */
00263         u8 *eapKeyData; /* peer to lower layer */
00264         size_t eapKeyDataLen; /* peer to lower layer */
00265         const struct eap_method *m; /* selected EAP method */
00266         /* not defined in RFC 4137 */
00267         Boolean changed;
00268         void *eapol_ctx;
00269         struct eapol_callbacks *eapol_cb;
00270         void *eap_method_priv;
00271         int init_phase2;
00272         int fast_reauth;
00273 
00274         Boolean rxResp /* LEAP only */;
00275         Boolean leap_done;
00276         Boolean peap_done;
00277         u8 req_md5[16]; /* MD5() of the current EAP packet */
00278         u8 last_md5[16]; /* MD5() of the previously received EAP packet; used
00279                           * in duplicate request detection. */
00280 
00281         void *msg_ctx;
00282         void *scard_ctx;
00283         void *ssl_ctx;
00284 
00285         unsigned int workaround;
00286 
00287         /* Optional challenges generated in Phase 1 (EAP-FAST) */
00288         u8 *peer_challenge, *auth_challenge;
00289 
00290         int num_rounds;
00291         int force_disabled;
00292 };
00293 
00294 const u8 * eap_hdr_validate(EapType eap_type, const u8 *msg, size_t msglen,
00295                             size_t *plen);
00296 void eap_set_config_blob(struct eap_sm *sm, struct wpa_config_blob *blob);
00297 const struct wpa_config_blob *
00298 eap_get_config_blob(struct eap_sm *sm, const char *name);
00299 
00300 #endif /* EAP_I_H */
00301 

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