aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-07-28 22:25:12 +0000
committerlloyd <[email protected]>2012-07-28 22:25:12 +0000
commit368ebec8078f61abce34488cfbdf4e6d6a464851 (patch)
tree1d9d03986a46e628177b0804be1379d42dc5c6fc /src/tls
parent3a97773e0e56a7568cc11821fb347fed3fdb7b92 (diff)
Pass protocol to initiate_handshake
Diffstat (limited to 'src/tls')
-rw-r--r--src/tls/tls_client.cpp11
-rw-r--r--src/tls/tls_client.h1
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<void (const byte[], size_t)> 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<std::string (std::vector<std::string>)> 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<std::string (std::vector<std::string>)> next_protocol =
std::function<std::string (std::vector<std::string>)>());