utils: Use chunk_equals_const() for all cryptographic purposes
This commit is contained in:
@@ -425,7 +425,7 @@ static status_t process_challenge(private_eap_aka_server_t *this,
|
||||
enumerator->destroy(enumerator);
|
||||
|
||||
/* compare received RES against stored XRES */
|
||||
if (!chunk_equals(res, this->xres))
|
||||
if (!chunk_equals_const(res, this->xres))
|
||||
{
|
||||
DBG1(DBG_IKE, "received RES does not match XRES");
|
||||
return FAILED;
|
||||
@@ -486,7 +486,7 @@ static status_t process_reauthentication(private_eap_aka_server_t *this,
|
||||
this->crypto->clear_keys(this->crypto);
|
||||
return challenge(this, out);
|
||||
}
|
||||
if (!chunk_equals(counter, this->counter))
|
||||
if (!chunk_equals_const(counter, this->counter))
|
||||
{
|
||||
DBG1(DBG_IKE, "received counter does not match");
|
||||
return FAILED;
|
||||
@@ -730,4 +730,3 @@ eap_aka_server_t *eap_aka_server_create(identification_t *server,
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
|
||||
@@ -812,7 +812,7 @@ static status_t process_peer_success(private_eap_mschapv2_t *this,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!chunk_equals(this->auth_response, auth_string))
|
||||
if (!chunk_equals_const(this->auth_response, auth_string))
|
||||
{
|
||||
DBG1(DBG_IKE, "EAP-MS-CHAPv2 verification failed");
|
||||
goto error;
|
||||
|
||||
@@ -262,7 +262,7 @@ static status_t process_reauthentication(private_eap_sim_server_t *this,
|
||||
this->crypto->clear_keys(this->crypto);
|
||||
return initiate(this, out);
|
||||
}
|
||||
if (!chunk_equals(counter, this->counter))
|
||||
if (!chunk_equals_const(counter, this->counter))
|
||||
{
|
||||
DBG1(DBG_IKE, "received counter does not match");
|
||||
return FAILED;
|
||||
@@ -644,4 +644,3 @@ eap_sim_server_t *eap_sim_server_create(identification_t *server,
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ METHOD(xauth_method_t, process_server, status_t,
|
||||
SHARED_EAP, this->server, this->peer);
|
||||
while (enumerator->enumerate(enumerator, &shared, NULL, NULL))
|
||||
{
|
||||
if (chunk_equals(shared->get_key(shared), pass))
|
||||
if (chunk_equals_const(shared->get_key(shared), pass))
|
||||
{
|
||||
status = SUCCESS;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user