From 368ebec8078f61abce34488cfbdf4e6d6a464851 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sat, 28 Jul 2012 22:25:12 +0000 Subject: Pass protocol to initiate_handshake --- src/tls/tls_client.cpp | 11 ++++++----- src/tls/tls_client.h | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp index 8a7492d8e..1fd4e0383 100644 --- a/src/tls/tls_client.cpp +++ b/src/tls/tls_client.cpp @@ -39,7 +39,8 @@ Client::Client(std::function output_fn, const std::string srp_identifier = m_creds.srp_identifier("tls-client", m_hostname); - initiate_handshake(false, srp_identifier, next_protocol); + const Protocol_Version version = m_policy.pref_version(); + initiate_handshake(false, version, srp_identifier, next_protocol); } Handshake_State* Client::new_handshake_state() @@ -58,10 +59,13 @@ void Client::renegotiate(bool force_full_renegotiation) delete m_state; - initiate_handshake(force_full_renegotiation); + const Protocol_Version version = m_reader.get_version(); + + initiate_handshake(force_full_renegotiation, version); } void Client::initiate_handshake(bool force_full_renegotiation, + Protocol_Version version, const std::string& srp_identifier, std::function)> next_protocol) { @@ -93,9 +97,6 @@ void Client::initiate_handshake(bool force_full_renegotiation, } } - const Protocol_Version version = m_reader.get_version().valid() ? - m_reader.get_version() : m_policy.pref_version(); - if(!m_state->client_hello) // not resuming { m_state->client_hello = new Client_Hello( diff --git a/src/tls/tls_client.h b/src/tls/tls_client.h index f8af662d3..a803df32d 100644 --- a/src/tls/tls_client.h +++ b/src/tls/tls_client.h @@ -69,6 +69,7 @@ class BOTAN_DLL Client : public Channel void renegotiate(bool force_full_renegotiation = false) override; private: void initiate_handshake(bool force_full_renegotiation, + Protocol_Version version, const std::string& srp_identifier = "", std::function)> next_protocol = std::function)>()); -- cgit v1.2.3