6 /* draft-ietf-eap-statemachine-05.pdf - Peer state machine */
9 DECISION_FAIL, DECISION_COND_SUCC, DECISION_UNCOND_SUCC
13 METHOD_NONE, METHOD_INIT, METHOD_CONT, METHOD_MAY_CONT, METHOD_DONE
16 struct eap_method_ret {
18 EapMethodState methodState;
20 Boolean allowNotifications;
28 void * (*init)(struct eap_sm *sm);
29 void (*deinit)(struct eap_sm *sm, void *priv);
30 u8 * (*process)(struct eap_sm *sm, void *priv,
31 struct eap_method_ret *ret,
32 u8 *reqData, size_t reqDataLen,
34 Boolean (*isKeyAvailable)(struct eap_sm *sm, void *priv);
35 u8 * (*getKey)(struct eap_sm *sm, void *priv, size_t *len);
36 int (*get_status)(struct eap_sm *sm, void *priv, char *buf,
37 size_t buflen, int verbose);
39 /* Optional handlers for fast re-authentication */
40 Boolean (*has_reauth_data)(struct eap_sm *sm, void *priv);
41 void (*deinit_for_reauth)(struct eap_sm *sm, void *priv);
42 void * (*init_for_reauth)(struct eap_sm *sm, void *priv);
43 const u8 * (*get_identity)(struct eap_sm *sm, void *priv, size_t *len);
49 EAP_INITIALIZE, EAP_DISABLED, EAP_IDLE, EAP_RECEIVED,
50 EAP_GET_METHOD, EAP_METHOD, EAP_SEND_RESPONSE, EAP_DISCARD,
51 EAP_IDENTITY, EAP_NOTIFICATION, EAP_RETRANSMIT, EAP_SUCCESS,
54 /* Long-term local variables */
55 EapType selectedMethod;
56 EapMethodState methodState;
59 size_t lastRespDataLen;
61 /* Short-term local variables */
71 /* Miscellaneous variables */
72 Boolean allowNotifications; /* peer state machine <-> methods */
73 u8 *eapRespData; /* peer to lower layer */
74 size_t eapRespDataLen; /* peer to lower layer */
75 Boolean eapKeyAvailable; /* peer to lower layer */
76 u8 *eapKeyData; /* peer to lower layer */
77 size_t eapKeyDataLen; /* peer to lower layer */
78 const struct eap_method *m; /* selected EAP method */
79 /* not defined in draft-ietf-eap-statemachine-02 */
82 struct eapol_callbacks *eapol_cb;
83 void *eap_method_priv;
87 Boolean rxResp /* LEAP only */;
90 u8 req_md5[16]; /* MD5() of the current EAP packet */
91 u8 last_md5[16]; /* MD5() of the previously received EAP packet; used
92 * in duplicate request detection. */
98 unsigned int workaround;
100 /* Optional challenges generated in Phase 1 (EAP-FAST) */
101 u8 *peer_challenge, *auth_challenge;