summaryrefslogtreecommitdiffstats
path: root/tdeio/kssl/kopenssl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdeio/kssl/kopenssl.cpp')
-rw-r--r--tdeio/kssl/kopenssl.cpp72
1 files changed, 46 insertions, 26 deletions
diff --git a/tdeio/kssl/kopenssl.cpp b/tdeio/kssl/kopenssl.cpp
index a009bd7e9..96e4473a2 100644
--- a/tdeio/kssl/kopenssl.cpp
+++ b/tdeio/kssl/kopenssl.cpp
@@ -33,6 +33,8 @@
#include <unistd.h>
#include "kopenssl.h"
+#define STRINGIFY(x) #x
+
#define GET_CRYPTOLIB_SYMBOL(a) ((_cryptoLib->hasSymbol(a)) ? _cryptoLib->symbol(a) : NULL)
#define GET_SSLLIB_SYMBOL(a) ((_sslLib->hasSymbol(a)) ? _sslLib->symbol(a) : NULL)
@@ -343,10 +345,18 @@ TDEConfig *cfg;
libnamesc << "cygcrypto.dll"
<< "libcrypto.dll"
<< "";
-#else
+#else /* !OpenBSD && !CygWin */
+
+#ifdef Q_OS_SOLARIS
+
+ libpaths << "/" SYSTEM_LIBDIR KDELIBSUFF "/"
+ << "/usr/" SYSTEM_LIBDIR KDELIBSUFF "/"
+ << "";
+#else /* default */
+
libpaths
- #ifdef _AIX
- << "/opt/freeware/lib/"
+ #ifdef _AIX
+ << "/opt/freeware/lib/"
#endif
<< "/usr/" SYSTEM_LIBDIR "/"
<< "/usr/ssl/" SYSTEM_LIBDIR "/"
@@ -355,43 +365,52 @@ TDEConfig *cfg;
<< "/usr/local/ssl/" SYSTEM_LIBDIR "/"
<< "/opt/openssl/" SYSTEM_LIBDIR "/"
<< "/" SYSTEM_LIBDIR "/"
- << "";
+ << "";
+#endif /* default */
// FIXME: #define here for the various OS types to optimize
libnamess
#ifdef hpux
- << "libssl.sl"
- #elif defined(_AIX)
- << "libssl.a(libssl.so.0)"
+ << "libssl.sl"
+ #elif defined(_AIX)
+ << "libssl.a(libssl.so.0)"
#elif defined(__APPLE__)
<< "libssl.dylib"
<< "libssl.0.9.dylib"
- #else
- #ifdef SHLIB_VERSION_NUMBER
- << "libssl.so." SHLIB_VERSION_NUMBER
- #endif
- << "libssl.so"
- << "libssl.so.0"
- #endif
+ #else
+ #ifdef OPENSSL_SHLIB_VERSION
+ << "libssl.so." STRINGIFY(OPENSSL_SHLIB_VERSION)
+ #endif
+ #ifdef SHLIB_VERSION_NUMBER
+ << "libssl.so." SHLIB_VERSION_NUMBER
+ #endif
+ << "libssl.so"
+ << "libssl.so.3"
+ << "libssl.so.0"
+ #endif
;
libnamesc
- #ifdef hpux
- << "libcrypto.sl"
- #elif defined(_AIX)
- << "libcrypto.a(libcrypto.so.0)"
+ #ifdef hpux
+ << "libcrypto.sl"
+ #elif defined(_AIX)
+ << "libcrypto.a(libcrypto.so.0)"
#elif defined(__APPLE__)
<< "libcrypto.dylib"
<< "libcrypto.0.9.dylib"
#else
- #ifdef SHLIB_VERSION_NUMBER
- << "libcrypto.so." SHLIB_VERSION_NUMBER
- #endif
- << "libcrypto.so"
- << "libcrypto.so.0"
- #endif
+ #ifdef OPENSSL_SHLIB_VERSION
+ << "libcrypto.so." STRINGIFY(OPENSSL_SHLIB_VERSION)
+ #endif
+ #ifdef SHLIB_VERSION_NUMBER
+ << "libcrypto.so." SHLIB_VERSION_NUMBER
+ #endif
+ << "libcrypto.so"
+ << "libcrypto.so.3"
+ << "libcrypto.so.0"
+ #endif
;
-#endif
+#endif /* __OpenBSD__ */
for (TQStringList::Iterator it = libpaths.begin();
it != libpaths.end();
@@ -635,7 +654,8 @@ TDEConfig *cfg;
K_SSLv3_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL("SSLv3_client_method");
K_TLS_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL("TLS_client_method");
if (!K_TLS_client_method) K_TLS_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL("SSLv23_client_method");
- K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) GET_SSLLIB_SYMBOL("SSL_get_peer_certificate");
+ K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) GET_SSLLIB_SYMBOL("SSL_get1_peer_certificate");
+ if (!K_SSL_get_peer_certificate) K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) GET_SSLLIB_SYMBOL("SSL_get_peer_certificate");
K_SSL_CIPHER_get_bits = (int (*)(SSL_CIPHER *,int *)) GET_SSLLIB_SYMBOL("SSL_CIPHER_get_bits");
K_SSL_CIPHER_get_version = (char * (*)(SSL_CIPHER *)) GET_SSLLIB_SYMBOL("SSL_CIPHER_get_version");
K_SSL_CIPHER_get_name = (const char * (*)(SSL_CIPHER *)) GET_SSLLIB_SYMBOL("SSL_CIPHER_get_name");