[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Andy Polyakov appro at openssl.org
Thu Mar 2 16:00:53 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  c81fa2e187c9dfb2cf67d6e183fee3d2a726c59f (commit)
       via  654f7f6be617d2be316b3d60f593767105a9859a (commit)
      from  2d951d8cdef56aeeb6c08387531de943683e80ce (commit)


- Log -----------------------------------------------------------------
commit c81fa2e187c9dfb2cf67d6e183fee3d2a726c59f
Author: Andy Polyakov <appro at openssl.org>
Date:   Wed Mar 1 21:40:02 2017 +0100

    Configurations/10-main.conf: omit redundant -lresolv from Solaris configs.
    
    GH#2816
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (cherry picked from commit 8cfc21f53af5187497a8567bb2801c36472d7016)

commit 654f7f6be617d2be316b3d60f593767105a9859a
Author: Andy Polyakov <appro at openssl.org>
Date:   Wed Mar 1 21:28:05 2017 +0100

    bio/b_addr.c: omit private hstrerror.
    
    Private hstrerror was introduced to address linking problem on HP-UX,
    but truth be told conemporary systems, HP-UX included, wouldn't come
    to that call, they would use getaddrinfo and gai_strerror, while
    gethostbyname and h_errno are there to serve legacy systems. Since
    legacy systems are naturally disappearing breed, we can as well just
    let user interpret number.
    
    GH#2816
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (cherry picked from commit 3e49ee23eab5c3fa57d14dc5f82f50cbea718322)

-----------------------------------------------------------------------

Summary of changes:
 Configurations/10-main.conf |  2 +-
 crypto/bio/b_addr.c         | 44 +++++++++++++++-----------------------------
 2 files changed, 16 insertions(+), 30 deletions(-)

diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
index 985220f..39b89e7 100644
--- a/Configurations/10-main.conf
+++ b/Configurations/10-main.conf
@@ -179,7 +179,7 @@ sub vms_info {
         inherit_from     => [ "BASE_unix" ],
         template         => 1,
         cflags           => "-DFILIO_H",
-        ex_libs          => add("-lresolv -lsocket -lnsl -ldl"),
+        ex_libs          => add("-lsocket -lnsl -ldl"),
         dso_scheme       => "dlfcn",
         thread_scheme    => "pthreads",
         shared_target    => "solaris-shared",
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index 0f1900d..51a27d5 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -18,30 +18,6 @@
 #include <internal/thread_once.h>
 #include <ctype.h>
 
-#ifdef _HPUX_SOURCE
-static const char *ossl_hstrerror(int herr)
-{
-    switch (herr) {
-    case -1:
-        return strerror(errno);
-    case 0:
-        return "No error";
-    case HOST_NOT_FOUND:
-        return "Host not found";
-    case NO_DATA:                /* NO_ADDRESS is a synonym */
-        return "No data";
-    case NO_RECOVERY:
-        return "Non recoverable error";
-    case TRY_AGAIN:
-        return "Try again";
-    default:
-        break;
-    }
-    return "unknown error";
-}
-# define hstrerror(e) ossl_hstrerror(e)
-#endif
-
 CRYPTO_RWLOCK *bio_lookup_lock;
 static CRYPTO_ONCE bio_lookup_init = CRYPTO_ONCE_STATIC_INIT;
 
@@ -688,9 +664,10 @@ int BIO_lookup(const char *host, const char *service,
         return 0;
 
     if (1) {
-        int gai_ret = 0;
 #ifdef AI_PASSIVE
+        int gai_ret = 0;
         struct addrinfo hints;
+
         memset(&hints, 0, sizeof hints);
 
         hints.ai_family = family;
@@ -780,8 +757,18 @@ int BIO_lookup(const char *host, const char *service,
 
             if (he == NULL) {
 #ifndef OPENSSL_SYS_WINDOWS
-                BIOerr(BIO_F_BIO_LOOKUP, ERR_R_SYS_LIB);
-                ERR_add_error_data(1, hstrerror(h_errno));
+                /*
+                 * This might be misleading, because h_errno is used as if
+                 * it was errno. To minimize mixup add 1000. Underlying
+                 * reason for this is that hstrerror is declared obsolete,
+                 * not to mention that a) h_errno is not always guaranteed
+                 * to be meanigless; b) hstrerror can reside in yet another
+                 * library, linking for sake of hstrerror is an overkill;
+                 * c) this path is not executed on contemporary systems
+                 * anyway [above getaddrinfo/gai_strerror is]. We just let
+                 * system administrator figure this out...
+                 */
+                SYSerr(SYS_F_GETHOSTBYNAME, 1000 + h_errno);
 #else
                 SYSerr(SYS_F_GETHOSTBYNAME, WSAGetLastError());
 #endif
@@ -830,8 +817,7 @@ int BIO_lookup(const char *host, const char *service,
 
                 if (se == NULL) {
 #ifndef OPENSSL_SYS_WINDOWS
-                    BIOerr(BIO_F_BIO_LOOKUP, ERR_R_SYS_LIB);
-                    ERR_add_error_data(1, hstrerror(h_errno));
+                    SYSerr(SYS_F_GETSERVBYNAME, errno);
 #else
                     SYSerr(SYS_F_GETSERVBYNAME, WSAGetLastError());
 #endif


More information about the openssl-commits mailing list