summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-09-27 13:25:02 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-10-15 10:31:26 +0200
commita7f790e5707e46d6251fad3ec3e18c9f3844ce11 (patch)
treefb9b64c9fc182323943849f325559a75fe28fae7
parenta6ba4897de236c7f257c1dead299d4be1604e039 (diff)
downloadgnutls-a7f790e5707e46d6251fad3ec3e18c9f3844ce11.tar.gz
cmp_hsk_types: fixed check for SSLv2 hello
Previously, if SSLv2 hello support was disabled, the check for the expected TLS message was incorrect. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/buffers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/buffers.c b/lib/buffers.c
index e42bcd4f86..b54a295bb4 100644
--- a/lib/buffers.c
+++ b/lib/buffers.c
@@ -1077,12 +1077,12 @@ static int merge_handshake_packet(gnutls_session_t session,
inline static int cmp_hsk_types(gnutls_handshake_description_t expected,
gnutls_handshake_description_t recvd)
{
- if ((expected != GNUTLS_HANDSHAKE_CLIENT_HELLO
#ifdef ENABLE_SSL2
- || recvd != GNUTLS_HANDSHAKE_CLIENT_HELLO_V2
+ if (expected == GNUTLS_HANDSHAKE_CLIENT_HELLO
+ && recvd == GNUTLS_HANDSHAKE_CLIENT_HELLO_V2)
+ return 1;
#endif
- )
- && (expected != recvd))
+ if (expected != recvd)
return 0;
return 1;