Skip to content

Commit 0627bda

Browse files
committed
openssl: more dynamic loading support
Support more variants for dynamic loading of OpenSSL libraries.
1 parent da3cc96 commit 0627bda

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/crypt_openssl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ static inline void HMAC_CTX_free(HMAC_CTX *ctx)
4444

4545
#endif
4646

47-
#if OPENSSL_VERSION_NUMBER >= 0x10100000L || defined(CRYPT_OPENSSL_DYNAMIC)
47+
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) || \
48+
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x03050000fL) || \
49+
defined(CRYPT_OPENSSL_DYNAMIC)
4850

4951
static inline void HMAC_CTX_cleanup(HMAC_CTX *ctx)
5052
{
@@ -61,7 +63,9 @@ static bool ntlm_crypt_init_functions(ntlm_client *ntlm)
6163
void *handle;
6264

6365
if ((handle = dlopen("libssl.so.1.1", RTLD_NOW)) == NULL &&
66+
(handle = dlopen("libssl.1.1.dylib", RTLD_NOW)) == NULL &&
6467
(handle = dlopen("libssl.so.1.0.0", RTLD_NOW)) == NULL &&
68+
(handle = dlopen("libssl.1.0.0.dylib", RTLD_NOW)) == NULL &&
6569
(handle = dlopen("libssl.so.10", RTLD_NOW)) == NULL) {
6670
ntlm_client_set_errmsg(ntlm, "could not open libssl");
6771
return false;

0 commit comments

Comments
 (0)