]> sjero.net Git - wget/blobdiff - src/openssl.c
[svn] Remove K&R support.
[wget] / src / openssl.c
index a16b9b79df9ec8ed0b64f10cc6a595addc0794ef..5850b96f7733d3ba4d13acf82a5131719ba9b4c5 100644 (file)
@@ -35,11 +35,7 @@ so, delete this exception statement from your version.  */
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
 
 #include <openssl/ssl.h>
 #include <openssl/x509.h>
@@ -52,10 +48,6 @@ so, delete this exception statement from your version.  */
 #include "url.h"
 #include "ssl.h"
 
-#ifndef errno
-extern int errno;
-#endif
-
 /* Application-wide SSL context.  This is common to all SSL
    connections.  */
 SSL_CTX *ssl_ctx;
@@ -427,7 +419,7 @@ ssl_check_certificate (int fd, const char *host)
       logprintf (LOG_NOTQUIET, _("%s: No certificate presented by %s.\n"),
                 severity, escnonprint (host));
       success = 0;
-      goto out;                        /* must bail out since CERT is NULL */
+      goto no_cert;            /* must bail out since CERT is NULL */
     }
 
 #ifdef ENABLE_DEBUG
@@ -474,8 +466,8 @@ ssl_check_certificate (int fd, const char *host)
        common names and choose the most specific one, i.e. the last
        one, not the first one, which the current code picks.
 
-     - Make sure that the names are encoded as UTF-8 which, being
-       ASCII-compatible, can be easily compared against HOST.  */
+     - Ensure that ASN1 strings from the certificate are encoded as
+       UTF-8 which can be meaningfully compared to HOST.  */
 
   common_name[0] = '\0';
   X509_NAME_get_text_by_NID (X509_get_subject_name (cert),
@@ -493,7 +485,7 @@ ssl_check_certificate (int fd, const char *host)
             escnonprint (host)));
   X509_free (cert);
 
out:
no_cert:
   if (opt.check_cert && !success)
     logprintf (LOG_NOTQUIET, _("\
 To connect to %s insecurely, use `--no-check-certificate'.\n"),