Check rng return value when generating RAND in eap-aka-3gpp2 plugin

This commit is contained in:
Tobias Brunner 2012-06-25 15:58:50 +02:00 committed by Martin Willi
parent 162f489a27
commit 10b6ca5fb2
1 changed files with 2 additions and 2 deletions

View File

@ -90,12 +90,12 @@ METHOD(simaka_provider_t, get_quintuplet, bool,
/* generate RAND: we use a registered RNG, not f0() proposed in S.S0055 */
rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK);
if (!rng)
if (!rng || !rng->get_bytes(rng, AKA_RAND_LEN, rand))
{
DBG1(DBG_IKE, "generating RAND for AKA failed");
DESTROY_IF(rng);
return FALSE;
}
rng->get_bytes(rng, AKA_RAND_LEN, rand);
rng->destroy(rng);
if (!eap_aka_3gpp2_get_k(id, k))