aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server/eap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eap_server/eap.c')
-rw-r--r--src/eap_server/eap.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/eap_server/eap.c b/src/eap_server/eap.c
index 04a78a5..567ecec 100644
--- a/src/eap_server/eap.c
+++ b/src/eap_server/eap.c
@@ -127,7 +127,7 @@ SM_STATE(EAP, INITIALIZE)
sm->eap_if.eapSuccess = FALSE;
sm->eap_if.eapFail = FALSE;
sm->eap_if.eapTimeout = FALSE;
- free(sm->eap_if.eapKeyData);
+ os_free(sm->eap_if.eapKeyData);
sm->eap_if.eapKeyData = NULL;
sm->eap_if.eapKeyDataLen = 0;
sm->eap_if.eapKeyAvailable = FALSE;
@@ -276,7 +276,7 @@ SM_STATE(EAP, METHOD_REQUEST)
wpa_printf(MSG_DEBUG, "EAP: building EAP-Request: Identifier %d",
sm->currentId);
sm->lastId = sm->currentId;
- free(sm->eap_if.eapReqData);
+ os_free(sm->eap_if.eapReqData);
sm->eap_if.eapReqData = sm->m->buildReq(sm, sm->eap_method_priv,
sm->currentId,
&sm->eap_if.eapReqDataLen);
@@ -295,7 +295,7 @@ SM_STATE(EAP, METHOD_RESPONSE)
sm->eap_if.eapRespDataLen);
if (sm->m->isDone(sm, sm->eap_method_priv)) {
eap_sm_Policy_update(sm, NULL, 0);
- free(sm->eap_if.eapKeyData);
+ os_free(sm->eap_if.eapKeyData);
if (sm->m->getKey) {
sm->eap_if.eapKeyData = sm->m->getKey(
sm, sm->eap_method_priv,
@@ -396,10 +396,10 @@ SM_STATE(EAP, FAILURE)
{
SM_ENTRY(EAP, FAILURE);
- free(sm->eap_if.eapReqData);
+ os_free(sm->eap_if.eapReqData);
sm->eap_if.eapReqData = eap_sm_buildFailure(sm, sm->currentId,
&sm->eap_if.eapReqDataLen);
- free(sm->lastReqData);
+ os_free(sm->lastReqData);
sm->lastReqData = NULL;
sm->lastReqDataLen = 0;
sm->eap_if.eapFail = TRUE;
@@ -410,10 +410,10 @@ SM_STATE(EAP, SUCCESS)
{
SM_ENTRY(EAP, SUCCESS);
- free(sm->eap_if.eapReqData);
+ os_free(sm->eap_if.eapReqData);
sm->eap_if.eapReqData = eap_sm_buildSuccess(sm, sm->currentId,
&sm->eap_if.eapReqDataLen);
- free(sm->lastReqData);
+ os_free(sm->lastReqData);
sm->lastReqData = NULL;
sm->lastReqDataLen = 0;
if (sm->eap_if.eapKeyData)
@@ -870,7 +870,7 @@ static u8 * eap_sm_buildSuccess(struct eap_sm *sm, int id, size_t *len)
wpa_printf(MSG_DEBUG, "EAP: Building EAP-Success (id=%d)", id);
*len = sizeof(*resp);
- resp = malloc(*len);
+ resp = os_malloc(*len);
if (resp == NULL)
return NULL;
resp->code = EAP_CODE_SUCCESS;
@@ -887,7 +887,7 @@ static u8 * eap_sm_buildFailure(struct eap_sm *sm, int id, size_t *len)
wpa_printf(MSG_DEBUG, "EAP: Building EAP-Failure (id=%d)", id);
*len = sizeof(*resp);
- resp = malloc(*len);
+ resp = os_malloc(*len);
if (resp == NULL)
return NULL;
resp->code = EAP_CODE_FAILURE;
@@ -957,9 +957,9 @@ void eap_sm_process_nak(struct eap_sm *sm, u8 *nak_list, size_t len)
not_found:
/* not found - remove from the list */
- memmove(&sm->user->methods[i], &sm->user->methods[i + 1],
- (EAP_MAX_METHODS - i - 1) *
- sizeof(sm->user->methods[0]));
+ os_memmove(&sm->user->methods[i], &sm->user->methods[i + 1],
+ (EAP_MAX_METHODS - i - 1) *
+ sizeof(sm->user->methods[0]));
sm->user->methods[EAP_MAX_METHODS - 1].vendor =
EAP_VENDOR_IETF;
sm->user->methods[EAP_MAX_METHODS - 1].method = EAP_TYPE_NONE;
@@ -1105,9 +1105,9 @@ static void eap_user_free(struct eap_user *user)
{
if (user == NULL)
return;
- free(user->password);
+ os_free(user->password);
user->password = NULL;
- free(user);
+ os_free(user);
}
@@ -1144,7 +1144,7 @@ struct eap_sm * eap_server_sm_init(void *eapol_ctx,
}
}
if (conf->eap_fast_a_id)
- sm->eap_fast_a_id = strdup(conf->eap_fast_a_id);
+ sm->eap_fast_a_id = os_strdup(conf->eap_fast_a_id);
wpa_printf(MSG_DEBUG, "EAP: Server state machine created");
@@ -1166,18 +1166,18 @@ void eap_server_sm_deinit(struct eap_sm *sm)
wpa_printf(MSG_DEBUG, "EAP: Server state machine removed");
if (sm->m && sm->eap_method_priv)
sm->m->reset(sm, sm->eap_method_priv);
- free(sm->eap_if.eapReqData);
- free(sm->eap_if.eapKeyData);
- free(sm->lastReqData);
- free(sm->eap_if.eapRespData);
- free(sm->identity);
- free(sm->pac_opaque_encr_key);
- free(sm->eap_fast_a_id);
- free(sm->eap_if.aaaEapReqData);
- free(sm->eap_if.aaaEapRespData);
- free(sm->eap_if.aaaEapKeyData);
+ os_free(sm->eap_if.eapReqData);
+ os_free(sm->eap_if.eapKeyData);
+ os_free(sm->lastReqData);
+ os_free(sm->eap_if.eapRespData);
+ os_free(sm->identity);
+ os_free(sm->pac_opaque_encr_key);
+ os_free(sm->eap_fast_a_id);
+ os_free(sm->eap_if.aaaEapReqData);
+ os_free(sm->eap_if.aaaEapRespData);
+ os_free(sm->eap_if.aaaEapKeyData);
eap_user_free(sm->user);
- free(sm);
+ os_free(sm);
}