diff options
author | Jack Lloyd <[email protected]> | 2016-10-07 15:50:48 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-10-07 15:50:48 -0400 |
commit | 36220cebaae551f3e7c22e2abd8a8ce848e56892 (patch) | |
tree | 3b9aca25bf2437b7cde4f4df7e3bb876a139c264 /src/lib/tls/tls_extensions.h | |
parent | b2209d7ebe29bfe2ab5d25eb2be7c51d42ea2a46 (diff) | |
parent | c2d88a0c4e0d2b6aa461cf7c415eea23ff3994c2 (diff) |
Merge GH #645 TLS compressed points
Diffstat (limited to 'src/lib/tls/tls_extensions.h')
-rw-r--r-- | src/lib/tls/tls_extensions.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/tls/tls_extensions.h b/src/lib/tls/tls_extensions.h index c270bf23a..d69e40a60 100644 --- a/src/lib/tls/tls_extensions.h +++ b/src/lib/tls/tls_extensions.h @@ -258,6 +258,38 @@ class Supported_Elliptic_Curves final : public Extension }; /** +* Supported Point Formats Extension (RFC 4492) +*/ +class Supported_Point_Formats final : public Extension + { + public: + enum ECPointFormat : byte { + UNCOMPRESSED = 0, + ANSIX962_COMPRESSED_PRIME = 1, + ANSIX962_COMPRESSED_CHAR2 = 2, // don't support these curves + }; + + static Handshake_Extension_Type static_type() + { return TLSEXT_EC_POINT_FORMATS; } + + Handshake_Extension_Type type() const override { return static_type(); } + + std::vector<byte> serialize() const override; + + explicit Supported_Point_Formats() : m_prefers_compressed(true) {} + + Supported_Point_Formats(TLS_Data_Reader& reader, + u16bit extension_size); + + bool empty() const override { return false; } + + bool prefers_compressed() { return m_prefers_compressed; } + + private: + bool m_prefers_compressed = false; + }; + +/** * Signature Algorithms Extension for TLS 1.2 (RFC 5246) */ class Signature_Algorithms final : public Extension |