Browse Source

Merge branch 'master' into next

* master:
  OpenSSL: Prefer 1.1
  Cleanup long lines
  Bump OPENSSL_API_COMPAT to 1.1 and try to cleanup old fwd-compat
Bryan Drewery 2 năm trước cách đây
mục cha
commit
b43db6c220
4 tập tin đã thay đổi với 33 bổ sung7 xóa
  1. 1 1
      build/autotools/includes/acinclude.m4
  2. 1 1
      configure
  3. 12 1
      src/libcrypto.cc
  4. 19 4
      src/libssl.cc

+ 1 - 1
build/autotools/includes/acinclude.m4

@@ -607,7 +607,7 @@ fi
 dnl Now check cf_openssl_found to see if we found anything.
 if test ! -z "$cf_openssl_basedir"; then
   if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" && test -f "${cf_openssl_basedir}/lib/libssl.so"; then
-    SSL_INCLUDES="-I${cf_openssl_basedir}/include -DOPENSSL_API_COMPAT=0x10000000L"
+    SSL_INCLUDES="-I${cf_openssl_basedir}/include -DOPENSSL_API_COMPAT=0x10100000L"
     SSL_LIBS="-L${cf_openssl_basedir}/lib"
   else
     dnl OpenSSL wasn't found in the directory specified.

+ 1 - 1
configure

@@ -6849,7 +6849,7 @@ else
 fi
 if test ! -z "$cf_openssl_basedir"; then
   if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" && test -f "${cf_openssl_basedir}/lib/libssl.so"; then
-    SSL_INCLUDES="-I${cf_openssl_basedir}/include -DOPENSSL_API_COMPAT=0x10000000L"
+    SSL_INCLUDES="-I${cf_openssl_basedir}/include -DOPENSSL_API_COMPAT=0x10100000L"
     SSL_LIBS="-L${cf_openssl_basedir}/lib"
   else
         cf_openssl_basedir=""

+ 12 - 1
src/libcrypto.cc

@@ -107,7 +107,18 @@ int load_libcrypto() {
 
   sdprintf("Loading libcrypto");
 
-  const auto& libs_list(bd::String("libcrypto.so." OPENSSL_SHLIB_VERSION_STR " libcrypto.so libcrypto.so.1.1 libcrypto.so.1.0.0 libcrypto.so.0.9.8 libcrypto.so.10 libcrypto.so.9 libcrypto.so.8 libcrypto.so.7 libcrypto.so.6").split(' '));
+  const auto& libs_list(bd::String("libcrypto.so." OPENSSL_SHLIB_VERSION_STR " "
+      "libcrypto.so "
+      "libcrypto.so.111 "
+      "libcrypto.so.1.1 "
+      "libcrypto.so.11 "
+      "libcrypto.so.1.0.0 "
+      "libcrypto.so.10 "
+      "libcrypto.so.9 "
+      "libcrypto.so.8 "
+      "libcrypto.so.7 "
+      "libcrypto.so.6 "
+      "libcrypto.so.0.9.8").split(' '));
 
   for (const auto& lib : libs_list) {
     dlerror(); // Clear Errors

+ 19 - 4
src/libssl.cc

@@ -58,18 +58,22 @@ static int load_symbols(void *handle) {
   DLSYM_GLOBAL(handle, SSL_CTX_ctrl);
   DLSYM_GLOBAL(handle, SSL_CTX_set_cipher_list);
   DLSYM_GLOBAL(handle, SSL_CTX_set_tmp_dh_callback);
-#if defined(OPENSSL_API_COMPAT) && OPENSSL_API_COMPAT < 0x10100000L
+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
   /* For SSL_library_init and SSL_load_error_strings. */
   DLSYM_GLOBAL(handle, OPENSSL_init_ssl);
-#else
+#endif
+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
   DLSYM_GLOBAL_FWDCOMPAT(handle, SSL_library_init);
   DLSYM_GLOBAL_FWDCOMPAT(handle, SSL_load_error_strings);
-  /* Some forward-compat is handled in src/compat/openssl.cc. */
 #endif
+  /* Some forward-compat is handled in src/compat/openssl.cc. */
 #if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
   DLSYM_GLOBAL(handle, TLS_client_method);
   DLSYM_GLOBAL(handle, SSL_CTX_set_options);
 #else
+  /* If SSLv23_client_method() is not found then use our
+   * _SSLv23_client_method()
+   */
   DLSYM_GLOBAL_FWDCOMPAT(handle, SSLv23_client_method);
   /* Some forward-compat is handled in src/compat/openssl.cc. */
 #endif
@@ -85,7 +89,18 @@ int load_libssl() {
 
   sdprintf("Loading libssl");
 
-  const auto& libs_list(bd::String("libssl.so." OPENSSL_SHLIB_VERSION_STR " libssl.so libssl.so.1.1 libssl.so.1.0.0 libssl.so.0.9.8 libssl.so.10 libssl.so.9 libssl.so.8 libssl.so.7 libssl.so.6").split(' '));
+  const auto& libs_list(bd::String("libssl.so." OPENSSL_SHLIB_VERSION_STR " "
+      "libssl.so "
+      "libssl.so.111 "
+      "libssl.so.1.1 "
+      "libssl.so.11 "
+      "libssl.so.1.0.0 "
+      "libssl.so.10 "
+      "libssl.so.9 "
+      "libssl.so.8 "
+      "libssl.so.7 "
+      "libssl.so.6 "
+      "libssl.so.0.9.8").split(' '));
 
   for (const auto& lib : libs_list) {
     dlerror(); // Clear Errors