Commit 2be9caa6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

gnutls: fix flawed logic

val is always zero in the removed code; the verification status is what
actually matters.

(cherry picked from commit 52500eb759c39c75cc98338cdb65ea64873fb09c)
parent 96b91c15
...@@ -378,6 +378,9 @@ static int gnutls_HandshakeAndValidate (vlc_tls_t *session, const char *host, ...@@ -378,6 +378,9 @@ static int gnutls_HandshakeAndValidate (vlc_tls_t *session, const char *host,
return -1; return -1;
} }
if (host == NULL)
return status ? -1 : 0;
/* certificate (host)name verification */ /* certificate (host)name verification */
const gnutls_datum_t *data; const gnutls_datum_t *data;
unsigned count; unsigned count;
...@@ -389,8 +392,6 @@ static int gnutls_HandshakeAndValidate (vlc_tls_t *session, const char *host, ...@@ -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); msg_Dbg (session, "%u certificate(s) in the list", count);
if (val || host == NULL)
return val;
if (status && gnutls_CertSearch (session, host, service, data)) if (status && gnutls_CertSearch (session, host, service, data))
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment