Add a return value to prf_t.allocate_bytes()

This commit is contained in:
Martin Willi
2012-07-16 14:53:34 +02:00
parent a7e6539135
commit ecc080b393
9 changed files with 92 additions and 43 deletions
+6 -3
View File
@@ -847,7 +847,10 @@ METHOD(crypto_tester_t, test_prf, bool,
/* allocated bytes */
seed = chunk_create(vector->seed, vector->len);
prf->allocate_bytes(prf, seed, &out);
if (!prf->allocate_bytes(prf, seed, &out))
{
failed = TRUE;
}
if (out.len != prf->get_block_size(prf))
{
failed = TRUE;
@@ -878,8 +881,8 @@ METHOD(crypto_tester_t, test_prf, bool,
{
prf->set_key(prf, key);
}
prf->allocate_bytes(prf, chunk_create(seed.ptr, 1), NULL);
if (!prf->get_bytes(prf, chunk_create(seed.ptr + 1, 1), NULL) ||
if (!prf->allocate_bytes(prf, chunk_create(seed.ptr, 1), NULL) ||
!prf->get_bytes(prf, chunk_create(seed.ptr + 1, 1), NULL) ||
!prf->get_bytes(prf, chunk_skip(seed, 2), out.ptr))
{
failed = TRUE;