]> granicus.if.org Git - neomutt/commitdiff
hostname_match
authorRichard Russon <rich@flatcap.org>
Mon, 10 Apr 2017 16:41:09 +0000 (17:41 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 11 Apr 2017 23:29:59 +0000 (00:29 +0100)
mutt_ssl.c

index 99b126d1409d48c3108a4e1f09e97e6676827a15..0375c10b294a465db61e9d6339d9ae5330b1750e 100644 (file)
@@ -412,7 +412,7 @@ static bool check_certificate_expiration (X509 *peercert, bool silent)
 }
 
 /* port to mutt from msmtp's tls.c */
-static int hostname_match (const char *hostname, const char *certname)
+static bool hostname_match (const char *hostname, const char *certname)
 {
   const char *cmp1 = NULL, *cmp2 = NULL;
 
@@ -422,7 +422,7 @@ static int hostname_match (const char *hostname, const char *certname)
     cmp2 = strchr(hostname, '.');
     if (!cmp2)
     {
-      return 0;
+      return false;
     }
     else
     {
@@ -437,15 +437,15 @@ static int hostname_match (const char *hostname, const char *certname)
 
   if (*cmp1 == '\0' || *cmp2 == '\0')
   {
-    return 0;
+    return false;
   }
 
   if (strcasecmp(cmp1, cmp2) != 0)
   {
-    return 0;
+    return false;
   }
 
-  return 1;
+  return true;
 }
 
 /*
@@ -640,7 +640,7 @@ static int check_host (X509 *x509cert, const char *hostname, char *err, size_t e
   int subj_alt_names_count;
   GENERAL_NAME *subj_alt_name = NULL;
   /* did we find a name matching hostname? */
-  int match_found;
+  bool match_found;
 
   /* Check if 'hostname' matches the one of the subjectAltName extensions of
    * type DNS or the Common Name (CN). */