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 f422a2c19..046222279 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -735,7 +735,10 @@ METHOD(crypto_tester_t, test_hasher, bool, /* allocated hash */ data = chunk_create(vector->data, vector->len); - hasher->allocate_hash(hasher, data, &hash); + if (!hasher->allocate_hash(hasher, data, &hash)) + { + failed = TRUE; + } if (hash.len != hasher->get_hash_size(hasher)) { failed = TRUE; @@ -758,8 +761,8 @@ METHOD(crypto_tester_t, test_hasher, bool, if (data.len > 2) { memset(hash.ptr, 0, hash.len); - hasher->allocate_hash(hasher, chunk_create(data.ptr, 1), NULL); - if (!hasher->get_hash(hasher, chunk_create(data.ptr + 1, 1), NULL) || + if (!hasher->allocate_hash(hasher, chunk_create(data.ptr, 1), NULL) || + !hasher->get_hash(hasher, chunk_create(data.ptr + 1, 1), NULL) || !hasher->get_hash(hasher, chunk_skip(data, 2), hash.ptr) || !memeq(vector->hash, hash.ptr, hash.len)) { |