|
Botan
1.11.15
|
#include <tls_extensions.h>
Public Member Functions | |
| bool | empty () const |
| Next_Protocol_Notification () | |
| Next_Protocol_Notification (const std::vector< std::string > &protocols) | |
| Next_Protocol_Notification (TLS_Data_Reader &reader, u16bit extension_size) | |
| const std::vector< std::string > & | protocols () const |
| std::vector< byte > | serialize () const |
| Handshake_Extension_Type | type () const |
Static Public Member Functions | |
| static Handshake_Extension_Type | static_type () |
Next Protocol Negotiation http://technotes.googlecode.com/git/nextprotoneg.html
This implementation requires the semantics defined in the Google spec (implemented in Chromium); the internet draft leaves the format unspecified.
Definition at line 191 of file tls_extensions.h.
| Botan::TLS::Next_Protocol_Notification::Next_Protocol_Notification | ( | const std::vector< std::string > & | protocols | ) | [inline] |
List of protocols, used by server
Definition at line 210 of file tls_extensions.h.
:
m_protocols(protocols) {}
| Botan::TLS::Next_Protocol_Notification::Next_Protocol_Notification | ( | TLS_Data_Reader & | reader, |
| u16bit | extension_size | ||
| ) |
Definition at line 261 of file tls_extensions.cpp.
References Botan::TLS::TLS_Data_Reader::get_string().
{
if(extension_size == 0)
return; // empty extension
size_t bytes_remaining = extension_size;
while(bytes_remaining)
{
const std::string p = reader.get_string(1, 0, 255);
if(bytes_remaining < p.size() + 1)
throw Decoding_Error("Bad encoding for next protocol extension");
bytes_remaining -= (p.size() + 1);
m_protocols.push_back(p);
}
}
| bool Botan::TLS::Next_Protocol_Notification::empty | ( | ) | const [inline, virtual] |
Implements Botan::TLS::Extension.
Definition at line 218 of file tls_extensions.h.
{ return false; }
| const std::vector<std::string>& Botan::TLS::Next_Protocol_Notification::protocols | ( | ) | const [inline] |
Definition at line 199 of file tls_extensions.h.
{ return m_protocols; }
| std::vector< byte > Botan::TLS::Next_Protocol_Notification::serialize | ( | ) | const [virtual] |
Implements Botan::TLS::Extension.
Definition at line 282 of file tls_extensions.cpp.
References Botan::TLS::append_tls_length_value().
{
std::vector<byte> buf;
for(size_t i = 0; i != m_protocols.size(); ++i)
{
const std::string p = m_protocols[i];
if(p != "")
append_tls_length_value(buf,
reinterpret_cast<const byte*>(p.data()),
p.size(),
1);
}
return buf;
}
| static Handshake_Extension_Type Botan::TLS::Next_Protocol_Notification::static_type | ( | ) | [inline, static] |
Definition at line 194 of file tls_extensions.h.
References Botan::TLS::TLSEXT_NEXT_PROTOCOL.
Referenced by type().
{ return TLSEXT_NEXT_PROTOCOL; }
| Handshake_Extension_Type Botan::TLS::Next_Protocol_Notification::type | ( | ) | const [inline, virtual] |
Implements Botan::TLS::Extension.
Definition at line 197 of file tls_extensions.h.
References static_type().
{ return static_type(); }
1.7.6.1