Fixed RNG crypto tester

This commit is contained in:
Tobias Brunner 2012-09-28 19:13:40 +02:00
parent 3973ffa4f6
commit 91a8dc2dec
1 changed files with 9 additions and 11 deletions

View File

@ -1075,17 +1075,15 @@ METHOD(crypto_tester_t, test_rng, bool,
{
goto failure;
}
if (!failed)
{ /* write bytes into existing buffer */
memset(data.ptr, 0, data.len);
if (!rng->get_bytes(rng, vector->len, data.ptr))
{
goto failure;
}
if (!vector->test(vector->user, data))
{
goto failure;
}
/* write bytes into existing buffer */
memset(data.ptr, 0, data.len);
if (!rng->get_bytes(rng, vector->len, data.ptr))
{
goto failure;
}
if (!vector->test(vector->user, data))
{
goto failure;
}
failed = FALSE;