aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_server.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-08-05 14:25:28 +0000
committerlloyd <[email protected]>2012-08-05 14:25:28 +0000
commitde2d1a699748c4cbd6f8bc8aaa67e02826108125 (patch)
tree9c9fe35db7b742a6d0e608d2639f53aaf464a4c5 /src/tls/tls_server.cpp
parent1811a8ab7fd607d69d7881055a5c74cb48e362fd (diff)
Remove Channel::read_handshake. Have the server set expected next msg
in new_handshake_state.
Diffstat (limited to 'src/tls/tls_server.cpp')
-rw-r--r--src/tls/tls_server.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/tls/tls_server.cpp b/src/tls/tls_server.cpp
index 9c6250273..25716c144 100644
--- a/src/tls/tls_server.cpp
+++ b/src/tls/tls_server.cpp
@@ -207,7 +207,9 @@ Server::Server(std::function<void (const byte[], size_t)> output_fn,
Handshake_State* Server::new_handshake_state()
{
- return new Handshake_State(new Stream_Handshake_IO(m_writer));
+ Handshake_State* state = new Handshake_State(new Stream_Handshake_IO(m_writer));
+ state->set_expected_next(CLIENT_HELLO);
+ return state;
}
/*
@@ -219,9 +221,8 @@ void Server::renegotiate(bool force_full_renegotiation)
return; // currently in handshake
m_state.reset(new_handshake_state());
-
m_state->allow_session_resumption = !force_full_renegotiation;
- m_state->set_expected_next(CLIENT_HELLO);
+
Hello_Request hello_req(m_state->handshake_io());
}
@@ -235,21 +236,6 @@ void Server::alert_notify(const Alert& alert)
}
/*
-* Split up and process handshake messages
-*/
-void Server::read_handshake(byte rec_type,
- const std::vector<byte>& rec_buf)
- {
- if(rec_type == HANDSHAKE && !m_state)
- {
- m_state.reset(new_handshake_state());
- m_state->set_expected_next(CLIENT_HELLO);
- }
-
- Channel::read_handshake(rec_type, rec_buf);
- }
-
-/*
* Process a handshake message
*/
void Server::process_handshake_msg(Handshake_Type type,