Commit be72eaa3 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

use Curl_strcasestr() when checking wildcard cert names

parent 61bded1d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
#include "inet_pton.h"
#include "ssluse.h"
#include "connect.h" /* Curl_ourerrno() proto */
#include "strequal.h"

#ifdef USE_SSLEAY
#include <openssl/rand.h>
@@ -754,8 +755,8 @@ cert_hostcheck(const char *certname, const char *hostname)
  if(!strchr(certdomain+1, '.'))
    return 0; /* the certificate must have at least another dot in its name */

  /* find 'certdomain' within 'hostname' */
  tmp = strstr(hostname, certdomain);
  /* find 'certdomain' within 'hostname', case insensitive */
  tmp = Curl_strcasestr(hostname, certdomain);
  if(tmp) {
    /* ok the certname's domain matches the hostname, let's check that it's a
       tail-match */