aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-15 09:16:46 -0400
committerJack Lloyd <[email protected]>2016-09-15 09:25:49 -0400
commit04bf8dc51861bab37d6260de8b318dc71ea4bba7 (patch)
tree03cf4b8d607607444049bc2b9880abc4c1fc6a8e /src/lib/prov
parenta7eba3629cc0d76444f5241fb4b9e8793ddb61cd (diff)
Add T::provider() to allow user to inquire about implementation used
For block ciphers, stream ciphers, hashes, MACs, and cipher modes. Cipher_Mode already had it, with a slightly different usage.
Diffstat (limited to 'src/lib/prov')
-rw-r--r--src/lib/prov/openssl/openssl_block.cpp1
-rw-r--r--src/lib/prov/openssl/openssl_hash.cpp1
-rw-r--r--src/lib/prov/openssl/openssl_rc4.cpp2
3 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/prov/openssl/openssl_block.cpp b/src/lib/prov/openssl/openssl_block.cpp
index c868e8977..d09fdb82b 100644
--- a/src/lib/prov/openssl/openssl_block.cpp
+++ b/src/lib/prov/openssl/openssl_block.cpp
@@ -25,6 +25,7 @@ class OpenSSL_BlockCipher : public BlockCipher
~OpenSSL_BlockCipher();
void clear() override;
+ const char* provider() const override { return "openssl"; }
std::string name() const override { return m_cipher_name; }
BlockCipher* clone() const override;
diff --git a/src/lib/prov/openssl/openssl_hash.cpp b/src/lib/prov/openssl/openssl_hash.cpp
index c14c551e4..fa31d36c8 100644
--- a/src/lib/prov/openssl/openssl_hash.cpp
+++ b/src/lib/prov/openssl/openssl_hash.cpp
@@ -23,6 +23,7 @@ class OpenSSL_HashFunction : public HashFunction
EVP_DigestInit_ex(&m_md, algo, nullptr);
}
+ const char* provider() const override { return "openssl"; }
std::string name() const override { return m_name; }
HashFunction* clone() const override
diff --git a/src/lib/prov/openssl/openssl_rc4.cpp b/src/lib/prov/openssl/openssl_rc4.cpp
index d6246e4ab..50148f09a 100644
--- a/src/lib/prov/openssl/openssl_rc4.cpp
+++ b/src/lib/prov/openssl/openssl_rc4.cpp
@@ -24,6 +24,8 @@ class OpenSSL_RC4 : public StreamCipher
public:
void clear() override { clear_mem(&m_rc4, 1); }
+ const char* provider() const override { return "openssl"; }
+
std::string name() const override
{
switch(m_skip)