Check rng return value when generating SIM/AKA message IVs

This commit is contained in:
Martin Willi 2012-07-06 13:52:57 +02:00
parent 3629740c7f
commit 6a3e4ed916
1 changed files with 4 additions and 1 deletions

View File

@ -771,7 +771,10 @@ METHOD(simaka_message_t, generate, bool,
out = chunk_skip(out, 4);
rng = this->crypto->get_rng(this->crypto);
rng->get_bytes(rng, iv.len, out.ptr);
if (!rng->get_bytes(rng, iv.len, out.ptr))
{
return FALSE;
}
iv = chunk_clonea(chunk_create(out.ptr, iv.len));
out = chunk_skip(out, iv.len);