Test reset() of hasher in crypto tester
authorMartin Willi <martin@revosec.ch>
Tue, 10 Jul 2012 11:19:36 +0000 (13:19 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 16 Jul 2012 12:55:07 +0000 (14:55 +0200)
src/libstrongswan/crypto/crypto_tester.c

index 4fe10e7..a481612 100644 (file)
@@ -746,8 +746,16 @@ METHOD(crypto_tester_t, test_hasher, bool,
                {
                        goto failure;
                }
-               /* hash to existing buffer */
+               /* hash to existing buffer, with a reset */
                memset(hash.ptr, 0, hash.len);
+               if (!hasher->get_hash(hasher, data, NULL))
+               {
+                       goto failure;
+               }
+               if (!hasher->reset(hasher))
+               {
+                       goto failure;
+               }
                if (!hasher->get_hash(hasher, data, hash.ptr))
                {
                        goto failure;