enumerator_t *enumerator;
int type;
chunk_t data, msg;
+ bool has_eap = FALSE, has_auth = FALSE;
/* replace Response by Request Authenticator for verification */
memcpy(res_auth, this->msg->authenticator, HASH_SIZE_MD5);
memset(data.ptr, 0, data.len);
if (signer->verify_signature(signer, msg,
chunk_create(buf, sizeof(buf))))
- { /* good, restore Authenticators */
- memcpy(this->msg->authenticator, res_auth, HASH_SIZE_MD5);
+ {
+ /* restore Message-Authenticator */
memcpy(data.ptr, buf, data.len);
- enumerator->destroy(enumerator);
- return TRUE;
+ has_auth = TRUE;
+ break;
}
else
{
return FALSE;
}
}
+ else if (type == RAT_EAP_MESSAGE)
+ {
+ has_eap = TRUE;
+ }
}
enumerator->destroy(enumerator);
- DBG1(DBG_CFG, "RADIUS Message-Authenticator attribute missing");
- return FALSE;
+ /* restore Response-Authenticator */
+ memcpy(this->msg->authenticator, res_auth, HASH_SIZE_MD5);
+
+ if (has_eap && !has_auth)
+ { /* Message-Authenticator is required if we have an EAP-Message */
+ DBG1(DBG_CFG, "RADIUS Message-Authenticator attribute missing");
+ return FALSE;
+ }
+ return TRUE;
}
/**