aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_mac.cpp
diff options
context:
space:
mode:
authorAlexander Bluhm <[email protected]>2017-03-31 15:15:15 +0200
committerAlexander Bluhm <[email protected]>2017-04-21 14:38:35 +0200
commite021c6ee92d4a1f98465db2a47e3330c27322d47 (patch)
tree613c706ed2b7a39d559078673242955cc17c4436 /src/tests/test_mac.cpp
parenteeb01d7267801988fe2b068b5dfac0bb38a2b359 (diff)
Filter provider in test loops, skip text based without provider.
The tests for block, hash, stream, pubkey, and mac loop over all possible crypto providers. If a specific provider is given on the botan-test command line, use only this one. If the provider to be tested is restricted, skip text based tests that do not have a possible provider.
Diffstat (limited to 'src/tests/test_mac.cpp')
-rw-r--r--src/tests/test_mac.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tests/test_mac.cpp b/src/tests/test_mac.cpp
index 8fb3b38c2..2e12ee6ed 100644
--- a/src/tests/test_mac.cpp
+++ b/src/tests/test_mac.cpp
@@ -22,6 +22,11 @@ class Message_Auth_Tests : public Text_Based_Test
public:
Message_Auth_Tests() : Text_Based_Test("mac", "Key,In,Out", "IV") {}
+ std::vector<std::string> possible_providers(const std::string& algo) override
+ {
+ return provider_filter(Botan::MessageAuthenticationCode::providers(algo));
+ }
+
Test::Result run_one_test(const std::string& algo, const VarMap& vars) override
{
const std::vector<uint8_t> key = get_req_bin(vars, "Key");
@@ -31,7 +36,7 @@ class Message_Auth_Tests : public Text_Based_Test
Test::Result result(algo);
- const std::vector<std::string> providers = Botan::MessageAuthenticationCode::providers(algo);
+ const std::vector<std::string> providers = possible_providers(algo);
if(providers.empty())
{