Merge pull request #9730 from Icinga/don-t-define-use-openssl-callback-for-in-openssl-v1-1
Some checks failed
Container Image / Container Image (push) Has been cancelled
Linux / alpine:bash (push) Has been cancelled
Linux / amazonlinux:2 (push) Has been cancelled
Linux / amazonlinux:2023 (push) Has been cancelled
Linux / debian:11 (linux/386) (push) Has been cancelled
Linux / debian:11 (push) Has been cancelled
Linux / debian:12 (linux/386) (push) Has been cancelled
Linux / debian:12 (push) Has been cancelled
Linux / debian:13 (push) Has been cancelled
Linux / fedora:41 (push) Has been cancelled
Linux / fedora:42 (push) Has been cancelled
Linux / opensuse/leap:15.6 (push) Has been cancelled
Linux / opensuse/leap:16.0 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.6 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.7 (push) Has been cancelled
Linux / rockylinux/rockylinux:10 (push) Has been cancelled
Linux / rockylinux:8 (push) Has been cancelled
Linux / rockylinux:9 (push) Has been cancelled
Linux / ubuntu:22.04 (push) Has been cancelled
Linux / ubuntu:24.04 (push) Has been cancelled
Linux / ubuntu:25.04 (push) Has been cancelled
Windows / Windows (push) Has been cancelled

Don't define/use OpenSSL*Callback() for/in OpenSSL > v1.1
This commit is contained in:
Alexander Aleksandrovič Klimov 2025-10-17 16:41:07 +02:00 committed by GitHub
commit 5d46ca4f77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,7 +19,6 @@ namespace icinga
{
static bool l_SSLInitialized = false;
static std::mutex *l_Mutexes;
static std::mutex l_RandomMutex;
String GetOpenSSLVersion()
@ -31,7 +30,9 @@ String GetOpenSSLVersion()
#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
}
#ifdef CRYPTO_LOCK
#if OPENSSL_VERSION_NUMBER < 0x10100000L
static std::mutex *l_Mutexes;
static void OpenSSLLockingCallback(int mode, int type, const char *, int)
{
if (mode & CRYPTO_LOCK)
@ -48,7 +49,7 @@ static unsigned long OpenSSLIDCallback()
return (unsigned long)pthread_self();
#endif /* _WIN32 */
}
#endif /* CRYPTO_LOCK */
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
/**
* Initializes the OpenSSL library.
@ -63,11 +64,11 @@ void InitializeOpenSSL()
SSL_COMP_get_compression_methods();
#ifdef CRYPTO_LOCK
#if OPENSSL_VERSION_NUMBER < 0x10100000L
l_Mutexes = new std::mutex[CRYPTO_num_locks()];
CRYPTO_set_locking_callback(&OpenSSLLockingCallback);
CRYPTO_set_id_callback(&OpenSSLIDCallback);
#endif /* CRYPTO_LOCK */
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
l_SSLInitialized = true;
}