diff options
author | Martin Willi <martin@revosec.ch> | 2012-07-06 16:57:17 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-07-16 14:53:38 +0200 |
commit | ce73fc19dbc36d089e595e452356deccd8afcd6f (patch) | |
tree | ba7f244b7e566bd86d3e87e6992d831203322445 /src/libstrongswan/crypto/crypto_tester.c | |
parent | 3b96189a2afa4949e1d9cdf7c9fa8244d8d817f0 (diff) | |
download | strongswan-ce73fc19dbc36d089e595e452356deccd8afcd6f.tar.bz2 strongswan-ce73fc19dbc36d089e595e452356deccd8afcd6f.tar.xz |
Add a return value to crypter_t.set_key()
Diffstat (limited to 'src/libstrongswan/crypto/crypto_tester.c')
-rw-r--r-- | src/libstrongswan/crypto/crypto_tester.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 812e94914..4e5e840b5 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -151,7 +151,10 @@ static u_int bench_crypter(private_crypto_tester_t *this, memset(iv, 0x56, sizeof(iv)); memset(key, 0x12, sizeof(key)); - crypter->set_key(crypter, chunk_from_thing(key)); + if (!crypter->set_key(crypter, chunk_from_thing(key))) + { + return 0; + } buf = chunk_alloc(this->bench_size); memset(buf.ptr, 0x34, buf.len); @@ -214,7 +217,10 @@ METHOD(crypto_tester_t, test_crypter, bool, tested++; key = chunk_create(vector->key, crypter->get_key_size(crypter)); - crypter->set_key(crypter, key); + if (!crypter->set_key(crypter, key)) + { + failed = TRUE; + } iv = chunk_create(vector->iv, crypter->get_iv_size(crypter)); /* allocated encryption */ |