aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-07-12 22:49:57 +0000
committerlloyd <[email protected]>2012-07-12 22:49:57 +0000
commit8869d23625e774bedcd0921be2d3828592403290 (patch)
treea78fae11da8b4acfe80bab50359700ffa4b76641 /src/tls
parent389e815371681c5f076c0ff2563bf300789ff429 (diff)
Hook creating just the handshake reader vs the entire state
Diffstat (limited to 'src/tls')
-rw-r--r--src/tls/tls_channel.cpp2
-rw-r--r--src/tls/tls_channel.h2
-rw-r--r--src/tls/tls_client.cpp8
-rw-r--r--src/tls/tls_client.h2
-rw-r--r--src/tls/tls_server.cpp8
-rw-r--r--src/tls/tls_server.h2
6 files changed, 12 insertions, 12 deletions
diff --git a/src/tls/tls_channel.cpp b/src/tls/tls_channel.cpp
index 61dff6b03..84ee69e04 100644
--- a/src/tls/tls_channel.cpp
+++ b/src/tls/tls_channel.cpp
@@ -177,7 +177,7 @@ void Channel::read_handshake(byte rec_type,
if(rec_type == HANDSHAKE)
{
if(!m_state)
- m_state = new_handshake_state();
+ m_state = new Handshake_State(this->new_handshake_reader());
m_state->handshake_reader()->add_input(&rec_buf[0], rec_buf.size());
}
diff --git a/src/tls/tls_channel.h b/src/tls/tls_channel.h
index de232d042..ae4108e84 100644
--- a/src/tls/tls_channel.h
+++ b/src/tls/tls_channel.h
@@ -111,7 +111,7 @@ class BOTAN_DLL Channel
virtual void alert_notify(const Alert& alert) = 0;
- virtual class Handshake_State* new_handshake_state() const = 0;
+ virtual class Handshake_Reader* new_handshake_reader() const = 0;
class Secure_Renegotiation_State
{
diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp
index e4652fd7e..471cbefed 100644
--- a/src/tls/tls_client.cpp
+++ b/src/tls/tls_client.cpp
@@ -37,7 +37,7 @@ Client::Client(std::function<void (const byte[], size_t)> output_fn,
{
m_writer.set_version(Protocol_Version::SSL_V3);
- m_state = new_handshake_state();
+ m_state = new Handshake_State(this->new_handshake_reader());
m_state->set_expected_next(SERVER_HELLO);
m_state->client_npn_cb = next_protocol;
@@ -84,9 +84,9 @@ Client::Client(std::function<void (const byte[], size_t)> output_fn,
m_secure_renegotiation.update(m_state->client_hello);
}
-Handshake_State* Client::new_handshake_state() const
+Handshake_Reader* Client::new_handshake_reader() const
{
- return new Handshake_State(new Stream_Handshake_Reader);
+ return new Stream_Handshake_Reader;
}
/*
@@ -98,7 +98,7 @@ void Client::renegotiate(bool force_full_renegotiation)
return; // currently in active handshake
delete m_state;
- m_state = new_handshake_state();
+ m_state = new Handshake_State(this->new_handshake_reader());
m_state->set_expected_next(SERVER_HELLO);
diff --git a/src/tls/tls_client.h b/src/tls/tls_client.h
index dcd7aab83..b62e4aadf 100644
--- a/src/tls/tls_client.h
+++ b/src/tls/tls_client.h
@@ -73,7 +73,7 @@ class BOTAN_DLL Client : public Channel
void alert_notify(const Alert& alert) override;
- Handshake_State* new_handshake_state() const override;
+ class Handshake_Reader* new_handshake_reader() const override;
const Policy& m_policy;
RandomNumberGenerator& m_rng;
diff --git a/src/tls/tls_server.cpp b/src/tls/tls_server.cpp
index 20430be86..97db6934e 100644
--- a/src/tls/tls_server.cpp
+++ b/src/tls/tls_server.cpp
@@ -200,9 +200,9 @@ Server::Server(std::function<void (const byte[], size_t)> output_fn,
{
}
-Handshake_State* Server::new_handshake_state() const
+Handshake_Reader* Server::new_handshake_reader() const
{
- return new Handshake_State(new Stream_Handshake_Reader);
+ return new Stream_Handshake_Reader;
}
/*
@@ -213,7 +213,7 @@ void Server::renegotiate(bool force_full_renegotiation)
if(m_state)
return; // currently in handshake
- m_state = new_handshake_state();
+ m_state = new Handshake_State(this->new_handshake_reader());
m_state->allow_session_resumption = !force_full_renegotiation;
m_state->set_expected_next(CLIENT_HELLO);
@@ -240,7 +240,7 @@ void Server::read_handshake(byte rec_type,
{
if(rec_type == HANDSHAKE && !m_state)
{
- m_state = new_handshake_state();
+ m_state = new Handshake_State(this->new_handshake_reader());
m_state->set_expected_next(CLIENT_HELLO);
}
diff --git a/src/tls/tls_server.h b/src/tls/tls_server.h
index b2143b182..2d1502e1f 100644
--- a/src/tls/tls_server.h
+++ b/src/tls/tls_server.h
@@ -56,7 +56,7 @@ class BOTAN_DLL Server : public Channel
void alert_notify(const Alert& alert) override;
- Handshake_State* new_handshake_state() const override;
+ class Handshake_Reader* new_handshake_reader() const override;
const Policy& m_policy;
RandomNumberGenerator& m_rng;