diff options
author | Martin Willi <martin@revosec.ch> | 2012-07-06 16:11:15 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-07-16 14:53:38 +0200 |
commit | 3b96189a2afa4949e1d9cdf7c9fa8244d8d817f0 (patch) | |
tree | 16564618b94304c2bca7e925fc9e6693b6226161 /src/libstrongswan/crypto/crypto_tester.c | |
parent | e35abbe588636c5ca73d8aaa9082314289346bd9 (diff) | |
download | strongswan-3b96189a2afa4949e1d9cdf7c9fa8244d8d817f0.tar.bz2 strongswan-3b96189a2afa4949e1d9cdf7c9fa8244d8d817f0.tar.xz |
Add a return value to crypter_t.decrypt()
Diffstat (limited to 'src/libstrongswan/crypto/crypto_tester.c')
-rw-r--r-- | src/libstrongswan/crypto/crypto_tester.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 287c12ced..812e94914 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -164,8 +164,10 @@ static u_int bench_crypter(private_crypto_tester_t *this, { runs++; } - crypter->decrypt(crypter, buf, chunk_from_thing(iv), NULL); - runs++; + if (crypter->decrypt(crypter, buf, chunk_from_thing(iv), NULL)) + { + runs++; + } } free(buf.ptr); crypter->destroy(crypter); @@ -226,7 +228,10 @@ METHOD(crypto_tester_t, test_crypter, bool, failed = TRUE; } /* inline decryption */ - crypter->decrypt(crypter, cipher, iv, NULL); + if (!crypter->decrypt(crypter, cipher, iv, NULL)) + { + failed = TRUE; + } if (!memeq(vector->plain, cipher.ptr, cipher.len)) { failed = TRUE; @@ -234,7 +239,10 @@ METHOD(crypto_tester_t, test_crypter, bool, free(cipher.ptr); /* allocated decryption */ cipher = chunk_create(vector->cipher, vector->len); - crypter->decrypt(crypter, cipher, iv, &plain); + if (!crypter->decrypt(crypter, cipher, iv, &plain)) + { + failed = TRUE; + } if (!memeq(vector->plain, plain.ptr, plain.len)) { failed = TRUE; |