mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
eap_example: Convert Boolean to C99 bool
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
d15e109e29
commit
db81d81451
@ -18,16 +18,16 @@ void eap_example_server_rx(const u8 *data, size_t data_len);
|
|||||||
|
|
||||||
|
|
||||||
struct eap_peer_ctx {
|
struct eap_peer_ctx {
|
||||||
Boolean eapSuccess;
|
bool eapSuccess;
|
||||||
Boolean eapRestart;
|
bool eapRestart;
|
||||||
Boolean eapFail;
|
bool eapFail;
|
||||||
Boolean eapResp;
|
bool eapResp;
|
||||||
Boolean eapNoResp;
|
bool eapNoResp;
|
||||||
Boolean eapReq;
|
bool eapReq;
|
||||||
Boolean portEnabled;
|
bool portEnabled;
|
||||||
Boolean altAccept; /* for EAP */
|
bool altAccept; /* for EAP */
|
||||||
Boolean altReject; /* for EAP */
|
bool altReject; /* for EAP */
|
||||||
Boolean eapTriggerStart;
|
bool eapTriggerStart;
|
||||||
|
|
||||||
struct wpabuf *eapReqData; /* for EAP */
|
struct wpabuf *eapReqData; /* for EAP */
|
||||||
|
|
||||||
@ -48,11 +48,11 @@ static struct eap_peer_config * peer_get_config(void *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Boolean peer_get_bool(void *ctx, enum eapol_bool_var variable)
|
static bool peer_get_bool(void *ctx, enum eapol_bool_var variable)
|
||||||
{
|
{
|
||||||
struct eap_peer_ctx *peer = ctx;
|
struct eap_peer_ctx *peer = ctx;
|
||||||
if (peer == NULL)
|
if (peer == NULL)
|
||||||
return FALSE;
|
return false;
|
||||||
switch (variable) {
|
switch (variable) {
|
||||||
case EAPOL_eapSuccess:
|
case EAPOL_eapSuccess:
|
||||||
return peer->eapSuccess;
|
return peer->eapSuccess;
|
||||||
@ -75,12 +75,11 @@ static Boolean peer_get_bool(void *ctx, enum eapol_bool_var variable)
|
|||||||
case EAPOL_eapTriggerStart:
|
case EAPOL_eapTriggerStart:
|
||||||
return peer->eapTriggerStart;
|
return peer->eapTriggerStart;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void peer_set_bool(void *ctx, enum eapol_bool_var variable,
|
static void peer_set_bool(void *ctx, enum eapol_bool_var variable, bool value)
|
||||||
Boolean value)
|
|
||||||
{
|
{
|
||||||
struct eap_peer_ctx *peer = ctx;
|
struct eap_peer_ctx *peer = ctx;
|
||||||
if (peer == NULL)
|
if (peer == NULL)
|
||||||
@ -319,7 +318,7 @@ int eap_example_peer_init(void)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Enable "port" to allow authentication */
|
/* Enable "port" to allow authentication */
|
||||||
eap_ctx.portEnabled = TRUE;
|
eap_ctx.portEnabled = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -344,7 +343,7 @@ int eap_example_peer_step(void)
|
|||||||
if (eap_ctx.eapResp) {
|
if (eap_ctx.eapResp) {
|
||||||
struct wpabuf *resp;
|
struct wpabuf *resp;
|
||||||
printf("==> Response\n");
|
printf("==> Response\n");
|
||||||
eap_ctx.eapResp = FALSE;
|
eap_ctx.eapResp = false;
|
||||||
resp = eap_get_eapRespData(eap_ctx.eap);
|
resp = eap_get_eapRespData(eap_ctx.eap);
|
||||||
if (resp) {
|
if (resp) {
|
||||||
/* Send EAP response to the server */
|
/* Send EAP response to the server */
|
||||||
@ -372,7 +371,7 @@ int eap_example_peer_step(void)
|
|||||||
void eap_example_peer_rx(const u8 *data, size_t data_len)
|
void eap_example_peer_rx(const u8 *data, size_t data_len)
|
||||||
{
|
{
|
||||||
/* Make received EAP message available to the EAP library */
|
/* Make received EAP message available to the EAP library */
|
||||||
eap_ctx.eapReq = TRUE;
|
eap_ctx.eapReq = true;
|
||||||
wpabuf_free(eap_ctx.eapReqData);
|
wpabuf_free(eap_ctx.eapReqData);
|
||||||
eap_ctx.eapReqData = wpabuf_alloc_copy(data, data_len);
|
eap_ctx.eapReqData = wpabuf_alloc_copy(data, data_len);
|
||||||
}
|
}
|
||||||
|
@ -234,8 +234,8 @@ int eap_example_server_init(void)
|
|||||||
eap_ctx.eap_if = eap_get_interface(eap_ctx.eap);
|
eap_ctx.eap_if = eap_get_interface(eap_ctx.eap);
|
||||||
|
|
||||||
/* Enable "port" and request EAP to start authentication. */
|
/* Enable "port" and request EAP to start authentication. */
|
||||||
eap_ctx.eap_if->portEnabled = TRUE;
|
eap_ctx.eap_if->portEnabled = true;
|
||||||
eap_ctx.eap_if->eapRestart = TRUE;
|
eap_ctx.eap_if->eapRestart = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -296,5 +296,5 @@ void eap_example_server_rx(const u8 *data, size_t data_len)
|
|||||||
wpabuf_free(eap_ctx.eap_if->eapRespData);
|
wpabuf_free(eap_ctx.eap_if->eapRespData);
|
||||||
eap_ctx.eap_if->eapRespData = wpabuf_alloc_copy(data, data_len);
|
eap_ctx.eap_if->eapRespData = wpabuf_alloc_copy(data, data_len);
|
||||||
if (eap_ctx.eap_if->eapRespData)
|
if (eap_ctx.eap_if->eapRespData)
|
||||||
eap_ctx.eap_if->eapResp = TRUE;
|
eap_ctx.eap_if->eapResp = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user