Check rng return value when seeding OpenSSL RNG

This commit is contained in:
Tobias Brunner
2012-07-16 14:53:36 +02:00
committed by Martin Willi
parent 1f5291b1ce
commit 99dc3d2c15
@@ -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);