Check rng return value when seeding OpenSSL RNG

This commit is contained in:
Tobias Brunner authored and Martin Willi committed 2012-07-16 14:53:36 +02:00
1 parent 1f5291b1ce
commit 99dc3d2c15
1 file changed
+5 -1
@@ -174,7 +174,11 @@ static bool seed_rng()
return FALSE;
}
}
rng->get_bytes(rng, sizeof(buf), buf);
if (!rng->get_bytes(rng, sizeof(buf), buf))
{
rng->destroy(rng);
return FALSE;
}
RAND_seed(buf, sizeof(buf));
}
DESTROY_IF(rng);