diff options
Diffstat (limited to 'src/tests/test_pubkey.cpp')
-rw-r--r-- | src/tests/test_pubkey.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/src/tests/test_pubkey.cpp b/src/tests/test_pubkey.cpp index c7bd8f932..745b18614 100644 --- a/src/tests/test_pubkey.cpp +++ b/src/tests/test_pubkey.cpp @@ -102,7 +102,7 @@ PK_Signature_Generation_Test::run_one_test(const std::string&, const VarMap& var try { - signer.reset(new Botan::PK_Signer(*privkey, padding, Botan::IEEE_1363, sign_provider)); + signer.reset(new Botan::PK_Signer(*privkey, Test::rng(), padding, Botan::IEEE_1363, sign_provider)); } catch(Botan::Lookup_Error&) { @@ -216,11 +216,14 @@ PK_Encryption_Decryption_Test::run_one_test(const std::string&, const VarMap& va try { - encryptor.reset(new Botan::PK_Encryptor_EME(*pubkey, padding, enc_provider)); + encryptor.reset(new Botan::PK_Encryptor_EME(*pubkey, Test::rng(),padding, enc_provider)); + } + catch(Botan::Provider_Not_Found&) + { + continue; } catch(Botan::Lookup_Error&) { - //result.test_note("Skipping encryption with provider " + enc_provider); continue; } @@ -245,11 +248,14 @@ PK_Encryption_Decryption_Test::run_one_test(const std::string&, const VarMap& va try { - decryptor.reset(new Botan::PK_Decryptor_EME(*privkey, padding, dec_provider)); + decryptor.reset(new Botan::PK_Decryptor_EME(*privkey, Test::rng(), padding, dec_provider)); + } + catch(Botan::Provider_Not_Found&) + { + continue; } catch(Botan::Lookup_Error&) { - //result.test_note("Skipping decryption with provider " + dec_provider); continue; } @@ -285,7 +291,12 @@ Test::Result PK_KEM_Test::run_one_test(const std::string&, const VarMap& vars) std::unique_ptr<Botan::PK_KEM_Encryptor> enc; try { - enc.reset(new Botan::PK_KEM_Encryptor(pubkey, kdf)); + enc.reset(new Botan::PK_KEM_Encryptor(pubkey, Test::rng(), kdf)); + } + catch(Botan::Provider_Not_Found& e) + { + result.test_note("Skipping test", e.what()); + return result; } catch(Botan::Lookup_Error&) { @@ -308,10 +319,16 @@ Test::Result PK_KEM_Test::run_one_test(const std::string&, const VarMap& vars) std::unique_ptr<Botan::PK_KEM_Decryptor> dec; try { - dec.reset(new Botan::PK_KEM_Decryptor(*privkey, kdf)); + dec.reset(new Botan::PK_KEM_Decryptor(*privkey, Test::rng(), kdf)); } - catch(Botan::Lookup_Error&) + catch(Botan::Provider_Not_Found& e) { + result.test_note("Skipping test", e.what()); + return result; + } + catch(Botan::Lookup_Error& e) + { + result.test_note("Skipping test", e.what()); return result; } @@ -346,9 +363,12 @@ Test::Result PK_Key_Agreement_Test::run_one_test(const std::string& header, cons try { - kas.reset(new Botan::PK_Key_Agreement(*privkey, kdf, provider)); + kas.reset(new Botan::PK_Key_Agreement(*privkey, Test::rng(), kdf, provider)); result.test_eq(provider, "agreement", kas->derive_key(key_len, pubkey).bits_of(), shared); } + catch(Botan::Provider_Not_Found&) + { + } catch(Botan::Lookup_Error&) { //result.test_note("Skipping key agreement with with " + provider); |