diff options
Diffstat (limited to 'src/libstrongswan/crypto/crypto_tester.c')
-rw-r--r-- | src/libstrongswan/crypto/crypto_tester.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 469059371..8398bc80b 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -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; |