diff options
Diffstat (limited to 'src/lib/tls')
-rw-r--r-- | src/lib/tls/tls_channel.cpp | 4 | ||||
-rw-r--r-- | src/lib/tls/tls_client.cpp | 1 | ||||
-rw-r--r-- | src/lib/tls/tls_extensions.h | 6 | ||||
-rw-r--r-- | src/lib/tls/tls_messages.h | 8 |
4 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/tls/tls_channel.cpp b/src/lib/tls/tls_channel.cpp index 0617f992c..25307166b 100644 --- a/src/lib/tls/tls_channel.cpp +++ b/src/lib/tls/tls_channel.cpp @@ -458,12 +458,12 @@ size_t Channel::received_data(const byte input[], size_t input_size) send_fatal_alert(e.type()); throw; } - catch(Integrity_Failure& e) + catch(Integrity_Failure&) { send_fatal_alert(Alert::BAD_RECORD_MAC); throw; } - catch(Decoding_Error& e) + catch(Decoding_Error&) { send_fatal_alert(Alert::DECODE_ERROR); throw; diff --git a/src/lib/tls/tls_client.cpp b/src/lib/tls/tls_client.cpp index 6c17409a7..7cc0dddbd 100644 --- a/src/lib/tls/tls_client.cpp +++ b/src/lib/tls/tls_client.cpp @@ -9,6 +9,7 @@ #include <botan/internal/tls_handshake_state.h> #include <botan/internal/tls_messages.h> #include <botan/internal/stl_util.h> +#include <iterator> namespace Botan { diff --git a/src/lib/tls/tls_extensions.h b/src/lib/tls/tls_extensions.h index a88938eba..ac1f75a2b 100644 --- a/src/lib/tls/tls_extensions.h +++ b/src/lib/tls/tls_extensions.h @@ -372,6 +372,12 @@ class Extensions return nullptr; } + template<typename T> + bool has() const + { + return get<T>() != nullptr; + } + void add(Extension* extn) { extensions[extn->type()].reset(extn); diff --git a/src/lib/tls/tls_messages.h b/src/lib/tls/tls_messages.h index 6cfb2f5bf..626f6a1cf 100644 --- a/src/lib/tls/tls_messages.h +++ b/src/lib/tls/tls_messages.h @@ -103,7 +103,7 @@ class Client_Hello : public Handshake_Message bool secure_renegotiation() const { - return m_extensions.get<Renegotiation_Extension>(); + return m_extensions.has<Renegotiation_Extension>(); } std::vector<byte> renegotiation_info() const @@ -115,7 +115,7 @@ class Client_Hello : public Handshake_Message bool next_protocol_notification() const { - return m_extensions.get<Next_Protocol_Notification>(); + return m_extensions.has<Next_Protocol_Notification>(); } size_t fragment_size() const @@ -127,7 +127,7 @@ class Client_Hello : public Handshake_Message bool supports_session_ticket() const { - return m_extensions.get<Session_Ticket>(); + return m_extensions.has<Session_Ticket>(); } std::vector<byte> session_ticket() const @@ -139,7 +139,7 @@ class Client_Hello : public Handshake_Message bool supports_heartbeats() const { - return m_extensions.get<Heartbeat_Support_Indicator>(); + return m_extensions.has<Heartbeat_Support_Indicator>(); } bool peer_can_send_heartbeats() const |