Check rng return value when seeding OpenSSL RNG
This commit is contained in:
committed by
Martin Willi
parent
1f5291b1ce
commit
99dc3d2c15
@@ -174,7 +174,11 @@ static bool seed_rng()
|
|||||||
return FALSE;
|
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));
|
RAND_seed(buf, sizeof(buf));
|
||||||
}
|
}
|
||||||
DESTROY_IF(rng);
|
DESTROY_IF(rng);
|
||||||
|
|||||||
Reference in New Issue
Block a user