aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-07-29 18:06:38 +0000
committerlloyd <[email protected]>2012-07-29 18:06:38 +0000
commit4d1a2462a3c78a94e3c38e2256767766c09ff244 (patch)
tree706f1a65f15913a26e9b275524e20dd0548cdf77
parent0382d7b09f6d1c7e406ea992a6230d0806ba0e63 (diff)
Rename activate to more descriptive change_cipher_spec
-rw-r--r--src/tls/rec_read.cpp8
-rw-r--r--src/tls/rec_wri.cpp8
-rw-r--r--src/tls/tls_client.cpp18
-rw-r--r--src/tls/tls_record.h17
-rw-r--r--src/tls/tls_server.cpp18
5 files changed, 41 insertions, 28 deletions
diff --git a/src/tls/rec_read.cpp b/src/tls/rec_read.cpp
index 5f01ef719..0c240a9ef 100644
--- a/src/tls/rec_read.cpp
+++ b/src/tls/rec_read.cpp
@@ -70,10 +70,10 @@ Protocol_Version Record_Reader::get_version() const
/*
* Set the keys for reading
*/
-void Record_Reader::activate(Connection_Side side,
- const Ciphersuite& suite,
- const Session_Keys& keys,
- byte compression_method)
+void Record_Reader::change_cipher_spec(Connection_Side side,
+ const Ciphersuite& suite,
+ const Session_Keys& keys,
+ byte compression_method)
{
m_cipher.reset();
delete m_mac;
diff --git a/src/tls/rec_wri.cpp b/src/tls/rec_wri.cpp
index 2523f8229..b21c7fe34 100644
--- a/src/tls/rec_wri.cpp
+++ b/src/tls/rec_wri.cpp
@@ -71,10 +71,10 @@ void Record_Writer::set_version(Protocol_Version version)
/*
* Set the keys for writing
*/
-void Record_Writer::activate(Connection_Side side,
- const Ciphersuite& suite,
- const Session_Keys& keys,
- byte compression_method)
+void Record_Writer::change_cipher_spec(Connection_Side side,
+ const Ciphersuite& suite,
+ const Session_Keys& keys,
+ byte compression_method)
{
m_cipher.reset();
delete m_mac;
diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp
index 4db5002cd..17a7879d6 100644
--- a/src/tls/tls_client.cpp
+++ b/src/tls/tls_client.cpp
@@ -379,8 +379,10 @@ void Client::process_handshake_msg(Handshake_Type type,
m_writer.send(CHANGE_CIPHER_SPEC, 1);
- m_writer.activate(CLIENT, m_state->suite, m_state->keys,
- m_state->server_hello->compression_method());
+ m_writer.change_cipher_spec(CLIENT,
+ m_state->suite,
+ m_state->keys,
+ m_state->server_hello->compression_method());
if(m_state->server_hello->next_protocol_notification())
{
@@ -408,8 +410,10 @@ void Client::process_handshake_msg(Handshake_Type type,
{
m_state->set_expected_next(FINISHED);
- m_reader.activate(CLIENT, m_state->suite, m_state->keys,
- m_state->server_hello->compression_method());
+ m_reader.change_cipher_spec(CLIENT,
+ m_state->suite,
+ m_state->keys,
+ m_state->server_hello->compression_method());
}
else if(type == FINISHED)
{
@@ -427,8 +431,10 @@ void Client::process_handshake_msg(Handshake_Type type,
{
m_writer.send(CHANGE_CIPHER_SPEC, 1);
- m_writer.activate(CLIENT, m_state->suite, m_state->keys,
- m_state->server_hello->compression_method());
+ m_writer.change_cipher_spec(CLIENT,
+ m_state->suite,
+ m_state->keys,
+ m_state->server_hello->compression_method());
m_state->client_finished = new Finished(m_state->handshake_writer(),
m_state.get(), CLIENT);
diff --git a/src/tls/tls_record.h b/src/tls/tls_record.h
index 924d25f80..fa5da52b4 100644
--- a/src/tls/tls_record.h
+++ b/src/tls/tls_record.h
@@ -30,6 +30,7 @@ class BOTAN_DLL Record_Writer
{
public:
void send(byte type, const byte input[], size_t length);
+
void send(byte type, byte val) { send(type, &val, 1); }
void send(byte type, const std::vector<byte>& input)
@@ -37,10 +38,10 @@ class BOTAN_DLL Record_Writer
void send_alert(const Alert& alert);
- void activate(Connection_Side side,
- const Ciphersuite& suite,
- const Session_Keys& keys,
- byte compression_method);
+ void change_cipher_spec(Connection_Side side,
+ const Ciphersuite& suite,
+ const Session_Keys& keys,
+ byte compression_method);
void set_version(Protocol_Version version);
@@ -95,10 +96,10 @@ class BOTAN_DLL Record_Reader
byte& msg_type,
std::vector<byte>& msg);
- void activate(Connection_Side side,
- const Ciphersuite& suite,
- const Session_Keys& keys,
- byte compression_method);
+ void change_cipher_spec(Connection_Side side,
+ const Ciphersuite& suite,
+ const Session_Keys& keys,
+ byte compression_method);
void set_version(Protocol_Version version);
diff --git a/src/tls/tls_server.cpp b/src/tls/tls_server.cpp
index 386e5fcf6..0f1b24045 100644
--- a/src/tls/tls_server.cpp
+++ b/src/tls/tls_server.cpp
@@ -439,8 +439,10 @@ void Server::process_handshake_msg(Handshake_Type type,
m_writer.send(CHANGE_CIPHER_SPEC, 1);
- m_writer.activate(SERVER, m_state->suite, m_state->keys,
- m_state->server_hello->compression_method());
+ m_writer.change_cipher_spec(SERVER,
+ m_state->suite,
+ m_state->keys,
+ m_state->server_hello->compression_method());
m_state->server_finished = new Finished(m_state->handshake_writer(),
m_state.get(), SERVER);
@@ -625,8 +627,10 @@ void Server::process_handshake_msg(Handshake_Type type,
else
m_state->set_expected_next(FINISHED);
- m_reader.activate(SERVER, m_state->suite, m_state->keys,
- m_state->server_hello->compression_method());
+ m_reader.change_cipher_spec(SERVER,
+ m_state->suite,
+ m_state->keys,
+ m_state->server_hello->compression_method());
}
else if(type == NEXT_PROTOCOL)
{
@@ -696,8 +700,10 @@ void Server::process_handshake_msg(Handshake_Type type,
m_writer.send(CHANGE_CIPHER_SPEC, 1);
- m_writer.activate(SERVER, m_state->suite, m_state->keys,
- m_state->server_hello->compression_method());
+ m_writer.change_cipher_spec(SERVER,
+ m_state->suite,
+ m_state->keys,
+ m_state->server_hello->compression_method());
m_state->server_finished = new Finished(m_state->handshake_writer(),
m_state.get(), SERVER);