aboutsummaryrefslogtreecommitdiffstats
path: root/src/ssl/tls_server.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-04-17 21:28:30 +0000
committerlloyd <[email protected]>2010-04-17 21:28:30 +0000
commitee353b33dae5fd2a664ac56556e2037284735a47 (patch)
treee36be6f9a35ec5e0ae08216d8a3ce5339c21868f /src/ssl/tls_server.cpp
parentaaa9e92697e16278fb91552f075c020f2b4c26cb (diff)
Add support for reading SSLv2 client hellos
Diffstat (limited to 'src/ssl/tls_server.cpp')
-rw-r--r--src/ssl/tls_server.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/ssl/tls_server.cpp b/src/ssl/tls_server.cpp
index 4e9c3583f..1c8d28c95 100644
--- a/src/ssl/tls_server.cpp
+++ b/src/ssl/tls_server.cpp
@@ -43,7 +43,7 @@ void server_check_state(Handshake_Type new_msg, Handshake_State* state)
Unexpected_Message("State transition error from " + err) {}
};
- if(new_msg == CLIENT_HELLO)
+ if(new_msg == CLIENT_HELLO || new_msg == CLIENT_HELLO_SSLV2)
{
if(state->server_hello)
throw State_Transition_Error("ClientHello");
@@ -330,18 +330,23 @@ void TLS_Server::process_handshake_msg(Handshake_Type type,
if(type != HANDSHAKE_CCS && type != FINISHED)
{
- state->hash.update(static_cast<byte>(type));
- u32bit record_length = contents.size();
- for(u32bit j = 0; j != 3; j++)
- state->hash.update(get_byte(j+1, record_length));
+
+ if(type != CLIENT_HELLO_SSLV2)
+ {
+ state->hash.update(static_cast<byte>(type));
+ u32bit record_length = contents.size();
+ for(u32bit j = 0; j != 3; j++)
+ state->hash.update(get_byte(j+1, record_length));
+ }
+
state->hash.update(contents);
}
- if(type == CLIENT_HELLO)
+ if(type == CLIENT_HELLO || type == CLIENT_HELLO_SSLV2)
{
server_check_state(type, state);
- state->client_hello = new Client_Hello(contents);
+ state->client_hello = new Client_Hello(contents, type);
client_requested_hostname = state->client_hello->hostname();