aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_server.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-07-09 21:50:41 +0000
committerlloyd <[email protected]>2012-07-09 21:50:41 +0000
commit18a0c6d0b77985d85a22fed8afa3df14de590ca5 (patch)
tree87655683f34dfa26100bf0b5bcbccde71eadac1a /src/tls/tls_server.cpp
parent0dffe4ce78737a8d2d2861621705728c2b08c279 (diff)
Add TLS::Channel::new_handshake_state which abstracts creating the
handshaking state.
Diffstat (limited to 'src/tls/tls_server.cpp')
-rw-r--r--src/tls/tls_server.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tls/tls_server.cpp b/src/tls/tls_server.cpp
index d2a51fabd..e89ec7b4a 100644
--- a/src/tls/tls_server.cpp
+++ b/src/tls/tls_server.cpp
@@ -200,6 +200,11 @@ Server::Server(std::function<void (const byte[], size_t)> output_fn,
{
}
+Handshake_State* Server::new_handshake_state() const
+ {
+ return new Handshake_State(new Stream_Handshake_Reader);
+ }
+
/*
* Send a hello request to the client
*/
@@ -208,7 +213,7 @@ void Server::renegotiate(bool force_full_renegotiation)
if(m_state)
return; // currently in handshake
- m_state = new Handshake_State(new Stream_Handshake_Reader);
+ m_state = new_handshake_state();
m_state->allow_session_resumption = !force_full_renegotiation;
m_state->set_expected_next(CLIENT_HELLO);
@@ -235,7 +240,7 @@ void Server::read_handshake(byte rec_type,
{
if(rec_type == HANDSHAKE && !m_state)
{
- m_state = new Handshake_State(new Stream_Handshake_Reader);
+ m_state = new_handshake_state();
m_state->set_expected_next(CLIENT_HELLO);
}