]> git.sesse.net Git - vlc/commitdiff
gnutls: fix flawed logic
authorRémi Denis-Courmont <remi@remlab.net>
Fri, 22 Aug 2014 20:22:44 +0000 (23:22 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Fri, 22 Aug 2014 20:34:21 +0000 (23:34 +0300)
val is always zero in the removed code; the verification status is what
actually matters.

modules/misc/gnutls.c

index 83d154f46e76bee31acb8b7ffb6e6db822d5342b..da6c0e571663ba3045ef84635ebd0491f6624e7e 100644 (file)
@@ -378,6 +378,9 @@ static int gnutls_HandshakeAndValidate (vlc_tls_t *session, const char *host,
             return -1;
     }
 
+    if (host == NULL)
+        return status ? -1 : 0;
+
     /* certificate (host)name verification */
     const gnutls_datum_t *data;
     unsigned count;
@@ -389,8 +392,6 @@ static int gnutls_HandshakeAndValidate (vlc_tls_t *session, const char *host,
     }
     msg_Dbg (session, "%u certificate(s) in the list", count);
 
-    if (val || host == NULL)
-        return val;
     if (status && gnutls_CertSearch (session, host, service, data))
         return -1;