فهرست منبع

OpenSSL 1.1 no longer needs all this OPENSSL_init_ssl() compat.

This fixes the build with OpenSSL 1.1
Bryan Drewery 2 سال پیش
والد
کامیت
90517e0a68
3فایلهای تغییر یافته به همراه2 افزوده شده و 28 حذف شده
  1. 0 19
      src/compat/openssl.cc
  2. 0 7
      src/libssl.cc
  3. 2 2
      src/openssl.cc

+ 0 - 19
src/compat/openssl.cc

@@ -6,14 +6,6 @@
 #include "dl.h"
 
 extern "C" {
-typedef int (*OPENSSL_init_ssl_t)(uint64_t a1, const void *a2);
-static int _OPENSSL_init_ssl(uint64_t a1, const void *a2) {
-  if (DLSYM_VAR(OPENSSL_init_ssl) == NULL)
-    if (DLSYM_GLOBAL_SIMPLE(RTLD_NEXT, OPENSSL_init_ssl) == NULL)
-      return 0;
-  return DLSYM_VAR(OPENSSL_init_ssl)(a1, a2);
-}
-
 void _ERR_free_strings(void) __attribute__((const));
 void _ERR_free_strings(void) {
 }
@@ -26,17 +18,6 @@ void _CRYPTO_cleanup_all_ex_data(void) __attribute__((const));
 void _CRYPTO_cleanup_all_ex_data(void) {
 }
 
-int _SSL_library_init(void) {
-  return _OPENSSL_init_ssl(0, NULL);
-}
-
-#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
-#define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
-void _SSL_load_error_strings(void) {
-    _OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \
-                     | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
-}
-
 typedef void *(*TLS_client_method_t)(void);
 static const void *_TLS_client_method(void) {
   if (DLSYM_VAR(TLS_client_method) == NULL)

+ 0 - 7
src/libssl.cc

@@ -58,14 +58,7 @@ 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
-  /* For SSL_library_init and SSL_load_error_strings. */
   DLSYM_GLOBAL(handle, OPENSSL_init_ssl);
-#else
-  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
 #if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
   DLSYM_GLOBAL(handle, TLS_client_method);
   DLSYM_GLOBAL(handle, SSL_CTX_set_options);

+ 2 - 2
src/openssl.cc

@@ -76,8 +76,8 @@ int init_openssl() {
 
 #ifdef EGG_SSL_EXT
   /* good place to init ssl stuff */
-  SSL_load_error_strings();
-  OpenSSL_add_ssl_algorithms();
+  OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS |
+      OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
 #if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
   ssl_ctx = SSL_CTX_new(SSLv23_client_method());
 #else