diff options
author | lloyd <[email protected]> | 2011-12-30 20:20:42 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-12-30 20:20:42 +0000 |
commit | deb92d7f6d43206c04f332625d6b1e1a2abc444d (patch) | |
tree | 06c331d7f51071750091e013c6f853c015eacd18 /src/tls/tls_client.cpp | |
parent | 766f5eeb5c99936e7ddcf3e4c82095f087b6e928 (diff) |
Add a function for getting the version number of an active connection.
Add a new callback that is called with the session info when a
handshake completes. Currently only called on the server side as
the client doesn't have session resumption yet.
Rename CipherSuite to TLS_Cipher_Suite.
Diffstat (limited to 'src/tls/tls_client.cpp')
-rw-r--r-- | src/tls/tls_client.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp index bd6b66ba0..5dbf9dc9c 100644 --- a/src/tls/tls_client.cpp +++ b/src/tls/tls_client.cpp @@ -19,17 +19,18 @@ namespace Botan { */ TLS_Client::TLS_Client(std::tr1::function<void (const byte[], size_t)> output_fn, std::tr1::function<void (const byte[], size_t, u16bit)> proc_fn, + std::tr1::function<void (const TLS_Session_Params&)> handshake_fn, TLS_Session_Manager& session_manager, const TLS_Policy& policy, RandomNumberGenerator& rng, const std::string& hostname, const std::string& srp_username) : - TLS_Channel(output_fn, proc_fn), + TLS_Channel(output_fn, proc_fn, handshake_fn), policy(policy), rng(rng), session_manager(session_manager) { - writer.set_version(policy.pref_version()); + writer.set_version(SSL_V3); state = new Handshake_State; state->set_expected_next(SERVER_HELLO); @@ -146,7 +147,7 @@ void TLS_Client::process_handshake_msg(Handshake_Type type, secure_renegotiation.update(state->server_hello); - state->suite = CipherSuite(state->server_hello->ciphersuite()); + state->suite = TLS_Cipher_Suite(state->server_hello->ciphersuite()); // if resuming, next is HANDSHAKE_CCS @@ -284,7 +285,7 @@ void TLS_Client::process_handshake_msg(Handshake_Type type, writer.send(CHANGE_CIPHER_SPEC, 1); - writer.set_keys(state->suite, state->keys, CLIENT); + writer.activate(state->suite, state->keys, CLIENT); state->client_finished = new Finished(writer, state->hash, state->version, CLIENT, @@ -294,7 +295,7 @@ void TLS_Client::process_handshake_msg(Handshake_Type type, { state->set_expected_next(FINISHED); - reader.set_keys(state->suite, state->keys, CLIENT); + reader.activate(state->suite, state->keys, CLIENT); } else if(type == FINISHED) { |