int timer_tick_enabled;
/* Global variables */
- Boolean eapFail;
- Boolean eapolEap;
- Boolean eapSuccess;
- Boolean initialize;
- Boolean keyDone;
- Boolean keyRun;
+ bool eapFail;
+ bool eapolEap;
+ bool eapSuccess;
+ bool initialize;
+ bool keyDone;
+ bool keyRun;
PortControl portControl;
- Boolean portEnabled;
+ bool portEnabled;
PortStatus suppPortStatus; /* dot1xSuppControlledPortStatus */
- Boolean portValid;
- Boolean suppAbort;
- Boolean suppFail;
- Boolean suppStart;
- Boolean suppSuccess;
- Boolean suppTimeout;
+ bool portValid;
+ bool suppAbort;
+ bool suppFail;
+ bool suppStart;
+ bool suppSuccess;
+ bool suppTimeout;
/* Supplicant PAE state machine */
enum {
SUPP_PAE_S_FORCE_UNAUTH = 10
} SUPP_PAE_state; /* dot1xSuppPaeState */
/* Variables */
- Boolean userLogoff;
- Boolean logoffSent;
+ bool userLogoff;
+ bool logoffSent;
unsigned int startCount;
- Boolean eapRestart;
+ bool eapRestart;
PortControl sPortMode;
/* Constants */
unsigned int heldPeriod; /* dot1xSuppHeldPeriod */
KEY_RX_NO_KEY_RECEIVE, KEY_RX_KEY_RECEIVE
} KEY_RX_state;
/* Variables */
- Boolean rxKey;
+ bool rxKey;
/* Supplicant Backend state machine */
enum {
SUPP_BE_SUCCESS = 8
} SUPP_BE_state; /* dot1xSuppBackendPaeState */
/* Variables */
- Boolean eapNoResp;
- Boolean eapReq;
- Boolean eapResp;
+ bool eapNoResp;
+ bool eapReq;
+ bool eapResp;
/* Constants */
unsigned int authPeriod; /* dot1xSuppAuthPeriod */
unsigned char dot1xSuppLastEapolFrameSource[6];
/* Miscellaneous variables (not defined in IEEE 802.1X-2004) */
- Boolean changed;
+ bool changed;
struct eap_sm *eap;
struct eap_peer_config *config;
- Boolean initial_req;
+ bool initial_req;
u8 *last_rx_key;
size_t last_rx_key_len;
struct wpabuf *eapReqData; /* for EAP */
- Boolean altAccept; /* for EAP */
- Boolean altReject; /* for EAP */
- Boolean eapTriggerStart;
- Boolean replay_counter_valid;
+ bool altAccept; /* for EAP */
+ bool altReject; /* for EAP */
+ bool eapTriggerStart;
+ bool replay_counter_valid;
u8 last_replay_counter[16];
struct eapol_config conf;
struct eapol_ctx *ctx;
enum { EAPOL_CB_IN_PROGRESS = 0, EAPOL_CB_SUCCESS, EAPOL_CB_FAILURE }
cb_status;
- Boolean cached_pmk;
+ bool cached_pmk;
- Boolean unicast_key_received, broadcast_key_received;
+ bool unicast_key_received, broadcast_key_received;
- Boolean force_authorized_update;
+ bool force_authorized_update;
#ifdef CONFIG_EAP_PROXY
- Boolean use_eap_proxy;
+ bool use_eap_proxy;
struct eap_proxy_sm *eap_proxy;
#endif /* CONFIG_EAP_PROXY */
};
{
SM_ENTRY(SUPP_PAE, LOGOFF);
eapol_sm_txLogoff(sm);
- sm->logoffSent = TRUE;
+ sm->logoffSent = true;
eapol_sm_set_port_unauthorized(sm);
}
SM_ENTRY(SUPP_PAE, DISCONNECTED);
sm->sPortMode = Auto;
sm->startCount = 0;
- sm->eapTriggerStart = FALSE;
- sm->logoffSent = FALSE;
+ sm->eapTriggerStart = false;
+ sm->logoffSent = false;
eapol_sm_set_port_unauthorized(sm);
- sm->suppAbort = TRUE;
+ sm->suppAbort = true;
- sm->unicast_key_received = FALSE;
- sm->broadcast_key_received = FALSE;
+ sm->unicast_key_received = false;
+ sm->broadcast_key_received = false;
/*
* IEEE Std 802.1X-2004 does not clear heldWhile here, but doing so
send_start = 1;
if (sm->ctx->preauth)
send_start = 1;
- sm->eapTriggerStart = FALSE;
+ sm->eapTriggerStart = false;
if (send_start) {
sm->startWhen = sm->startPeriod;
}
}
eapol_enable_timer_tick(sm);
- sm->eapolEap = FALSE;
+ sm->eapolEap = false;
if (send_start)
eapol_sm_txStart(sm);
}
{
SM_ENTRY(SUPP_PAE, AUTHENTICATING);
sm->startCount = 0;
- sm->suppSuccess = FALSE;
- sm->suppFail = FALSE;
- sm->suppTimeout = FALSE;
- sm->keyRun = FALSE;
- sm->keyDone = FALSE;
- sm->suppStart = TRUE;
+ sm->suppSuccess = false;
+ sm->suppFail = false;
+ sm->suppTimeout = false;
+ sm->keyRun = false;
+ sm->keyDone = false;
+ sm->suppStart = true;
}
}
SM_ENTRY(SUPP_PAE, RESTART);
- sm->eapRestart = TRUE;
+ sm->eapRestart = true;
if (sm->altAccept) {
/*
* Prevent EAP peer state machine from failing due to prior
- * external EAP success notification (altSuccess=TRUE in the
+ * external EAP success notification (altSuccess=true in the
* IDLE state could result in a transition to the FAILURE state.
*/
wpa_printf(MSG_DEBUG, "EAPOL: Clearing prior altAccept TRUE");
- sm->eapSuccess = FALSE;
- sm->altAccept = FALSE;
+ sm->eapSuccess = false;
+ sm->altAccept = false;
}
}
wpa_printf(MSG_DEBUG, "EAPOL: IEEE 802.1X for "
"plaintext connection; no EAPOL-Key frames "
"required");
- sm->portValid = TRUE;
+ sm->portValid = true;
if (sm->ctx->eapol_done_cb)
sm->ctx->eapol_done_cb(sm->ctx->ctx);
}
{
SM_ENTRY(KEY_RX, KEY_RECEIVE);
eapol_sm_processKey(sm);
- sm->rxKey = FALSE;
+ sm->rxKey = false;
}
{
SM_ENTRY(SUPP_BE, REQUEST);
sm->authWhile = 0;
- sm->eapReq = TRUE;
+ sm->eapReq = true;
eapol_sm_getSuppRsp(sm);
}
{
SM_ENTRY(SUPP_BE, RESPONSE);
eapol_sm_txSuppRsp(sm);
- sm->eapResp = FALSE;
+ sm->eapResp = false;
}
SM_STATE(SUPP_BE, SUCCESS)
{
SM_ENTRY(SUPP_BE, SUCCESS);
- sm->keyRun = TRUE;
- sm->suppSuccess = TRUE;
+ sm->keyRun = true;
+ sm->suppSuccess = true;
#ifdef CONFIG_EAP_PROXY
if (sm->use_eap_proxy) {
/* New key received - clear IEEE 802.1X EAPOL-Key replay
* counter */
- sm->replay_counter_valid = FALSE;
+ sm->replay_counter_valid = false;
session_id = eap_proxy_get_eap_session_id(
sm->eap_proxy, &session_id_len);
if (eap_key_available(sm->eap)) {
/* New key received - clear IEEE 802.1X EAPOL-Key replay
* counter */
- sm->replay_counter_valid = FALSE;
+ sm->replay_counter_valid = false;
}
}
SM_STATE(SUPP_BE, FAIL)
{
SM_ENTRY(SUPP_BE, FAIL);
- sm->suppFail = TRUE;
+ sm->suppFail = true;
}
SM_STATE(SUPP_BE, TIMEOUT)
{
SM_ENTRY(SUPP_BE, TIMEOUT);
- sm->suppTimeout = TRUE;
+ sm->suppTimeout = true;
}
SM_STATE(SUPP_BE, IDLE)
{
SM_ENTRY(SUPP_BE, IDLE);
- sm->suppStart = FALSE;
- sm->initial_req = TRUE;
+ sm->suppStart = false;
+ sm->initial_req = true;
}
{
SM_ENTRY(SUPP_BE, INITIALIZE);
eapol_sm_abortSupp(sm);
- sm->suppAbort = FALSE;
+ sm->suppAbort = false;
/*
* IEEE Std 802.1X-2004 does not clear authWhile here, but doing so
SM_ENTRY(SUPP_BE, RECEIVE);
sm->authWhile = sm->authPeriod;
eapol_enable_timer_tick(sm);
- sm->eapolEap = FALSE;
- sm->eapNoResp = FALSE;
- sm->initial_req = FALSE;
+ sm->eapolEap = false;
+ sm->eapNoResp = false;
+ sm->initial_req = false;
}
return;
}
- sm->replay_counter_valid = TRUE;
+ sm->replay_counter_valid = true;
os_memcpy(sm->last_replay_counter, key->replay_counter,
IEEE8021X_REPLAY_COUNTER_LEN);
" driver.");
} else {
if (key->key_index & IEEE8021X_KEY_INDEX_FLAG)
- sm->unicast_key_received = TRUE;
+ sm->unicast_key_received = true;
else
- sm->broadcast_key_received = TRUE;
+ sm->broadcast_key_received = true;
if ((sm->unicast_key_received ||
!(sm->conf.required_keys & EAPOL_REQUIRE_KEY_UNICAST)) &&
{
wpa_printf(MSG_DEBUG, "EAPOL: all required EAPOL-Key "
"frames received");
- sm->portValid = TRUE;
+ sm->portValid = true;
if (sm->ctx->eapol_done_cb)
sm->ctx->eapol_done_cb(sm->ctx->ctx);
}
int cb;
cb = sm->suppPortStatus != Authorized || sm->force_authorized_update;
- sm->force_authorized_update = FALSE;
+ sm->force_authorized_update = false;
sm->suppPortStatus = Authorized;
if (cb && sm->ctx->port_cb)
sm->ctx->port_cb(sm->ctx->ctx, 1);
int cb;
cb = sm->suppPortStatus != Unauthorized || sm->force_authorized_update;
- sm->force_authorized_update = FALSE;
+ sm->force_authorized_update = false;
sm->suppPortStatus = Unauthorized;
if (cb && sm->ctx->port_cb)
sm->ctx->port_cb(sm->ctx->ctx, 0);
* allow events (e.g., SIGTERM) to stop the program cleanly if the
* state machine were to generate a busy loop. */
for (i = 0; i < 100; i++) {
- sm->changed = FALSE;
+ sm->changed = false;
SM_STEP_RUN(SUPP_PAE);
SM_STEP_RUN(KEY_RX);
SM_STEP_RUN(SUPP_BE);
if (sm->use_eap_proxy) {
/* Drive the EAP proxy state machine */
if (eap_proxy_sm_step(sm->eap_proxy, sm->eap))
- sm->changed = TRUE;
+ sm->changed = true;
} else
#endif /* CONFIG_EAP_PROXY */
if (eap_peer_sm_step(sm->eap))
- sm->changed = TRUE;
+ sm->changed = true;
if (!sm->changed)
break;
}
if (sm->eapReqData) {
wpa_printf(MSG_DEBUG, "EAPOL: Received EAP-Packet "
"frame");
- sm->eapolEap = TRUE;
+ sm->eapolEap = true;
#ifdef CONFIG_EAP_PROXY
if (sm->use_eap_proxy) {
eap_proxy_packet_update(
"frame");
os_memcpy(sm->last_rx_key, buf, data_len);
sm->last_rx_key_len = data_len;
- sm->rxKey = TRUE;
+ sm->rxKey = true;
eapol_sm_step(sm);
}
break;
*
* Notify EAPOL state machine about new portEnabled value.
*/
-void eapol_sm_notify_portEnabled(struct eapol_sm *sm, Boolean enabled)
+void eapol_sm_notify_portEnabled(struct eapol_sm *sm, bool enabled)
{
if (sm == NULL)
return;
wpa_printf(MSG_DEBUG, "EAPOL: External notification - "
"portEnabled=%d", enabled);
if (sm->portEnabled != enabled)
- sm->force_authorized_update = TRUE;
+ sm->force_authorized_update = true;
sm->portEnabled = enabled;
eapol_sm_step(sm);
}
*
* Notify EAPOL state machine about new portValid value.
*/
-void eapol_sm_notify_portValid(struct eapol_sm *sm, Boolean valid)
+void eapol_sm_notify_portValid(struct eapol_sm *sm, bool valid)
{
if (sm == NULL)
return;
/**
* eapol_sm_notify_eap_success - Notification of external EAP success trigger
* @sm: Pointer to EAPOL state machine allocated with eapol_sm_init()
- * @success: %TRUE = set success, %FALSE = clear success
+ * @success: %true = set success, %false = clear success
*
* Notify the EAPOL state machine that external event has forced EAP state to
- * success (success = %TRUE). This can be cleared by setting success = %FALSE.
+ * success (success = %true). This can be cleared by setting success = %false.
*
* This function is called to update EAP state when WPA-PSK key handshake has
* been completed successfully since WPA-PSK does not use EAP state machine.
*/
-void eapol_sm_notify_eap_success(struct eapol_sm *sm, Boolean success)
+void eapol_sm_notify_eap_success(struct eapol_sm *sm, bool success)
{
if (sm == NULL)
return;
/**
* eapol_sm_notify_eap_fail - Notification of external EAP failure trigger
* @sm: Pointer to EAPOL state machine allocated with eapol_sm_init()
- * @fail: %TRUE = set failure, %FALSE = clear failure
+ * @fail: %true = set failure, %false = clear failure
*
* Notify EAPOL state machine that external event has forced EAP state to
- * failure (fail = %TRUE). This can be cleared by setting fail = %FALSE.
+ * failure (fail = %true). This can be cleared by setting fail = %false.
*/
-void eapol_sm_notify_eap_fail(struct eapol_sm *sm, Boolean fail)
+void eapol_sm_notify_eap_fail(struct eapol_sm *sm, bool fail)
{
if (sm == NULL)
return;
*
* Notify EAPOL state machines that user requested logon/logoff.
*/
-void eapol_sm_notify_logoff(struct eapol_sm *sm, Boolean logoff)
+void eapol_sm_notify_logoff(struct eapol_sm *sm, bool logoff)
{
if (sm) {
sm->userLogoff = logoff;
if (sm == NULL)
return;
wpa_printf(MSG_DEBUG, "EAPOL: PMKSA caching was used - skip EAPOL");
- sm->eapSuccess = TRUE;
+ sm->eapSuccess = true;
eap_notify_success(sm->eap);
eapol_sm_step(sm);
}
if (sm == NULL)
return;
wpa_printf(MSG_DEBUG, "RSN: Trying to use cached PMKSA");
- sm->cached_pmk = TRUE;
+ sm->cached_pmk = true;
}
"doing full EAP authentication");
if (sm == NULL)
return;
- sm->cached_pmk = FALSE;
+ sm->cached_pmk = false;
sm->SUPP_PAE_state = SUPP_PAE_CONNECTING;
eapol_sm_set_port_unauthorized(sm);
wpa_printf(MSG_DEBUG, "EAPOL: received control response (user "
"input) notification - retrying pending EAP "
"Request");
- sm->eapolEap = TRUE;
- sm->eapReq = TRUE;
+ sm->eapolEap = true;
+ sm->eapReq = true;
eapol_sm_step(sm);
}
}
}
-static Boolean eapol_sm_get_bool(void *ctx, enum eapol_bool_var variable)
+static bool eapol_sm_get_bool(void *ctx, enum eapol_bool_var variable)
{
struct eapol_sm *sm = ctx;
if (sm == NULL)
- return FALSE;
+ return false;
switch (variable) {
case EAPOL_eapSuccess:
return sm->eapSuccess;
case EAPOL_eapTriggerStart:
return sm->eapTriggerStart;
}
- return FALSE;
+ return false;
}
static void eapol_sm_set_bool(void *ctx, enum eapol_bool_var variable,
- Boolean value)
+ bool value)
{
struct eapol_sm *sm = ctx;
if (sm == NULL)
if (sm->eapReqData && !sm->eapReq) {
wpa_printf(MSG_DEBUG, "EAPOL: received notification from EAP "
"state machine - retrying pending EAP Request");
- sm->eapolEap = TRUE;
- sm->eapReq = TRUE;
+ sm->eapolEap = true;
+ sm->eapReq = true;
eapol_sm_step(sm);
}
}
}
#ifdef CONFIG_EAP_PROXY
- sm->use_eap_proxy = FALSE;
+ sm->use_eap_proxy = false;
sm->eap_proxy = eap_proxy_init(sm, &eapol_cb, sm->ctx->msg_ctx);
if (sm->eap_proxy == NULL) {
wpa_printf(MSG_ERROR, "Unable to initialize EAP Proxy");
#endif /* CONFIG_EAP_PROXY */
/* Initialize EAPOL state machines */
- sm->force_authorized_update = TRUE;
- sm->initialize = TRUE;
+ sm->force_authorized_update = true;
+ sm->initialize = true;
eapol_sm_step(sm);
- sm->initialize = FALSE;
+ sm->initialize = false;
eapol_sm_step(sm);
if (eloop_register_timeout(1, 0, eapol_port_timers_tick, NULL, sm) == 0)
if (bssid_changed)
wpas_notify_bssid_changed(wpa_s);
- eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
- eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
+ eapol_sm_notify_portEnabled(wpa_s->eapol, false);
+ eapol_sm_notify_portValid(wpa_s->eapol, false);
if (wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt) ||
wpa_s->key_mgmt == WPA_KEY_MGMT_OWE ||
wpa_s->key_mgmt == WPA_KEY_MGMT_DPP || wpa_s->drv_authorized_port)
- eapol_sm_notify_eap_success(wpa_s->eapol, FALSE);
+ eapol_sm_notify_eap_success(wpa_s->eapol, false);
wpa_s->drv_authorized_port = 0;
wpa_s->ap_ies_from_associnfo = 0;
wpa_s->current_ssid = NULL;
already_authorized = data && data->assoc_info.authorized;
/*
- * Set portEnabled first to FALSE in order to get EAP state machine out
+ * Set portEnabled first to false in order to get EAP state machine out
* of the SUCCESS state and eapSuccess cleared. Without this, EAPOL PAE
* state machine may transit to AUTHENTICATING state based on obsolete
* eapSuccess and then trigger BE_AUTH to SUCCESS and PAE to
* reset the state.
*/
if (!ft_completed && !already_authorized) {
- eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
- eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
+ eapol_sm_notify_portEnabled(wpa_s->eapol, false);
+ eapol_sm_notify_portValid(wpa_s->eapol, false);
}
if (wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt) ||
wpa_s->key_mgmt == WPA_KEY_MGMT_DPP ||
wpa_s->key_mgmt == WPA_KEY_MGMT_OWE || ft_completed ||
already_authorized || wpa_s->drv_authorized_port)
- eapol_sm_notify_eap_success(wpa_s->eapol, FALSE);
+ eapol_sm_notify_eap_success(wpa_s->eapol, false);
/* 802.1X::portControl = Auto */
- eapol_sm_notify_portEnabled(wpa_s->eapol, TRUE);
+ eapol_sm_notify_portEnabled(wpa_s->eapol, true);
wpa_s->eapol_received = 0;
if (wpa_s->key_mgmt == WPA_KEY_MGMT_NONE ||
wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE ||
*/
wpa_supplicant_cancel_auth_timeout(wpa_s);
wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
- eapol_sm_notify_portValid(wpa_s->eapol, TRUE);
- eapol_sm_notify_eap_success(wpa_s->eapol, TRUE);
+ eapol_sm_notify_portValid(wpa_s->eapol, true);
+ eapol_sm_notify_eap_success(wpa_s->eapol, true);
} else if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK) &&
wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt)) {
/*
*/
wpa_supplicant_cancel_auth_timeout(wpa_s);
wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
- eapol_sm_notify_portValid(wpa_s->eapol, TRUE);
- eapol_sm_notify_eap_success(wpa_s->eapol, TRUE);
+ eapol_sm_notify_portValid(wpa_s->eapol, true);
+ eapol_sm_notify_eap_success(wpa_s->eapol, true);
} else if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X) &&
wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt)) {
/*
* to allow EAPOL supplicant to complete its work without
* waiting for WPA supplicant.
*/
- eapol_sm_notify_portValid(wpa_s->eapol, TRUE);
+ eapol_sm_notify_portValid(wpa_s->eapol, true);
}
wpa_s->last_eapol_matches_bssid = 0;
if (wpa_s->wpa_state == WPA_ASSOCIATED) {
wpa_supplicant_cancel_auth_timeout(wpa_s);
wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
- eapol_sm_notify_portValid(wpa_s->eapol, TRUE);
- eapol_sm_notify_eap_success(wpa_s->eapol, TRUE);
+ eapol_sm_notify_portValid(wpa_s->eapol, true);
+ eapol_sm_notify_eap_success(wpa_s->eapol, true);
wpa_s->drv_authorized_port = 1;
}
}
* per-BSSID EAPOL authentication.
*/
eapol_sm_notify_portControl(wpa_s->eapol, ForceAuthorized);
- eapol_sm_notify_eap_success(wpa_s->eapol, TRUE);
- eapol_sm_notify_eap_fail(wpa_s->eapol, FALSE);
+ eapol_sm_notify_eap_success(wpa_s->eapol, true);
+ eapol_sm_notify_eap_fail(wpa_s->eapol, false);
return;
}
#endif /* CONFIG_IBSS_RSN */
- eapol_sm_notify_eap_success(wpa_s->eapol, FALSE);
- eapol_sm_notify_eap_fail(wpa_s->eapol, FALSE);
+ eapol_sm_notify_eap_success(wpa_s->eapol, false);
+ eapol_sm_notify_eap_fail(wpa_s->eapol, false);
if (wpa_s->key_mgmt == WPA_KEY_MGMT_NONE ||
wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE)
* Clear forced success to clear EAP state for next
* authentication.
*/
- eapol_sm_notify_eap_success(wpa_s->eapol, FALSE);
+ eapol_sm_notify_eap_success(wpa_s->eapol, false);
}
eapol_sm_notify_config(wpa_s->eapol, NULL, NULL);
wpa_sm_set_config(wpa_s->wpa, NULL);
wpa_sm_rx_eapol(wpa_s->wpa, src_addr, buf, len);
else if (wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt)) {
/*
- * Set portValid = TRUE here since we are going to skip 4-way
+ * Set portValid = true here since we are going to skip 4-way
* handshake processing which would normally set portValid. We
* need this to allow the EAPOL state machines to be completed
* without going through EAPOL-Key handshake.
*/
- eapol_sm_notify_portValid(wpa_s->eapol, TRUE);
+ eapol_sm_notify_portValid(wpa_s->eapol, true);
}
}
}
/* RSNA Supplicant Key Management - INITIALIZE */
- eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
- eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
+ eapol_sm_notify_portEnabled(wpa_s->eapol, false);
+ eapol_sm_notify_portValid(wpa_s->eapol, false);
/* Initialize driver interface and register driver event handler before
* L2 receive handler so that association events are processed before