diff options
Diffstat (limited to 'src/tests/test_pubkey.cpp')
-rw-r--r-- | src/tests/test_pubkey.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/tests/test_pubkey.cpp b/src/tests/test_pubkey.cpp index dc5cd4145..faa27f322 100644 --- a/src/tests/test_pubkey.cpp +++ b/src/tests/test_pubkey.cpp @@ -294,16 +294,29 @@ Test::Result PK_Key_Agreement_Test::run_one_test(const std::string& header, cons const std::vector<uint8_t> shared = get_req_bin(vars, "K"); const std::string kdf = get_opt_str(vars, "KDF", default_kdf(vars)); - Test::Result result(algo_name() + "/" + kdf + " key agreement"); + Test::Result result(algo_name() + "/" + kdf + + (header.empty() ? header : " " + header) + + " key agreement"); std::unique_ptr<Botan::Private_Key> privkey = load_our_key(header, vars); const std::vector<uint8_t> pubkey = load_their_key(header, vars); const size_t key_len = get_opt_sz(vars, "OutLen", 0); - Botan::PK_Key_Agreement kas(*privkey, kdf); + for(auto&& provider : possible_pk_providers()) + { + std::unique_ptr<Botan::PK_Key_Agreement> kas; - result.test_eq("agreement", kas.derive_key(key_len, pubkey).bits_of(), shared); + try + { + kas.reset(new Botan::PK_Key_Agreement(*privkey, kdf, provider)); + result.test_eq(provider, "agreement", kas->derive_key(key_len, pubkey).bits_of(), shared); + } + catch(Botan::Lookup_Error&) + { + //result.test_note("Skipping key agreement with with " + provider); + } + } return result; } |