aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_pubkey.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test_pubkey.h')
-rw-r--r--src/tests/test_pubkey.h62
1 files changed, 37 insertions, 25 deletions
diff --git a/src/tests/test_pubkey.h b/src/tests/test_pubkey.h
index 7709f51c7..4a2ca6866 100644
--- a/src/tests/test_pubkey.h
+++ b/src/tests/test_pubkey.h
@@ -21,14 +21,15 @@ class PK_Test : public Text_Based_Test
{
public:
PK_Test(const std::string& algo,
- const std::string& test_src,
- const std::string& required_keys,
- const std::string& optional_keys = {}) :
- Text_Based_Test(test_src, required_keys, optional_keys),
- m_algo(algo)
- {}
+ const std::string& test_src,
+ const std::string& required_keys,
+ const std::string& optional_keys = {})
+ : Text_Based_Test(test_src, required_keys, optional_keys), m_algo(algo) {}
- std::string algo_name() const { return m_algo; }
+ std::string algo_name() const
+ {
+ return m_algo;
+ }
protected:
std::vector<std::string> possible_providers(const std::string&) override;
@@ -43,8 +44,8 @@ class PK_Signature_Generation_Test : public PK_Test
PK_Signature_Generation_Test(const std::string& algo,
const std::string& test_src,
const std::string& required_keys,
- const std::string& optional_keys = "") :
- PK_Test(algo, test_src, required_keys, optional_keys) {}
+ const std::string& optional_keys = "")
+ : PK_Test(algo, test_src, required_keys, optional_keys) {}
virtual std::string default_padding(const VarMap&) const
{
@@ -68,8 +69,8 @@ class PK_Signature_Verification_Test : public PK_Test
PK_Signature_Verification_Test(const std::string& algo,
const std::string& test_src,
const std::string& required_keys,
- const std::string& optional_keys = "") :
- PK_Test(algo, test_src, required_keys, optional_keys) {}
+ const std::string& optional_keys = "")
+ : PK_Test(algo, test_src, required_keys, optional_keys) {}
virtual std::string default_padding(const VarMap&) const
{
@@ -87,10 +88,13 @@ class PK_Signature_NonVerification_Test : public PK_Test
PK_Signature_NonVerification_Test(const std::string& algo,
const std::string& test_src,
const std::string& required_keys,
- const std::string& optional_keys = "") :
- PK_Test(algo, test_src, required_keys, optional_keys) {}
+ const std::string& optional_keys = "")
+ : PK_Test(algo, test_src, required_keys, optional_keys) {}
- bool clear_between_callbacks() const override { return false; }
+ bool clear_between_callbacks() const override
+ {
+ return false;
+ }
virtual std::string default_padding(const VarMap&) const
{
@@ -108,15 +112,18 @@ class PK_Encryption_Decryption_Test : public PK_Test
PK_Encryption_Decryption_Test(const std::string& algo,
const std::string& test_src,
const std::string& required_keys,
- const std::string& optional_keys = "") :
- PK_Test(algo, test_src, required_keys, optional_keys) {}
+ const std::string& optional_keys = "")
+ : PK_Test(algo, test_src, required_keys, optional_keys) {}
virtual std::unique_ptr<Botan::Private_Key> load_private_key(const VarMap& vars) = 0;
- virtual std::string default_padding(const VarMap&) const { return "Raw"; }
+ virtual std::string default_padding(const VarMap&) const
+ {
+ return "Raw";
+ }
private:
Test::Result run_one_test(const std::string& header, const VarMap& vars) override final;
-};
+ };
class PK_Key_Agreement_Test : public PK_Test
{
@@ -124,16 +131,19 @@ class PK_Key_Agreement_Test : public PK_Test
PK_Key_Agreement_Test(const std::string& algo,
const std::string& test_src,
const std::string& required_keys,
- const std::string& optional_keys = "") :
- PK_Test(algo, test_src, required_keys, optional_keys) {}
+ const std::string& optional_keys = "")
+ : PK_Test(algo, test_src, required_keys, optional_keys) {}
virtual std::unique_ptr<Botan::Private_Key> load_our_key(const std::string& header,
- const VarMap& vars) = 0;
+ const VarMap& vars) = 0;
virtual std::vector<uint8_t> load_their_key(const std::string& header,
- const VarMap& vars) = 0;
+ const VarMap& vars) = 0;
- virtual std::string default_kdf(const VarMap&) const { return "Raw"; }
+ virtual std::string default_kdf(const VarMap&) const
+ {
+ return "Raw";
+ }
private:
Test::Result run_one_test(const std::string& header, const VarMap& vars) override final;
@@ -145,8 +155,8 @@ class PK_KEM_Test : public PK_Test
PK_KEM_Test(const std::string& algo,
const std::string& test_src,
const std::string& required_keys,
- const std::string& optional_keys = "") :
- PK_Test(algo, test_src, required_keys, optional_keys) {}
+ const std::string& optional_keys = "")
+ : PK_Test(algo, test_src, required_keys, optional_keys) {}
virtual std::unique_ptr<Botan::Private_Key> load_private_key(const VarMap& vars) = 0;
private:
@@ -161,6 +171,8 @@ class PK_Key_Generation_Test : public Test
virtual std::vector<std::string> keygen_params() const = 0;
virtual std::string algo_name() const = 0;
+
+ std::vector<std::string> possible_providers(const std::string&) override;
};
void check_invalid_signatures(Test::Result& result,