From 239bdf36a617df86dc97efb11ec96d7c6d357534 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 14 Sep 2016 16:33:37 -0400 Subject: Revert PK_Verifier change (don't require RNG there). Verification is deterministic and public, so really no RNG is ever needed. Change provider handling - accepts "base", "openssl", or empty, otherwise throws a Provider_Not_Found exception. --- src/lib/pubkey/ecgdsa/ecgdsa.cpp | 13 ++++++++----- src/lib/pubkey/ecgdsa/ecgdsa.h | 5 ++--- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/lib/pubkey/ecgdsa') diff --git a/src/lib/pubkey/ecgdsa/ecgdsa.cpp b/src/lib/pubkey/ecgdsa/ecgdsa.cpp index b112a4466..136f2159a 100644 --- a/src/lib/pubkey/ecgdsa/ecgdsa.cpp +++ b/src/lib/pubkey/ecgdsa/ecgdsa.cpp @@ -141,19 +141,22 @@ bool ECGDSA_Verification_Operation::verify(const byte msg[], size_t msg_len, } std::unique_ptr -ECGDSA_PublicKey::create_verification_op(RandomNumberGenerator& rng, - const std::string& params, +ECGDSA_PublicKey::create_verification_op(const std::string& params, const std::string& provider) const { - return std::unique_ptr(new ECGDSA_Verification_Operation(*this, params)); + if(provider == "base" || provider.empty()) + return std::unique_ptr(new ECGDSA_Verification_Operation(*this, params)); + throw Provider_Not_Found(algo_name(), provider); } std::unique_ptr -ECGDSA_PrivateKey::create_signature_op(RandomNumberGenerator& rng, +ECGDSA_PrivateKey::create_signature_op(RandomNumberGenerator& /*rng*/, const std::string& params, const std::string& provider) const { - return std::unique_ptr(new ECGDSA_Signature_Operation(*this, params)); + if(provider == "base" || provider.empty()) + return std::unique_ptr(new ECGDSA_Signature_Operation(*this, params)); + throw Provider_Not_Found(algo_name(), provider); } } diff --git a/src/lib/pubkey/ecgdsa/ecgdsa.h b/src/lib/pubkey/ecgdsa/ecgdsa.h index ec9180ee5..203e8d0a8 100644 --- a/src/lib/pubkey/ecgdsa/ecgdsa.h +++ b/src/lib/pubkey/ecgdsa/ecgdsa.h @@ -52,8 +52,7 @@ class BOTAN_DLL ECGDSA_PublicKey : public virtual EC_PublicKey { return domain().get_order().bytes(); } std::unique_ptr - create_verification_op(RandomNumberGenerator& rng, - const std::string& params, + create_verification_op(const std::string& params, const std::string& provider) const override; protected: ECGDSA_PublicKey() {} @@ -92,7 +91,7 @@ class BOTAN_DLL ECGDSA_PrivateKey : public ECGDSA_PublicKey, std::unique_ptr create_signature_op(RandomNumberGenerator& rng, const std::string& params, - const std::string& provider) const; + const std::string& provider) const override; }; } -- cgit v1.2.3