aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2020-04-23 21:29:09 (GMT)
committerJouni Malinen <j@w1.fi>2020-04-24 14:06:50 (GMT)
commit3dc69721e8f206141aff221ab2ea7438a63a116d (patch)
treed98e3506f4b82656a40b76d6aad0c0c23b6e91d2
parent56024a233a87e8762394c40237c19b5041b03976 (diff)
downloadhostap-3dc69721e8f206141aff221ab2ea7438a63a116d.zip
hostap-3dc69721e8f206141aff221ab2ea7438a63a116d.tar.gz
hostap-3dc69721e8f206141aff221ab2ea7438a63a116d.tar.bz2
EAPOL auth: Convert Boolean to C99 bool
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--src/ap/ieee802_1x.c81
-rw-r--r--src/ap/ieee802_1x.h7
-rw-r--r--src/eapol_auth/eapol_auth_sm.c102
-rw-r--r--src/eapol_auth/eapol_auth_sm_i.h40
4 files changed, 114 insertions, 116 deletions
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index 6d4d435..ee095f6 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -878,7 +878,7 @@ static void handle_eap_response(struct hostapd_data *hapd,
wpabuf_free(sm->eap_if->eapRespData);
sm->eap_if->eapRespData = wpabuf_alloc_copy(eap, len);
- sm->eapolEap = TRUE;
+ sm->eapolEap = true;
}
@@ -909,7 +909,7 @@ static void handle_eap_initiate(struct hostapd_data *hapd,
wpabuf_free(sm->eap_if->eapRespData);
sm->eap_if->eapRespData = wpabuf_alloc_copy(eap, len);
- sm->eapolEap = TRUE;
+ sm->eapolEap = true;
#endif /* CONFIG_ERP */
}
@@ -1140,7 +1140,7 @@ void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
}
#endif /* CONFIG_WPS */
- sta->eapol_sm->eap_if->portEnabled = TRUE;
+ sta->eapol_sm->eap_if->portEnabled = true;
}
/* since we support version 1, we can ignore version field and proceed
@@ -1167,7 +1167,7 @@ void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
"cached PMKSA available - ignore it since STA sent EAPOL-Start");
wpa_auth_sta_clear_pmksa(sta->wpa_sm, pmksa);
}
- sta->eapol_sm->eapolStart = TRUE;
+ sta->eapol_sm->eapolStart = true;
sta->eapol_sm->dot1xAuthEapolStartFramesRx++;
eap_server_clear_identity(sta->eapol_sm->eap);
wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH_EAPOL);
@@ -1180,7 +1180,7 @@ void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
sta->acct_terminate_cause =
RADIUS_ACCT_TERMINATE_CAUSE_USER_REQUEST;
accounting_sta_stop(hapd, sta);
- sta->eapol_sm->eapolLogoff = TRUE;
+ sta->eapol_sm->eapolLogoff = true;
sta->eapol_sm->dot1xAuthEapolLogoffFramesRx++;
eap_server_clear_identity(sta->eapol_sm->eap);
break;
@@ -1297,7 +1297,7 @@ void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta)
}
#endif /* CONFIG_WPS */
- sta->eapol_sm->eap_if->portEnabled = TRUE;
+ sta->eapol_sm->eap_if->portEnabled = true;
#ifdef CONFIG_IEEE80211R_AP
if (sta->auth_alg == WLAN_AUTH_FT) {
@@ -1306,13 +1306,13 @@ void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta)
"PMK from FT - skip IEEE 802.1X/EAP");
/* Setup EAPOL state machines to already authenticated state
* because of existing FT information from R0KH. */
- sta->eapol_sm->keyRun = TRUE;
- sta->eapol_sm->eap_if->eapKeyAvailable = TRUE;
+ sta->eapol_sm->keyRun = true;
+ sta->eapol_sm->eap_if->eapKeyAvailable = true;
sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING;
sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS;
- sta->eapol_sm->authSuccess = TRUE;
- sta->eapol_sm->authFail = FALSE;
- sta->eapol_sm->portValid = TRUE;
+ sta->eapol_sm->authSuccess = true;
+ sta->eapol_sm->authFail = false;
+ sta->eapol_sm->portValid = true;
if (sta->eapol_sm->eap)
eap_sm_notify_cached(sta->eapol_sm->eap);
ap_sta_bind_vlan(hapd, sta);
@@ -1329,13 +1329,13 @@ void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta)
"PMK from FILS - skip IEEE 802.1X/EAP");
/* Setup EAPOL state machines to already authenticated state
* because of existing FILS information. */
- sta->eapol_sm->keyRun = TRUE;
- sta->eapol_sm->eap_if->eapKeyAvailable = TRUE;
+ sta->eapol_sm->keyRun = true;
+ sta->eapol_sm->eap_if->eapKeyAvailable = true;
sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING;
sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS;
- sta->eapol_sm->authSuccess = TRUE;
- sta->eapol_sm->authFail = FALSE;
- sta->eapol_sm->portValid = TRUE;
+ sta->eapol_sm->authSuccess = true;
+ sta->eapol_sm->authFail = false;
+ sta->eapol_sm->portValid = true;
if (sta->eapol_sm->eap)
eap_sm_notify_cached(sta->eapol_sm->eap);
wpa_auth_set_ptk_rekey_timer(sta->wpa_sm);
@@ -1350,12 +1350,12 @@ void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta)
"PMK from PMKSA cache - skip IEEE 802.1X/EAP");
/* Setup EAPOL state machines to already authenticated state
* because of existing PMKSA information in the cache. */
- sta->eapol_sm->keyRun = TRUE;
- sta->eapol_sm->eap_if->eapKeyAvailable = TRUE;
+ sta->eapol_sm->keyRun = true;
+ sta->eapol_sm->eap_if->eapKeyAvailable = true;
sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING;
sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS;
- sta->eapol_sm->authSuccess = TRUE;
- sta->eapol_sm->authFail = FALSE;
+ sta->eapol_sm->authSuccess = true;
+ sta->eapol_sm->authFail = false;
if (sta->eapol_sm->eap)
eap_sm_notify_cached(sta->eapol_sm->eap);
pmksa_cache_to_eapol_data(hapd, pmksa, sta->eapol_sm);
@@ -1367,7 +1367,7 @@ void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta)
* re-authentication without having to wait for the
* Supplicant to send EAPOL-Start.
*/
- sta->eapol_sm->reAuthenticate = TRUE;
+ sta->eapol_sm->reAuthenticate = true;
}
eapol_auth_step(sta->eapol_sm);
}
@@ -1415,7 +1415,7 @@ static void ieee802_1x_decapsulate_radius(struct hostapd_data *hapd,
if (!sm || !sm->last_recv_radius) {
if (sm)
- sm->eap_if->aaaEapNoReq = TRUE;
+ sm->eap_if->aaaEapNoReq = true;
return;
}
@@ -1429,7 +1429,7 @@ static void ieee802_1x_decapsulate_radius(struct hostapd_data *hapd,
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
HOSTAPD_LEVEL_WARNING,
"could not extract EAP-Message from RADIUS message");
- sm->eap_if->aaaEapNoReq = TRUE;
+ sm->eap_if->aaaEapNoReq = true;
return;
}
@@ -1438,7 +1438,7 @@ static void ieee802_1x_decapsulate_radius(struct hostapd_data *hapd,
HOSTAPD_LEVEL_WARNING,
"too short EAP packet received from authentication server");
wpabuf_free(eap);
- sm->eap_if->aaaEapNoReq = TRUE;
+ sm->eap_if->aaaEapNoReq = true;
return;
}
@@ -1473,7 +1473,7 @@ static void ieee802_1x_decapsulate_radius(struct hostapd_data *hapd,
"decapsulated EAP packet (code=%d id=%d len=%d) from RADIUS server: %s",
hdr->code, hdr->identifier, be_to_host16(hdr->length),
buf);
- sm->eap_if->aaaEapReq = TRUE;
+ sm->eap_if->aaaEapReq = true;
wpabuf_free(sm->eap_if->aaaEapReqData);
sm->eap_if->aaaEapReqData = eap;
@@ -1512,7 +1512,7 @@ static void ieee802_1x_get_keys(struct hostapd_data *hapd,
os_memcpy(sm->eap_if->aaaEapKeyData + keys->recv_len,
keys->send, keys->send_len);
sm->eap_if->aaaEapKeyDataLen = len;
- sm->eap_if->aaaEapKeyAvailable = TRUE;
+ sm->eap_if->aaaEapKeyAvailable = true;
}
} else {
wpa_printf(MSG_DEBUG,
@@ -1880,7 +1880,7 @@ static int ieee802_1x_update_vlan(struct radius_msg *msg,
if (vlan_desc.notempty &&
!hostapd_vlan_valid(hapd->conf->vlan, &vlan_desc)) {
- sta->eapol_sm->authFail = TRUE;
+ sta->eapol_sm->authFail = true;
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
HOSTAPD_LEVEL_INFO,
"Invalid VLAN %d%s received from RADIUS server",
@@ -1893,7 +1893,7 @@ static int ieee802_1x_update_vlan(struct radius_msg *msg,
if (hapd->conf->ssid.dynamic_vlan == DYNAMIC_VLAN_REQUIRED &&
!vlan_desc.notempty) {
- sta->eapol_sm->authFail = TRUE;
+ sta->eapol_sm->authFail = true;
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
HOSTAPD_LEVEL_INFO,
"authentication server did not include required VLAN ID in Access-Accept");
@@ -2019,7 +2019,7 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
else
ap_sta_no_session_timeout(hapd, sta);
- sm->eap_if->aaaSuccess = TRUE;
+ sm->eap_if->aaaSuccess = true;
override_eapReq = 1;
ieee802_1x_get_keys(hapd, sta, msg, req, shared_secret,
shared_secret_len);
@@ -2031,7 +2031,7 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
(int) session_timeout : -1);
break;
case RADIUS_CODE_ACCESS_REJECT:
- sm->eap_if->aaaFail = TRUE;
+ sm->eap_if->aaaFail = true;
override_eapReq = 1;
if (radius_msg_get_attr_int32(msg, RADIUS_ATTR_WLAN_REASON_CODE,
&reason_code) == 0) {
@@ -2042,7 +2042,7 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
}
break;
case RADIUS_CODE_ACCESS_CHALLENGE:
- sm->eap_if->aaaEapReq = TRUE;
+ sm->eap_if->aaaEapReq = true;
if (session_timeout_set) {
/* RFC 2869, Ch. 2.3.2; RFC 3580, Ch. 3.17 */
sm->eap_if->aaaMethodTimeout = session_timeout;
@@ -2063,7 +2063,7 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
ieee802_1x_decapsulate_radius(hapd, sta);
if (override_eapReq)
- sm->eap_if->aaaEapReq = FALSE;
+ sm->eap_if->aaaEapReq = false;
#ifdef CONFIG_FILS
#ifdef NEED_AP_MLME
@@ -2109,7 +2109,7 @@ void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta)
wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "EAP Timeout, STA " MACSTR,
MAC2STR(sta->addr));
- sm->eap_if->portEnabled = FALSE;
+ sm->eap_if->portEnabled = false;
ap_sta_disconnect(hapd, sta, sta->addr,
WLAN_REASON_PREV_AUTH_NOT_VALID);
}
@@ -2148,7 +2148,7 @@ static int ieee802_1x_sta_key_available(struct hostapd_data *hapd,
struct sta_info *sta, void *ctx)
{
if (sta->eapol_sm) {
- sta->eapol_sm->eap_if->eapKeyAvailable = TRUE;
+ sta->eapol_sm->eap_if->eapKeyAvailable = true;
eapol_auth_step(sta->eapol_sm);
}
return 0;
@@ -2677,26 +2677,25 @@ const u8 * ieee802_1x_get_session_id(struct eapol_state_machine *sm,
void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm,
- int enabled)
+ bool enabled)
{
if (!sm)
return;
- sm->eap_if->portEnabled = enabled ? TRUE : FALSE;
+ sm->eap_if->portEnabled = enabled;
eapol_auth_step(sm);
}
-void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm,
- int valid)
+void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm, bool valid)
{
if (!sm)
return;
- sm->portValid = valid ? TRUE : FALSE;
+ sm->portValid = valid;
eapol_auth_step(sm);
}
-void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth)
+void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, bool pre_auth)
{
if (!sm)
return;
@@ -2707,7 +2706,7 @@ void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth)
}
-static const char * bool_txt(Boolean val)
+static const char * bool_txt(bool val)
{
return val ? "TRUE" : "FALSE";
}
diff --git a/src/ap/ieee802_1x.h b/src/ap/ieee802_1x.h
index bb85b93..70dc11a 100644
--- a/src/ap/ieee802_1x.h
+++ b/src/ap/ieee802_1x.h
@@ -42,10 +42,9 @@ const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len);
const u8 * ieee802_1x_get_session_id(struct eapol_state_machine *sm,
size_t *len);
void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm,
- int enabled);
-void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm,
- int valid);
-void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth);
+ bool enabled);
+void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm, bool valid);
+void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, bool pre_auth);
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
char *buf, size_t buflen);
diff --git a/src/eapol_auth/eapol_auth_sm.c b/src/eapol_auth/eapol_auth_sm.c
index 2e79614..e3a57e7 100644
--- a/src/eapol_auth/eapol_auth_sm.c
+++ b/src/eapol_auth/eapol_auth_sm.c
@@ -206,10 +206,10 @@ SM_STATE(AUTH_PAE, INITIALIZE)
* get here on disconnection event without advancing to the
* AUTHENTICATING state to clear keyRun before the IEEE 802.11 RSN
* authenticator state machine runs and that may advance from
- * AUTHENTICATION2 to INITPMK if keyRun = TRUE has been left from the
+ * AUTHENTICATION2 to INITPMK if keyRun = true has been left from the
* last association. This can be avoided by clearing keyRun here.
*/
- sm->keyRun = FALSE;
+ sm->keyRun = false;
}
@@ -229,7 +229,7 @@ SM_STATE(AUTH_PAE, DISCONNECTED)
sm->authPortStatus = Unauthorized;
setPortUnauthorized();
sm->reAuthCount = 0;
- sm->eapolLogoff = FALSE;
+ sm->eapolLogoff = false;
if (!from_initialize) {
sm->eapol->cb.finished(sm->eapol->conf.ctx, sm->sta, 0,
sm->flags & EAPOL_SM_PREAUTH,
@@ -251,7 +251,7 @@ SM_STATE(AUTH_PAE, RESTART)
SM_ENTRY_MA(AUTH_PAE, RESTART, auth_pae);
- sm->eap_if->eapRestart = TRUE;
+ sm->eap_if->eapRestart = true;
}
@@ -262,7 +262,7 @@ SM_STATE(AUTH_PAE, CONNECTING)
SM_ENTRY_MA(AUTH_PAE, CONNECTING, auth_pae);
- sm->reAuthenticate = FALSE;
+ sm->reAuthenticate = false;
sm->reAuthCount++;
}
@@ -277,7 +277,7 @@ SM_STATE(AUTH_PAE, HELD)
sm->authPortStatus = Unauthorized;
setPortUnauthorized();
sm->quietWhile = sm->quietPeriod;
- sm->eapolLogoff = FALSE;
+ sm->eapolLogoff = false;
eapol_auth_vlogger(sm->eapol, sm->addr, EAPOL_LOGGER_WARNING,
"authentication failed - EAP type: %d (%s)",
@@ -324,13 +324,13 @@ SM_STATE(AUTH_PAE, AUTHENTICATING)
{
SM_ENTRY_MA(AUTH_PAE, AUTHENTICATING, auth_pae);
- sm->eapolStart = FALSE;
- sm->authSuccess = FALSE;
- sm->authFail = FALSE;
- sm->authTimeout = FALSE;
- sm->authStart = TRUE;
- sm->keyRun = FALSE;
- sm->keyDone = FALSE;
+ sm->eapolStart = false;
+ sm->authSuccess = false;
+ sm->authFail = false;
+ sm->authTimeout = false;
+ sm->authStart = true;
+ sm->keyRun = false;
+ sm->keyDone = false;
}
@@ -347,9 +347,9 @@ SM_STATE(AUTH_PAE, ABORTING)
SM_ENTRY_MA(AUTH_PAE, ABORTING, auth_pae);
- sm->authAbort = TRUE;
- sm->keyRun = FALSE;
- sm->keyDone = FALSE;
+ sm->authAbort = true;
+ sm->keyRun = false;
+ sm->keyDone = false;
}
@@ -360,7 +360,7 @@ SM_STATE(AUTH_PAE, FORCE_AUTH)
sm->authPortStatus = Authorized;
setPortAuthorized();
sm->portMode = ForceAuthorized;
- sm->eapolStart = FALSE;
+ sm->eapolStart = false;
txCannedSuccess();
}
@@ -372,7 +372,7 @@ SM_STATE(AUTH_PAE, FORCE_UNAUTH)
sm->authPortStatus = Unauthorized;
setPortUnauthorized();
sm->portMode = ForceUnauthorized;
- sm->eapolStart = FALSE;
+ sm->eapolStart = false;
txCannedFail();
}
@@ -457,8 +457,8 @@ SM_STATE(BE_AUTH, INITIALIZE)
SM_ENTRY_MA(BE_AUTH, INITIALIZE, be_auth);
abortAuth();
- sm->eap_if->eapNoReq = FALSE;
- sm->authAbort = FALSE;
+ sm->eap_if->eapNoReq = false;
+ sm->authAbort = false;
}
@@ -467,7 +467,7 @@ SM_STATE(BE_AUTH, REQUEST)
SM_ENTRY_MA(BE_AUTH, REQUEST, be_auth);
txReq();
- sm->eap_if->eapReq = FALSE;
+ sm->eap_if->eapReq = false;
sm->backendOtherRequestsToSupplicant++;
/*
@@ -481,7 +481,7 @@ SM_STATE(BE_AUTH, REQUEST)
* EAP-Request from the main EAP method. This can be avoided by
* clearing eapolEap here.
*/
- sm->eapolEap = FALSE;
+ sm->eapolEap = false;
}
@@ -489,11 +489,11 @@ SM_STATE(BE_AUTH, RESPONSE)
{
SM_ENTRY_MA(BE_AUTH, RESPONSE, be_auth);
- sm->authTimeout = FALSE;
- sm->eapolEap = FALSE;
- sm->eap_if->eapNoReq = FALSE;
+ sm->authTimeout = false;
+ sm->eapolEap = false;
+ sm->eap_if->eapNoReq = false;
sm->aWhile = sm->serverTimeout;
- sm->eap_if->eapResp = TRUE;
+ sm->eap_if->eapResp = true;
/* sendRespToServer(); */
sm->backendResponses++;
}
@@ -504,8 +504,8 @@ SM_STATE(BE_AUTH, SUCCESS)
SM_ENTRY_MA(BE_AUTH, SUCCESS, be_auth);
txReq();
- sm->authSuccess = TRUE;
- sm->keyRun = TRUE;
+ sm->authSuccess = true;
+ sm->keyRun = true;
}
@@ -514,7 +514,7 @@ SM_STATE(BE_AUTH, FAIL)
SM_ENTRY_MA(BE_AUTH, FAIL, be_auth);
txReq();
- sm->authFail = TRUE;
+ sm->authFail = true;
}
@@ -522,7 +522,7 @@ SM_STATE(BE_AUTH, TIMEOUT)
{
SM_ENTRY_MA(BE_AUTH, TIMEOUT, be_auth);
- sm->authTimeout = TRUE;
+ sm->authTimeout = true;
}
@@ -530,7 +530,7 @@ SM_STATE(BE_AUTH, IDLE)
{
SM_ENTRY_MA(BE_AUTH, IDLE, be_auth);
- sm->authStart = FALSE;
+ sm->authStart = false;
}
@@ -538,7 +538,7 @@ SM_STATE(BE_AUTH, IGNORE)
{
SM_ENTRY_MA(BE_AUTH, IGNORE, be_auth);
- sm->eap_if->eapNoReq = FALSE;
+ sm->eap_if->eapNoReq = false;
}
@@ -621,7 +621,7 @@ SM_STATE(REAUTH_TIMER, REAUTHENTICATE)
{
SM_ENTRY_MA(REAUTH_TIMER, REAUTHENTICATE, reauth_timer);
- sm->reAuthenticate = TRUE;
+ sm->reAuthenticate = true;
sm->eapol->cb.eapol_event(sm->eapol->conf.ctx, sm->sta,
EAPOL_AUTH_REAUTHENTICATE);
}
@@ -663,8 +663,8 @@ SM_STATE(AUTH_KEY_TX, KEY_TRANSMIT)
SM_ENTRY_MA(AUTH_KEY_TX, KEY_TRANSMIT, auth_key_tx);
txKey();
- sm->eap_if->eapKeyAvailable = FALSE;
- sm->keyDone = TRUE;
+ sm->eap_if->eapKeyAvailable = false;
+ sm->keyDone = true;
}
@@ -705,7 +705,7 @@ SM_STATE(KEY_RX, KEY_RECEIVE)
SM_ENTRY_MA(KEY_RX, KEY_RECEIVE, key_rx);
processKey();
- sm->rxKey = FALSE;
+ sm->rxKey = false;
}
@@ -807,7 +807,7 @@ eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
sm->reauth_timer_state = REAUTH_TIMER_INITIALIZE;
sm->reAuthPeriod = eapol->conf.eap_reauth_period;
- sm->reAuthEnabled = eapol->conf.eap_reauth_period > 0 ? TRUE : FALSE;
+ sm->reAuthEnabled = eapol->conf.eap_reauth_period > 0;
sm->auth_key_tx_state = AUTH_KEY_TX_NO_KEY_TRANSMIT;
@@ -820,14 +820,14 @@ eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
#ifdef CONFIG_WEP
if (!eapol->conf.wpa &&
(eapol->default_wep_key || eapol->conf.individual_wep_key_len > 0))
- sm->keyTxEnabled = TRUE;
+ sm->keyTxEnabled = true;
else
#endif /* CONFIG_WEP */
- sm->keyTxEnabled = FALSE;
+ sm->keyTxEnabled = false;
if (eapol->conf.wpa)
- sm->portValid = FALSE;
+ sm->portValid = false;
else
- sm->portValid = TRUE;
+ sm->portValid = true;
os_memset(&eap_sess, 0, sizeof(eap_sess));
eap_sess.assoc_wps_ie = assoc_wps_ie;
@@ -949,7 +949,7 @@ restart:
/* TODO: find a better location for this */
if (sm->eap_if->aaaEapResp) {
- sm->eap_if->aaaEapResp = FALSE;
+ sm->eap_if->aaaEapResp = false;
if (sm->eap_if->aaaEapRespData == NULL) {
wpa_printf(MSG_DEBUG, "EAPOL: aaaEapResp set, "
"but no aaaEapRespData available");
@@ -996,14 +996,14 @@ void eapol_auth_step(struct eapol_state_machine *sm)
static void eapol_auth_initialize(struct eapol_state_machine *sm)
{
- sm->initializing = TRUE;
+ sm->initializing = true;
/* Initialize the state machines by asserting initialize and then
* deasserting it after one step */
- sm->initialize = TRUE;
+ sm->initialize = true;
eapol_sm_step_run(sm);
- sm->initialize = FALSE;
+ sm->initialize = false;
eapol_sm_step_run(sm);
- sm->initializing = FALSE;
+ sm->initializing = false;
/* Start one second tick for port timers state machine */
eloop_cancel_timeout(eapol_port_timers_tick, NULL, sm);
@@ -1091,7 +1091,7 @@ void eapol_auth_reauthenticate(struct eapol_state_machine *sm)
{
wpa_printf(MSG_DEBUG, "EAPOL: External reauthentication trigger for "
MACSTR, MAC2STR(sm->addr));
- sm->reAuthenticate = TRUE;
+ sm->reAuthenticate = true;
eapol_auth_step(sm);
}
@@ -1144,9 +1144,9 @@ int eapol_auth_set_conf(struct eapol_state_machine *sm, const char *param,
if (os_strcasecmp(param, "reAuthEnabled") == 0) {
if (os_strcmp(value, "TRUE") == 0)
- sm->reAuthEnabled = TRUE;
+ sm->reAuthEnabled = true;
else if (os_strcmp(value, "FALSE") == 0)
- sm->reAuthEnabled = FALSE;
+ sm->reAuthEnabled = false;
else
return -1;
eapol_auth_step(sm);
@@ -1155,9 +1155,9 @@ int eapol_auth_set_conf(struct eapol_state_machine *sm, const char *param,
if (os_strcasecmp(param, "KeyTransmissionEnabled") == 0) {
if (os_strcmp(value, "TRUE") == 0)
- sm->keyTxEnabled = TRUE;
+ sm->keyTxEnabled = true;
else if (os_strcmp(value, "FALSE") == 0)
- sm->keyTxEnabled = FALSE;
+ sm->keyTxEnabled = false;
else
return -1;
eapol_auth_step(sm);
diff --git a/src/eapol_auth/eapol_auth_sm_i.h b/src/eapol_auth/eapol_auth_sm_i.h
index 04386b2..3c68983 100644
--- a/src/eapol_auth/eapol_auth_sm_i.h
+++ b/src/eapol_auth/eapol_auth_sm_i.h
@@ -43,23 +43,23 @@ struct eapol_state_machine {
int reAuthWhen;
/* global variables */
- Boolean authAbort;
- Boolean authFail;
+ bool authAbort;
+ bool authFail;
PortState authPortStatus;
- Boolean authStart;
- Boolean authTimeout;
- Boolean authSuccess;
- Boolean eapolEap;
- Boolean initialize;
- Boolean keyDone;
- Boolean keyRun;
- Boolean keyTxEnabled;
+ bool authStart;
+ bool authTimeout;
+ bool authSuccess;
+ bool eapolEap;
+ bool initialize;
+ bool keyDone;
+ bool keyRun;
+ bool keyTxEnabled;
PortTypes portControl;
- Boolean portValid;
- Boolean reAuthenticate;
+ bool portValid;
+ bool reAuthenticate;
/* Port Timers state machine */
- /* 'Boolean tick' implicitly handled as registered timeout */
+ /* 'bool tick' implicitly handled as registered timeout */
/* Authenticator PAE state machine */
enum { AUTH_PAE_INITIALIZE, AUTH_PAE_DISCONNECTED, AUTH_PAE_CONNECTING,
@@ -67,8 +67,8 @@ struct eapol_state_machine {
AUTH_PAE_ABORTING, AUTH_PAE_HELD, AUTH_PAE_FORCE_AUTH,
AUTH_PAE_FORCE_UNAUTH, AUTH_PAE_RESTART } auth_pae_state;
/* variables */
- Boolean eapolLogoff;
- Boolean eapolStart;
+ bool eapolLogoff;
+ bool eapolStart;
PortTypes portMode;
unsigned int reAuthCount;
/* constants */
@@ -109,7 +109,7 @@ struct eapol_state_machine {
} reauth_timer_state;
/* constants */
unsigned int reAuthPeriod; /* default 3600 s */
- Boolean reAuthEnabled;
+ bool reAuthEnabled;
/* Authenticator Key Transmit state machine */
enum { AUTH_KEY_TX_NO_KEY_TRANSMIT, AUTH_KEY_TX_KEY_TRANSMIT
@@ -118,14 +118,14 @@ struct eapol_state_machine {
/* Key Receive state machine */
enum { KEY_RX_NO_KEY_RECEIVE, KEY_RX_KEY_RECEIVE } key_rx_state;
/* variables */
- Boolean rxKey;
+ bool rxKey;
/* Controlled Directions state machine */
enum { CTRL_DIR_FORCE_BOTH, CTRL_DIR_IN_OR_BOTH } ctrl_dir_state;
/* variables */
ControlledDirection adminControlledDirections;
ControlledDirection operControlledDirections;
- Boolean operEdge;
+ bool operEdge;
/* Authenticator Statistics Table */
Counter dot1xAuthEapolFramesRx;
@@ -161,8 +161,8 @@ struct eapol_state_machine {
struct eap_sm *eap;
- Boolean initializing; /* in process of initializing state machines */
- Boolean changed;
+ bool initializing; /* in process of initializing state machines */
+ bool changed;
struct eapol_authenticator *eapol;