Check rng return value when generating nonces in eap-aka plugin

This commit is contained in:
Tobias Brunner 2012-07-06 10:09:25 +02:00 committed by Martin Willi
parent 18ce1bb721
commit 8beeb8e116
1 changed files with 4 additions and 1 deletions

View File

@ -249,7 +249,10 @@ static status_t reauthenticate(private_eap_aka_server_t *this,
DBG1(DBG_IKE, "initiating EAP-AKA reauthentication");
rng = this->crypto->get_rng(this->crypto);
rng->allocate_bytes(rng, NONCE_LEN, &this->nonce);
if (!rng->allocate_bytes(rng, NONCE_LEN, &this->nonce))
{
return FAILED;
}
mkc = chunk_create(mk, HASH_SIZE_SHA1);
counter = htons(counter);