diff options
author | Jack Lloyd <[email protected]> | 2017-12-21 15:37:39 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-01-28 12:14:07 -0500 |
commit | b2b55e6c2fdb824f49923b60d2c3ffff8f0fb99a (patch) | |
tree | 8d5650816329cbe176a4e1fee639094c9387b260 /src/lib/tls/tls_extensions.h | |
parent | 1c667d34bf71336d33bb76309176a993f13a2aac (diff) |
Use enums to represent TLS signature and kex algorithms.
Adds support for PSS signatures (currently verifying only).
Diffstat (limited to 'src/lib/tls/tls_extensions.h')
-rw-r--r-- | src/lib/tls/tls_extensions.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/lib/tls/tls_extensions.h b/src/lib/tls/tls_extensions.h index 5ba3c0b8e..a1ed3f858 100644 --- a/src/lib/tls/tls_extensions.h +++ b/src/lib/tls/tls_extensions.h @@ -10,8 +10,9 @@ #ifndef BOTAN_TLS_EXTENSIONS_H_ #define BOTAN_TLS_EXTENSIONS_H_ +#include <botan/tls_algos.h> #include <botan/secmem.h> -#include <botan/ocsp.h> +#include <botan/x509_dn.h> #include <vector> #include <string> #include <map> @@ -306,33 +307,19 @@ class Signature_Algorithms final : public Extension Handshake_Extension_Type type() const override { return static_type(); } - static std::string hash_algo_name(uint8_t code); - static uint8_t hash_algo_code(const std::string& name); - - static std::string sig_algo_name(uint8_t code); - static uint8_t sig_algo_code(const std::string& name); - - // [(hash,sig),(hash,sig),...] - const std::vector<std::pair<std::string, std::string>>& - supported_signature_algorthms() const - { - return m_supported_algos; - } + const std::vector<Signature_Scheme>& supported_schemes() const { return m_schemes; } std::vector<uint8_t> serialize() const override; - bool empty() const override { return false; } - - Signature_Algorithms(const std::vector<std::string>& hashes, - const std::vector<std::string>& sig_algos); + bool empty() const override { return m_schemes.empty(); } - explicit Signature_Algorithms(const std::vector<std::pair<std::string, std::string>>& algos) : - m_supported_algos(algos) {} + explicit Signature_Algorithms(const std::vector<Signature_Scheme>& schemes) : + m_schemes(schemes) {} Signature_Algorithms(TLS_Data_Reader& reader, uint16_t extension_size); private: - std::vector<std::pair<std::string, std::string>> m_supported_algos; + std::vector<Signature_Scheme> m_schemes; }; /** |