Verify EAP-SIM/AKA AT_MAC before processing any attributes

This commit is contained in:
Martin Willi
2009-11-30 10:00:06 +01:00
parent b04e72c21c
commit bff9f824ed
4 changed files with 24 additions and 36 deletions
+2 -8
View File
@@ -387,8 +387,8 @@ static status_t process_reauthentication(private_eap_sim_peer_t *this,
this->crypto->derive_keys_reauth(this->crypto,
chunk_create(this->mk, HASH_SIZE_SHA1));
/* parse again with decryption key */
if (!in->parse(in))
/* verify MAC and parse again with decryption key */
if (!in->verify(in, chunk_empty) || !in->parse(in))
{
*out = create_client_error(this, in->get_identifier(in),
SIM_UNABLE_TO_PROCESS);
@@ -429,12 +429,6 @@ static status_t process_reauthentication(private_eap_sim_peer_t *this,
SIM_UNABLE_TO_PROCESS);
return NEED_MORE;
}
if (!in->verify(in, chunk_empty))
{
*out = create_client_error(this, in->get_identifier(in),
SIM_UNABLE_TO_PROCESS);
return NEED_MORE;
}
message = simaka_message_create(FALSE, in->get_identifier(in), EAP_SIM,
SIM_REAUTHENTICATION, this->crypto);