aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls_policy.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-28 04:32:10 +0000
committerlloyd <[email protected]>2015-01-28 04:32:10 +0000
commit7b56f1bd570dc684ffd7c945dee0d9b5480354ff (patch)
tree0c50ad534280a292a1b76daee9a19b34cfd96367 /src/lib/tls/tls_policy.h
parentb8fa304ec981d273c45d7ef31705d65ccfb00cc1 (diff)
Add a runtime map of string->func() which when called return
Transforms and BlockCiphers. Registration for all types is done at startup but is very cheap as just a std::function and a std::map entry are created, no actual objects are created until needed. This is a huge improvement over Algorithm_Factory which used T::clone() as the function and thus kept a prototype object of each type in memory. Replace existing lookup mechanisms for ciphers, AEADs, and compression to use the transform lookup. The existing Engine framework remains in place for BlockCipher, but the engines now just call to the registry instead of having hardcoded lookups. s/Transformation/Transform/ with typedefs for compatability. Remove lib/selftest code (for runtime selftesting): not the right approach.
Diffstat (limited to 'src/lib/tls/tls_policy.h')
-rw-r--r--src/lib/tls/tls_policy.h22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/lib/tls/tls_policy.h b/src/lib/tls/tls_policy.h
index 247510326..581d04bcd 100644
--- a/src/lib/tls/tls_policy.h
+++ b/src/lib/tls/tls_policy.h
@@ -229,27 +229,15 @@ class BOTAN_DLL Datagram_Policy : public Policy
class BOTAN_DLL Strict_Policy : public Policy
{
public:
- std::vector<std::string> allowed_ciphers() const override
- {
- return { "ChaCha20Poly1305", "AES-256/GCM", "AES-128/GCM" };
- }
+ std::vector<std::string> allowed_ciphers() const override;
- std::vector<std::string> allowed_signature_hashes() const override
- { return { "SHA-512", "SHA-384"}; }
+ std::vector<std::string> allowed_signature_hashes() const override;
- std::vector<std::string> allowed_macs() const override
- { return { "AEAD" }; }
+ std::vector<std::string> allowed_macs() const override;
- std::vector<std::string> allowed_key_exchange_methods() const override
- { return { "ECDH" }; }
+ std::vector<std::string> allowed_key_exchange_methods() const override;
- bool acceptable_protocol_version(Protocol_Version version) const override
- {
- if(version.is_datagram_protocol())
- return (version >= Protocol_Version::DTLS_V12);
- else
- return (version >= Protocol_Version::TLS_V12);
- }
+ bool acceptable_protocol_version(Protocol_Version version) const override;
};
class BOTAN_DLL Text_Policy : public Policy