$OpenBSD: patch-sslscan_c,v 1.9 2018/08/30 17:05:21 jsing Exp $

Index: sslscan.c
--- sslscan.c.orig
+++ sslscan.c
@@ -90,9 +90,7 @@
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 #include <openssl/ocsp.h>
-#ifdef __linux__
-    #include <arpa/inet.h>
-#endif
+#include <arpa/inet.h>
 #ifndef OPENSSL_NO_COMP
   #include <openssl/comp.h>
 #endif
@@ -488,18 +486,10 @@ int tcpConnect(struct sslCheckOptions *options)
         if (!readOrLogAndClose(socketDescriptor, buffer, BUFFERSIZE, options))
             return 0;
 
-#ifdef __USE_GNU
         if (memmem(buffer, BUFFERSIZE, ok, sizeof(ok))) {
-#else
-        if (strnstr(buffer, ok, BUFFERSIZE)) {
-#endif
             printf_verbose("STARTLS LDAP setup complete.\n");
         }
-#ifdef __USE_GNU
         else if (memmem(buffer, BUFFERSIZE, unsupported, sizeof(unsupported))) {
-#else
-        else if (strnstr(buffer, unsupported, BUFFERSIZE)) {
-#endif
             printf_error("%sSTARTLS LDAP connection to %s:%d failed with '%s'.%s\n",
                          COL_RED, options->host, options->port, unsupported, RESET);
             return 0;
@@ -2010,13 +2000,13 @@ int checkCertificate(struct sslCheckOptions *options, 
                                                 printf("Altnames: ");
                                                 if (!X509V3_EXT_print(stdoutBIO, extension, X509_FLAG_COMPAT, 0))
                                                 {
-                                                    M_ASN1_OCTET_STRING_print(stdoutBIO, extension->value);
+                                                    ASN1_STRING_print(stdoutBIO, extension->value);
                                                 }
                                                 if (options->xmlOutput)
                                                 {
                                                     printf_xml("   <altnames><![CDATA[");
                                                     if (!X509V3_EXT_print(fileBIO, extension, X509_FLAG_COMPAT, 0))
-                                                        M_ASN1_OCTET_STRING_print(fileBIO, extension->value);
+                                                        ASN1_STRING_print(fileBIO, extension->value);
                                                 }
                                                 printf_xml("]]></altnames>\n");
                                                 printf("\n");
@@ -2798,12 +2788,12 @@ int showCertificate(struct sslCheckOptions *options)
                                             if (!X509V3_EXT_print(stdoutBIO, extension, X509_FLAG_COMPAT, 8))
                                             {
                                                 printf("        ");
-                                                M_ASN1_OCTET_STRING_print(stdoutBIO, extension->value);
+                                                ASN1_STRING_print(stdoutBIO, extension->value);
                                             }
                                             if (options->xmlOutput)
                                             {
                                                 if (!X509V3_EXT_print(fileBIO, extension, X509_FLAG_COMPAT, 0))
-                                                    M_ASN1_OCTET_STRING_print(fileBIO, extension->value);
+                                                    ASN1_STRING_print(fileBIO, extension->value);
                                                 printf_xml("]]></extension>\n");
                                             }
                                             printf("\n");
