aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_client.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-06-09 03:48:30 +0000
committerlloyd <[email protected]>2012-06-09 03:48:30 +0000
commitd8f1ea81916a8230d8148fce0219beaf67bd0ba6 (patch)
tree5bee8e92f84eede322fdc01876a7a0f0553aa960 /src/tls/tls_client.cpp
parenta4b2dba2bfea267e1a1535fbe33103f4c2153724 (diff)
A fix for bug 192. First, when renegotiating in the client, attempt to
renegotiate using our currently negotiated version instead of our preferred version. It turns out that neither OpenSSL nor GnuTLS like clients changing the version between negotiations, both send a protocol_version alert. So we probably want to avoid doing that. On the server side, handle a client sending inconsistent versions as best we can. If the client attmepts to renegotiate a session using a later version, return a server hello with their original version (this is what OpenSSL does). If they attempt to renegotiate using an earlier version, send a fatal alert and close the connection, since this seems like a dubious thing to do. Also, fix the situation where we as a TLS v1.0 server (because of configuration) are talking to a TLS v1.2 client. We would still use their signature_algorithms extension and send a SHA-256 (or whatever) signature!
Diffstat (limited to 'src/tls/tls_client.cpp')
-rw-r--r--src/tls/tls_client.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp
index d19249d68..ec3d9953f 100644
--- a/src/tls/tls_client.cpp
+++ b/src/tls/tls_client.cpp
@@ -71,6 +71,7 @@ Client::Client(std::function<void (const byte[], size_t)> output_fn,
state->client_hello = new Client_Hello(
writer,
state->hash,
+ policy.pref_version(),
policy,
rng,
secure_renegotiation.for_client_hello(),
@@ -117,6 +118,7 @@ void Client::renegotiate(bool force_full_renegotiation)
state->client_hello = new Client_Hello(
writer,
state->hash,
+ reader.get_version(),
policy,
rng,
secure_renegotiation.for_client_hello());