diff options
author | Jack Lloyd <[email protected]> | 2016-12-20 00:00:25 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-20 00:00:25 -0500 |
commit | 46bf28e0b6d9627a57862a180142fbf158f33ce7 (patch) | |
tree | 08735043ffc08d3a1518acd322caa837ece94756 /src/tests/test_pubkey.h | |
parent | c7530347f1d49752d5977d8b3d3e13f2342cb8ff (diff) |
Add RSA PKCS1v1.5 signature verification tests from Wycheproof suite.
A set of carefully generated invalid signatures which are sometimes
accepted by implementations due to bugs in padding verification.
Diffstat (limited to 'src/tests/test_pubkey.h')
-rw-r--r-- | src/tests/test_pubkey.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tests/test_pubkey.h b/src/tests/test_pubkey.h index b86b98bf9..3fa06bb29 100644 --- a/src/tests/test_pubkey.h +++ b/src/tests/test_pubkey.h @@ -78,6 +78,27 @@ class PK_Signature_Verification_Test : public PK_Test Test::Result run_one_test(const std::string& header, const VarMap& vars) override; }; +class PK_Signature_NonVerification_Test : public PK_Test + { + public: + 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) {} + + bool clear_between_callbacks() const override { return false; } + + virtual std::string default_padding(const VarMap&) const + { + throw Test_Error("No default padding scheme set for " + algo_name()); + } + + virtual std::unique_ptr<Botan::Public_Key> load_public_key(const VarMap& vars) = 0; + private: + Test::Result run_one_test(const std::string& header, const VarMap& vars) override; + }; + class PK_Encryption_Decryption_Test : public PK_Test { public: |