diff options
author | lloyd <[email protected]> | 2012-01-11 20:01:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-11 20:01:33 +0000 |
commit | d146e65c66bc157c5a884d0ea5ac6cb167a4c929 (patch) | |
tree | 4a6eae6530c795a521e6ac1b2dbc37fb74f39e95 /src/tls/tls_extensions.h | |
parent | d6ec0f46e79f4b99194f8257e1f226b5ec05fe32 (diff) |
Outline of RFC 5077 session tickets
Diffstat (limited to 'src/tls/tls_extensions.h')
-rw-r--r-- | src/tls/tls_extensions.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/tls/tls_extensions.h b/src/tls/tls_extensions.h index 62f179998..526436862 100644 --- a/src/tls/tls_extensions.h +++ b/src/tls/tls_extensions.h @@ -1,6 +1,6 @@ /* * TLS Extensions -* (C) 2011 Jack Lloyd +* (C) 2011-2012 Jack Lloyd * * Released under the terms of the Botan license */ @@ -15,6 +15,7 @@ namespace Botan { +class TLS_Session; class TLS_Data_Reader; /** @@ -176,6 +177,40 @@ class Next_Protocol_Notification : public TLS_Extension std::vector<std::string> m_protocols; }; +class Session_Ticket : public TLS_Extension + { + public: + TLS_Handshake_Extension_Type type() const + { return TLSEXT_SESSION_TICKET; } + + /* + * Decrypt the session ticket and return the session info; + * used by server. + */ + TLS_Session decrypt(const SymmetricKey& key, + const MemoryRegion<byte>& key_name); + + /** + * Create empty extension, used by both client and server + */ + Session_Ticket() {} + + /** + * Extension with ticket, used by client + */ + Session_Ticket(const MemoryRegion<byte>& session_ticket) : + m_contents(session_ticket); + + /** + * Deserialize a session ticket + */ + Session_Ticket(const TLS_Data_Reader& reader, u16ibt extension_size); + + MemoryVector<byte> serialize() const { return m_contents; } + private: + MemoryVector<byte> m_contents; + }; + /** * Represents a block of extensions in a hello message */ |