diff options
author | lloyd <[email protected]> | 2012-01-18 17:51:57 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-18 17:51:57 +0000 |
commit | 8d1787751a15605dfd2729a9ddf67ce826d739f4 (patch) | |
tree | f183ae5af46deda0b8e27b29a707b69ebe28908f /src/tls/tls_extensions.h | |
parent | 3e2efbde4ef272336c85c5ed880ecf31442d6db8 (diff) |
Read only support for signature_algorithms extension used in TLS 1.2
Diffstat (limited to 'src/tls/tls_extensions.h')
-rw-r--r-- | src/tls/tls_extensions.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/tls/tls_extensions.h b/src/tls/tls_extensions.h index 62f179998..94be97d7f 100644 --- a/src/tls/tls_extensions.h +++ b/src/tls/tls_extensions.h @@ -177,6 +177,39 @@ class Next_Protocol_Notification : public TLS_Extension }; /** +* Signature Algorithms Extension for TLS 1.2 (RFC 5246) +*/ +class Signature_Algorithms : public TLS_Extension + { + public: + TLS_Handshake_Extension_Type type() const + { return TLSEXT_NEXT_PROTOCOL; } + + std::vector<std::pair<TLS_Ciphersuite_Algos, TLS_Ciphersuite_Algos> > + supported_signature_algorthms() const + { + return m_supported_algos; + } + + MemoryVector<byte> serialize() const; + + bool empty() const { return false; } + + Signature_Algorithms(); + + Signature_Algorithms(TLS_Data_Reader& reader, + u16bit extension_size); + private: + static TLS_Ciphersuite_Algos hash_algo_code(byte code); + static byte hash_algo_code(TLS_Ciphersuite_Algos code); + + static TLS_Ciphersuite_Algos sig_algo_code(byte code); + static byte sig_algo_code(TLS_Ciphersuite_Algos code); + + std::vector<std::pair<TLS_Ciphersuite_Algos, TLS_Ciphersuite_Algos> > m_supported_algos; + }; + +/** * Represents a block of extensions in a hello message */ class TLS_Extensions |