aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-14 16:33:37 -0400
committerJack Lloyd <[email protected]>2016-10-07 19:27:58 -0400
commit239bdf36a617df86dc97efb11ec96d7c6d357534 (patch)
tree1011ccccee0a4aad5e58943fa3a4af621c968b8a /src/lib/prov
parent25b6fb53eec30620d084411fb1dbc8913142fc6d (diff)
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.
Diffstat (limited to 'src/lib/prov')
-rw-r--r--src/lib/prov/openssl/openssl_rsa.cpp22
-rw-r--r--src/lib/prov/pkcs11/p11_ecdsa.cpp11
-rw-r--r--src/lib/prov/pkcs11/p11_ecdsa.h3
-rw-r--r--src/lib/prov/pkcs11/p11_rsa.cpp3
-rw-r--r--src/lib/prov/pkcs11/p11_rsa.h3
-rw-r--r--src/lib/prov/tpm/tpm.cpp4
6 files changed, 15 insertions, 31 deletions
diff --git a/src/lib/prov/openssl/openssl_rsa.cpp b/src/lib/prov/openssl/openssl_rsa.cpp
index 5405ddda1..defa566f0 100644
--- a/src/lib/prov/openssl/openssl_rsa.cpp
+++ b/src/lib/prov/openssl/openssl_rsa.cpp
@@ -228,28 +228,16 @@ class OpenSSL_RSA_Signing_Operation : public PK_Ops::Signature_with_EMSA
std::unique_ptr<PK_Ops::Encryption>
make_openssl_rsa_enc_op(const RSA_PublicKey& key, const std::string& params)
{
- try
- {
- auto pad_info = get_openssl_enc_pad(params);
- return std::unique_ptr<PK_Ops::Encryption>(
- new OpenSSL_RSA_Encryption_Operation(key, pad_info.first, pad_info.second));
- }
- catch(...) {}
-
- return {};
+ auto pad_info = get_openssl_enc_pad(params);
+ return std::unique_ptr<PK_Ops::Encryption>(
+ new OpenSSL_RSA_Encryption_Operation(key, pad_info.first, pad_info.second));
}
std::unique_ptr<PK_Ops::Decryption>
make_openssl_rsa_dec_op(const RSA_PrivateKey& key, const std::string& params)
{
- try
- {
- auto pad_info = get_openssl_enc_pad(params);
- return std::unique_ptr<PK_Ops::Decryption>(new OpenSSL_RSA_Decryption_Operation(key, pad_info.first));
- }
- catch(...) {}
-
- return {};
+ auto pad_info = get_openssl_enc_pad(params);
+ return std::unique_ptr<PK_Ops::Decryption>(new OpenSSL_RSA_Decryption_Operation(key, pad_info.first));
}
std::unique_ptr<PK_Ops::Verification>
diff --git a/src/lib/prov/pkcs11/p11_ecdsa.cpp b/src/lib/prov/pkcs11/p11_ecdsa.cpp
index 9e21a3701..c406fe553 100644
--- a/src/lib/prov/pkcs11/p11_ecdsa.cpp
+++ b/src/lib/prov/pkcs11/p11_ecdsa.cpp
@@ -201,17 +201,16 @@ class PKCS11_ECDSA_Verification_Operation : public PK_Ops::Verification
}
std::unique_ptr<PK_Ops::Verification>
-PKCS11_ECDSA_PublicKey::create_verification_op(RandomNumberGenerator& rng,
- const std::string& params,
- const std::string& provider) const
+PKCS11_ECDSA_PublicKey::create_verification_op(const std::string& params,
+ const std::string& /*provider*/) const
{
return std::unique_ptr<PK_Ops::Verification>(new PKCS11_ECDSA_Verification_Operation(*this, params));
}
std::unique_ptr<PK_Ops::Signature>
-PKCS11_ECDSA_PrivateKey::create_signature_op(RandomNumberGenerator& rng,
- const std::string& params,
- const std::string& provider) const
+PKCS11_ECDSA_PrivateKey::create_signature_op(RandomNumberGenerator& /*rng*/,
+ const std::string& params,
+ const std::string& /*provider*/) const
{
return std::unique_ptr<PK_Ops::Signature>(new PKCS11_ECDSA_Signature_Operation(*this, params));
}
diff --git a/src/lib/prov/pkcs11/p11_ecdsa.h b/src/lib/prov/pkcs11/p11_ecdsa.h
index d391ce0b9..aab56f1f2 100644
--- a/src/lib/prov/pkcs11/p11_ecdsa.h
+++ b/src/lib/prov/pkcs11/p11_ecdsa.h
@@ -57,8 +57,7 @@ class BOTAN_DLL PKCS11_ECDSA_PublicKey final : public PKCS11_EC_PublicKey, publi
ECDSA_PublicKey export_key() const;
std::unique_ptr<PK_Ops::Verification>
- create_verification_op(RandomNumberGenerator& rng,
- const std::string& params,
+ create_verification_op(const std::string& params,
const std::string& provider) const override;
};
diff --git a/src/lib/prov/pkcs11/p11_rsa.cpp b/src/lib/prov/pkcs11/p11_rsa.cpp
index 18965fd95..c048d9d22 100644
--- a/src/lib/prov/pkcs11/p11_rsa.cpp
+++ b/src/lib/prov/pkcs11/p11_rsa.cpp
@@ -358,8 +358,7 @@ PKCS11_RSA_PublicKey::create_encryption_op(RandomNumberGenerator& /*rng*/,
}
std::unique_ptr<PK_Ops::Verification>
-PKCS11_RSA_PublicKey::create_verification_op(RandomNumberGenerator& /*rng*/,
- const std::string& params,
+PKCS11_RSA_PublicKey::create_verification_op(const std::string& params,
const std::string& /*provider*/) const
{
return std::unique_ptr<PK_Ops::Verification>(new PKCS11_RSA_Verification_Operation(*this, params));
diff --git a/src/lib/prov/pkcs11/p11_rsa.h b/src/lib/prov/pkcs11/p11_rsa.h
index 6a085a7d7..6d80e45a7 100644
--- a/src/lib/prov/pkcs11/p11_rsa.h
+++ b/src/lib/prov/pkcs11/p11_rsa.h
@@ -90,8 +90,7 @@ class BOTAN_DLL PKCS11_RSA_PublicKey final : public RSA_PublicKey,
const std::string& provider) const override;
std::unique_ptr<PK_Ops::Verification>
- create_verification_op(RandomNumberGenerator& rng,
- const std::string& params,
+ create_verification_op(const std::string& params,
const std::string& provider) const override;
};
diff --git a/src/lib/prov/tpm/tpm.cpp b/src/lib/prov/tpm/tpm.cpp
index 73eb063ce..20334d75d 100644
--- a/src/lib/prov/tpm/tpm.cpp
+++ b/src/lib/prov/tpm/tpm.cpp
@@ -443,9 +443,9 @@ class TPM_Signing_Operation : public PK_Ops::Signature
}
std::unique_ptr<PK_Ops::Signature>
-TPM_PrivateKey::create_signature_op(RandomNumberGenerator& rng,
+TPM_PrivateKey::create_signature_op(RandomNumberGenerator& /*rng*/,
const std::string& params,
- const std::string& provider) const
+ const std::string& /*provider*/) const
{
return std::unique_ptr<PK_Ops::Signature>(new TPM_Signing_Operation(*this, params));
}