aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/crypto/crypto_tester.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-07-09 17:15:52 +0200
committerMartin Willi <martin@revosec.ch>2012-07-16 14:55:06 +0200
commit87dd205b61ae8c0125b459959fcc7349fa27bb74 (patch)
treea6c138a105bf40ce5a4b1b60047ed3a76cbe22ca /src/libstrongswan/crypto/crypto_tester.c
parente185612dd8011ca4f3de460640f74e6a652cbf32 (diff)
downloadstrongswan-87dd205b61ae8c0125b459959fcc7349fa27bb74.tar.bz2
strongswan-87dd205b61ae8c0125b459959fcc7349fa27bb74.tar.xz
Add a return value to hasher_t.allocate_hash()
Diffstat (limited to 'src/libstrongswan/crypto/crypto_tester.c')
-rw-r--r--src/libstrongswan/crypto/crypto_tester.c9
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))
{