]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
cmp_hsk_types: fixed check for SSLv2 hello
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 27 Sep 2017 11:25:02 +0000 (13:25 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Sun, 15 Oct 2017 08:30:17 +0000 (10:30 +0200)
Previously, if SSLv2 hello support was disabled, the check for
the expected TLS message was incorrect.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/buffers.c

index 1c1e5531fd3e0da2143581299f41fef25b76a7a6..414ea503076d4df3540a9c109d0e15a15591b590 100644 (file)
@@ -1074,12 +1074,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;