aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/crypto/crypto_tester.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/crypto/crypto_tester.c')
-rw-r--r--src/libstrongswan/crypto/crypto_tester.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c
index 756aa71f8..b97855325 100644
--- a/src/libstrongswan/crypto/crypto_tester.c
+++ b/src/libstrongswan/crypto/crypto_tester.c
@@ -488,7 +488,10 @@ static u_int bench_signer(private_crypto_tester_t *this,
u_int runs;
memset(key, 0x12, sizeof(key));
- signer->set_key(signer, chunk_from_thing(key));
+ if (!signer->set_key(signer, chunk_from_thing(key)))
+ {
+ return 0;
+ }
buf = chunk_alloc(this->bench_size);
memset(buf.ptr, 0x34, buf.len);
@@ -547,8 +550,10 @@ METHOD(crypto_tester_t, test_signer, bool,
failed = FALSE;
key = chunk_create(vector->key, signer->get_key_size(signer));
- signer->set_key(signer, key);
-
+ if (!signer->set_key(signer, key))
+ {
+ failed = TRUE;
+ }
/* allocated signature */
data = chunk_create(vector->data, vector->len);
if (!signer->allocate_signature(signer, data, &mac))