diff options
Diffstat (limited to 'src/lib/tls')
-rw-r--r-- | src/lib/tls/msg_server_kex.cpp | 2 | ||||
-rw-r--r-- | src/lib/tls/tls_alert.h | 2 | ||||
-rw-r--r-- | src/lib/tls/tls_exceptn.h | 2 | ||||
-rw-r--r-- | src/lib/tls/tls_extensions.h | 22 | ||||
-rw-r--r-- | src/lib/tls/tls_handshake_io.h | 2 | ||||
-rw-r--r-- | src/lib/tls/tls_messages.h | 18 | ||||
-rw-r--r-- | src/lib/tls/tls_policy.h | 4 | ||||
-rw-r--r-- | src/lib/tls/tls_session.h | 2 |
8 files changed, 27 insertions, 27 deletions
diff --git a/src/lib/tls/msg_server_kex.cpp b/src/lib/tls/msg_server_kex.cpp index fcff7349e..7389cb35b 100644 --- a/src/lib/tls/msg_server_kex.cpp +++ b/src/lib/tls/msg_server_kex.cpp @@ -48,7 +48,7 @@ Server_Key_Exchange::Server_Key_Exchange(Handshake_IO& io, if(kex_algo == "DH" || kex_algo == "DHE_PSK") { - std::unique_ptr<DH_PrivateKey> dh(new DH_PrivateKey(rng, policy.dh_group())); + std::unique_ptr<DH_PrivateKey> dh(new DH_PrivateKey(rng, DL_Group(policy.dh_group()))); append_tls_length_value(m_params, BigInt::encode(dh->get_domain().get_p()), 2); append_tls_length_value(m_params, BigInt::encode(dh->get_domain().get_g()), 2); diff --git a/src/lib/tls/tls_alert.h b/src/lib/tls/tls_alert.h index 2c82514a3..1184c6260 100644 --- a/src/lib/tls/tls_alert.h +++ b/src/lib/tls/tls_alert.h @@ -92,7 +92,7 @@ class BOTAN_DLL Alert * Deserialize an Alert message * @param buf the serialized alert */ - Alert(const secure_vector<byte>& buf); + explicit Alert(const secure_vector<byte>& buf); /** * Create a new Alert diff --git a/src/lib/tls/tls_exceptn.h b/src/lib/tls/tls_exceptn.h index 509226094..2ed5b685c 100644 --- a/src/lib/tls/tls_exceptn.h +++ b/src/lib/tls/tls_exceptn.h @@ -36,7 +36,7 @@ class BOTAN_DLL TLS_Exception : public Exception */ struct BOTAN_DLL Unexpected_Message : public TLS_Exception { - Unexpected_Message(const std::string& err) : + explicit Unexpected_Message(const std::string& err) : TLS_Exception(Alert::UNEXPECTED_MESSAGE, err) {} }; diff --git a/src/lib/tls/tls_extensions.h b/src/lib/tls/tls_extensions.h index 5a8aff9de..a5aac0020 100644 --- a/src/lib/tls/tls_extensions.h +++ b/src/lib/tls/tls_extensions.h @@ -79,7 +79,7 @@ class Server_Name_Indicator final : public Extension Handshake_Extension_Type type() const override { return static_type(); } - Server_Name_Indicator(const std::string& host_name) : + explicit Server_Name_Indicator(const std::string& host_name) : m_sni_host_name(host_name) {} Server_Name_Indicator(TLS_Data_Reader& reader, @@ -106,7 +106,7 @@ class SRP_Identifier final : public Extension Handshake_Extension_Type type() const override { return static_type(); } - SRP_Identifier(const std::string& identifier) : + explicit SRP_Identifier(const std::string& identifier) : m_srp_identifier(identifier) {} SRP_Identifier(TLS_Data_Reader& reader, @@ -135,7 +135,7 @@ class Renegotiation_Extension final : public Extension Renegotiation_Extension() {} - Renegotiation_Extension(const std::vector<byte>& bits) : + explicit Renegotiation_Extension(const std::vector<byte>& bits) : m_reneg_data(bits) {} Renegotiation_Extension(TLS_Data_Reader& reader, @@ -168,13 +168,13 @@ class Application_Layer_Protocol_Notification final : public Extension /** * Single protocol, used by server */ - Application_Layer_Protocol_Notification(const std::string& protocol) : + explicit Application_Layer_Protocol_Notification(const std::string& protocol) : m_protocols(1, protocol) {} /** * List of protocols, used by client */ - Application_Layer_Protocol_Notification(const std::vector<std::string>& protocols) : + explicit Application_Layer_Protocol_Notification(const std::vector<std::string>& protocols) : m_protocols(protocols) {} Application_Layer_Protocol_Notification(TLS_Data_Reader& reader, @@ -211,7 +211,7 @@ class Session_Ticket final : public Extension /** * Extension with ticket, used by client */ - Session_Ticket(const std::vector<byte>& session_ticket) : + explicit Session_Ticket(const std::vector<byte>& session_ticket) : m_ticket(session_ticket) {} /** @@ -244,7 +244,7 @@ class Supported_Elliptic_Curves final : public Extension std::vector<byte> serialize() const override; - Supported_Elliptic_Curves(const std::vector<std::string>& curves) : + explicit Supported_Elliptic_Curves(const std::vector<std::string>& curves) : m_curves(curves) {} Supported_Elliptic_Curves(TLS_Data_Reader& reader, @@ -285,7 +285,7 @@ class Signature_Algorithms final : public Extension Signature_Algorithms(const std::vector<std::string>& hashes, const std::vector<std::string>& sig_algos); - Signature_Algorithms(const std::vector<std::pair<std::string, std::string> >& algos) : + explicit Signature_Algorithms(const std::vector<std::pair<std::string, std::string> >& algos) : m_supported_algos(algos) {} Signature_Algorithms(TLS_Data_Reader& reader, @@ -311,9 +311,9 @@ class SRTP_Protection_Profiles final : public Extension bool empty() const override { return m_pp.empty(); } - SRTP_Protection_Profiles(const std::vector<u16bit>& pp) : m_pp(pp) {} + explicit SRTP_Protection_Profiles(const std::vector<u16bit>& pp) : m_pp(pp) {} - SRTP_Protection_Profiles(u16bit pp) : m_pp(1, pp) {} + explicit SRTP_Protection_Profiles(u16bit pp) : m_pp(1, pp) {} SRTP_Protection_Profiles(TLS_Data_Reader& reader, u16bit extension_size); private: @@ -377,7 +377,7 @@ class Extensions Extensions() {} - Extensions(TLS_Data_Reader& reader) { deserialize(reader); } + explicit Extensions(TLS_Data_Reader& reader) { deserialize(reader); } private: Extensions(const Extensions&) {} diff --git a/src/lib/tls/tls_handshake_io.h b/src/lib/tls/tls_handshake_io.h index f2bb2ac71..601ac41d9 100644 --- a/src/lib/tls/tls_handshake_io.h +++ b/src/lib/tls/tls_handshake_io.h @@ -67,7 +67,7 @@ class Stream_Handshake_IO final : public Handshake_IO public: typedef std::function<void (byte, const std::vector<byte>&)> writer_fn; - Stream_Handshake_IO(writer_fn writer) : m_send_hs(writer) {} + explicit Stream_Handshake_IO(writer_fn writer) : m_send_hs(writer) {} Protocol_Version initial_record_version() const override; diff --git a/src/lib/tls/tls_messages.h b/src/lib/tls/tls_messages.h index c648df720..281333f88 100644 --- a/src/lib/tls/tls_messages.h +++ b/src/lib/tls/tls_messages.h @@ -46,7 +46,7 @@ class Hello_Verify_Request final : public Handshake_Message std::vector<byte> cookie() const { return m_cookie; } - Hello_Verify_Request(const std::vector<byte>& buf); + explicit Hello_Verify_Request(const std::vector<byte>& buf); Hello_Verify_Request(const std::vector<byte>& client_hello_bits, const std::string& client_identity, @@ -178,7 +178,7 @@ class Client_Hello final : public Handshake_Message const Session& resumed_session, const std::vector<std::string>& next_protocols); - Client_Hello(const std::vector<byte>& buf); + explicit Client_Hello(const std::vector<byte>& buf); private: std::vector<byte> serialize() const override; @@ -279,7 +279,7 @@ class Server_Hello final : public Handshake_Message bool offer_session_ticket, const std::string& next_protocol); - Server_Hello(const std::vector<byte>& buf); + explicit Server_Hello(const std::vector<byte>& buf); private: std::vector<byte> serialize() const override; @@ -341,7 +341,7 @@ class Certificate final : public Handshake_Message Handshake_Hash& hash, const std::vector<X509_Certificate>& certs); - Certificate(const std::vector<byte>& buf); + explicit Certificate(const std::vector<byte>& buf); private: std::vector<byte> serialize() const override; @@ -431,7 +431,7 @@ class Finished final : public Handshake_Message Handshake_State& state, Connection_Side side); - Finished(const std::vector<byte>& buf); + explicit Finished(const std::vector<byte>& buf); private: std::vector<byte> serialize() const override; @@ -446,8 +446,8 @@ class Hello_Request final : public Handshake_Message public: Handshake_Type type() const override { return HELLO_REQUEST; } - Hello_Request(Handshake_IO& io); - Hello_Request(const std::vector<byte>& buf); + explicit Hello_Request(Handshake_IO& io); + explicit Hello_Request(const std::vector<byte>& buf); private: std::vector<byte> serialize() const override; }; @@ -514,7 +514,7 @@ class Server_Hello_Done final : public Handshake_Message Handshake_Type type() const override { return SERVER_HELLO_DONE; } Server_Hello_Done(Handshake_IO& io, Handshake_Hash& hash); - Server_Hello_Done(const std::vector<byte>& buf); + explicit Server_Hello_Done(const std::vector<byte>& buf); private: std::vector<byte> serialize() const override; }; @@ -538,7 +538,7 @@ class New_Session_Ticket final : public Handshake_Message New_Session_Ticket(Handshake_IO& io, Handshake_Hash& hash); - New_Session_Ticket(const std::vector<byte>& buf); + explicit New_Session_Ticket(const std::vector<byte>& buf); private: std::vector<byte> serialize() const override; diff --git a/src/lib/tls/tls_policy.h b/src/lib/tls/tls_policy.h index c1f40df17..032de81ad 100644 --- a/src/lib/tls/tls_policy.h +++ b/src/lib/tls/tls_policy.h @@ -300,13 +300,13 @@ class BOTAN_DLL Text_Policy : public Policy void set(const std::string& k, const std::string& v) { m_kv[k] = v; } - Text_Policy(const std::string& s) + explicit Text_Policy(const std::string& s) { std::istringstream iss(s); m_kv = read_cfg(iss); } - Text_Policy(std::istream& in) + explicit Text_Policy(std::istream& in) { m_kv = read_cfg(in); } diff --git a/src/lib/tls/tls_session.h b/src/lib/tls/tls_session.h index 0e22037f6..8ca646cf2 100644 --- a/src/lib/tls/tls_session.h +++ b/src/lib/tls/tls_session.h @@ -65,7 +65,7 @@ class BOTAN_DLL Session /** * Load a session from PEM representation (created by PEM_encode) */ - Session(const std::string& pem); + explicit Session(const std::string& pem); /** * Encode this session data for storage |