From ce488f91800e0d53ef833ddd29b2086bf2febae2 Mon Sep 17 00:00:00 2001 From: olereinhardt Date: Wed, 24 Sep 2014 10:19:21 +0000 Subject: [PATCH] Fix handling of return values of SOCKET_READ in process_sslv23_client_hello() git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@233 9a5d90b5-6617-0410-8a86-bb477d3ed2e3 --- ssl/tls1_svr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssl/tls1_svr.c b/ssl/tls1_svr.c index 1a99ac1fa..1717ceff3 100644 --- a/ssl/tls1_svr.c +++ b/ssl/tls1_svr.c @@ -198,14 +198,14 @@ int process_sslv23_client_hello(SSL *ssl) DISPLAY_BYTES(ssl, "received %d bytes", buf, read_len, read_len); - add_packet(ssl, buf, read_len); - /* connection has gone, so die */ - if (bytes_needed < 0) + if (read_len < 0) { return SSL_ERROR_CONN_LOST; } + add_packet(ssl, buf, read_len); + /* now work out what cipher suite we are going to use */ for (j = 0; j < NUM_PROTOCOLS; j++) {