wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eapol_auth_sm_i.h
Go to the documentation of this file.
1 
5 #ifndef EAPOL_AUTH_SM_I_H
6 #define EAPOL_AUTH_SM_I_H
7 
8 #include "common/defs.h"
9 #include "radius/radius.h"
10 
11 /* IEEE Std 802.1X-2004, Ch. 8.2 */
12 
13 typedef enum { ForceUnauthorized = 1, ForceAuthorized = 3, Auto = 2 }
14  PortTypes;
15 typedef enum { Unauthorized = 2, Authorized = 1 } PortState;
16 typedef enum { Both = 0, In = 1 } ControlledDirection;
17 typedef unsigned int Counter;
18 
19 
25  struct eapol_auth_config conf;
26  struct eapol_auth_cb cb;
27 
28  u8 *default_wep_key;
29  u8 default_wep_key_idx;
30 
31  u32 acct_multi_session_id_hi;
32  u32 acct_multi_session_id_lo;
33 };
34 
35 
41  /* timers */
42  int aWhile;
43  int quietWhile;
44  int reAuthWhen;
45 
46  /* global variables */
47  Boolean authAbort;
48  Boolean authFail;
49  PortState authPortStatus;
50  Boolean authStart;
51  Boolean authTimeout;
52  Boolean authSuccess;
53  Boolean eapolEap;
54  Boolean initialize;
55  Boolean keyDone;
56  Boolean keyRun;
57  Boolean keyTxEnabled;
58  PortTypes portControl;
59  Boolean portValid;
60  Boolean reAuthenticate;
61 
62  /* Port Timers state machine */
63  /* 'Boolean tick' implicitly handled as registered timeout */
64 
65  /* Authenticator PAE state machine */
66  enum { AUTH_PAE_INITIALIZE, AUTH_PAE_DISCONNECTED, AUTH_PAE_CONNECTING,
67  AUTH_PAE_AUTHENTICATING, AUTH_PAE_AUTHENTICATED,
68  AUTH_PAE_ABORTING, AUTH_PAE_HELD, AUTH_PAE_FORCE_AUTH,
69  AUTH_PAE_FORCE_UNAUTH, AUTH_PAE_RESTART } auth_pae_state;
70  /* variables */
71  Boolean eapolLogoff;
72  Boolean eapolStart;
73  PortTypes portMode;
74  unsigned int reAuthCount;
75  /* constants */
76  unsigned int quietPeriod; /* default 60; 0..65535 */
77 #define AUTH_PAE_DEFAULT_quietPeriod 60
78  unsigned int reAuthMax; /* default 2 */
79 #define AUTH_PAE_DEFAULT_reAuthMax 2
80  /* counters */
81  Counter authEntersConnecting;
82  Counter authEapLogoffsWhileConnecting;
83  Counter authEntersAuthenticating;
84  Counter authAuthSuccessesWhileAuthenticating;
85  Counter authAuthTimeoutsWhileAuthenticating;
86  Counter authAuthFailWhileAuthenticating;
87  Counter authAuthEapStartsWhileAuthenticating;
88  Counter authAuthEapLogoffWhileAuthenticating;
89  Counter authAuthReauthsWhileAuthenticated;
90  Counter authAuthEapStartsWhileAuthenticated;
91  Counter authAuthEapLogoffWhileAuthenticated;
92 
93  /* Backend Authentication state machine */
94  enum { BE_AUTH_REQUEST, BE_AUTH_RESPONSE, BE_AUTH_SUCCESS,
95  BE_AUTH_FAIL, BE_AUTH_TIMEOUT, BE_AUTH_IDLE, BE_AUTH_INITIALIZE,
96  BE_AUTH_IGNORE
97  } be_auth_state;
98  /* constants */
99  unsigned int serverTimeout; /* default 30; 1..X */
100 #define BE_AUTH_DEFAULT_serverTimeout 30
101  /* counters */
102  Counter backendResponses;
103  Counter backendAccessChallenges;
104  Counter backendOtherRequestsToSupplicant;
105  Counter backendAuthSuccesses;
106  Counter backendAuthFails;
107 
108  /* Reauthentication Timer state machine */
109  enum { REAUTH_TIMER_INITIALIZE, REAUTH_TIMER_REAUTHENTICATE
110  } reauth_timer_state;
111  /* constants */
112  unsigned int reAuthPeriod; /* default 3600 s */
113  Boolean reAuthEnabled;
114 
115  /* Authenticator Key Transmit state machine */
116  enum { AUTH_KEY_TX_NO_KEY_TRANSMIT, AUTH_KEY_TX_KEY_TRANSMIT
117  } auth_key_tx_state;
118 
119  /* Key Receive state machine */
120  enum { KEY_RX_NO_KEY_RECEIVE, KEY_RX_KEY_RECEIVE } key_rx_state;
121  /* variables */
122  Boolean rxKey;
123 
124  /* Controlled Directions state machine */
125  enum { CTRL_DIR_FORCE_BOTH, CTRL_DIR_IN_OR_BOTH } ctrl_dir_state;
126  /* variables */
127  ControlledDirection adminControlledDirections;
128  ControlledDirection operControlledDirections;
129  Boolean operEdge;
130 
131  /* Authenticator Statistics Table */
132  Counter dot1xAuthEapolFramesRx;
133  Counter dot1xAuthEapolFramesTx;
134  Counter dot1xAuthEapolStartFramesRx;
135  Counter dot1xAuthEapolLogoffFramesRx;
136  Counter dot1xAuthEapolRespIdFramesRx;
137  Counter dot1xAuthEapolRespFramesRx;
138  Counter dot1xAuthEapolReqIdFramesTx;
139  Counter dot1xAuthEapolReqFramesTx;
140  Counter dot1xAuthInvalidEapolFramesRx;
141  Counter dot1xAuthEapLengthErrorFramesRx;
142  Counter dot1xAuthLastEapolFrameVersion;
143 
144  /* Other variables - not defined in IEEE 802.1X */
145  u8 addr[ETH_ALEN]; /* Supplicant address */
146  int flags; /* EAPOL_SM_* */
147 
148  /* EAPOL/AAA <-> EAP full authenticator interface */
149  struct eap_eapol_interface *eap_if;
150 
151  int radius_identifier;
152  /* TODO: check when the last messages can be released */
153  struct radius_msg *last_recv_radius;
154  u8 last_eap_id; /* last used EAP Identifier */
155  u8 *identity;
156  size_t identity_len;
157  u8 eap_type_authsrv; /* EAP type of the last EAP packet from
158  * Authentication server */
159  u8 eap_type_supp; /* EAP type of the last EAP packet from Supplicant */
160  struct radius_class_data radius_class;
161  struct wpabuf *radius_cui; /* Chargeable-User-Identity */
162 
163  /* Keys for encrypting and signing EAPOL-Key frames */
164  u8 *eapol_key_sign;
165  size_t eapol_key_sign_len;
166  u8 *eapol_key_crypt;
167  size_t eapol_key_crypt_len;
168 
169  struct eap_sm *eap;
170 
171  Boolean initializing; /* in process of initializing state machines */
172  Boolean changed;
173 
174  struct eapol_authenticator *eapol;
175 
176  void *sta; /* station context pointer to use in callbacks */
177 
178  int remediation;
179 
180  u32 acct_multi_session_id_hi;
181  u32 acct_multi_session_id_lo;
182 };
183 
184 #endif /* EAPOL_AUTH_SM_I_H */
Definition: eapol_auth_sm.h:13
RADIUS message structure for new and parsed messages.
Definition: radius.c:18
WPA Supplicant - Common definitions.
RADIUS message processing.
Definition: wpabuf.h:16
Definition: eap.h:39
Per-Supplicant Authenticator state machines.
Definition: eapol_auth_sm_i.h:40
Definition: eapol_auth_sm.h:59
EAP state machine data.
Definition: eap_i.h:302
Definition: radius.h:307
Global EAPOL authenticator data.
Definition: eapol_auth_sm_i.h:24