4#include <QtMultimedia/private/qsymbolsresolveutils_p.h>
6#include <qstringliteral.h>
8#include <openssl/bio.h>
9#include <openssl/ssl.h>
10#include <openssl/bn.h>
11#include <openssl/err.h>
12#include <openssl/rand.h>
14using namespace Qt::StringLiterals;
17#if defined(OPENSSL_SHLIB_VERSION
)
18 OPENSSL_SHLIB_VERSION;
19#elif defined(SHLIB_VERSION_NUMBER)
24#if !defined(Q_OS_ANDROID)
30 auto lib = std::make_unique<QLibrary>();
32 auto tryLoad = [&](QString sslName,
auto version) {
33 lib->setFileNameAndVersion(sslName, version);
38#if defined(Q_OS_ANDROID)
40 auto suffix = qEnvironmentVariable(
"ANDROID_OPENSSL_SUFFIX");
41 if (suffix.isEmpty()) {
42#if (OPENSSL_VERSION_NUMBER >> 28
) < 3
44#elif OPENSSL_VERSION_MAJOR == 3
47 static_assert(
false,
"Unexpected openssl version");
51 if (tryLoad(
"ssl"_L1 + suffix, -1))
56 if (tryLoad(
"ssl"_L1, SSL_NEEDED_SOVERSION
""_L1))
63BEGIN_INIT_FUNCS(
"ssl", loadLib)
67INIT_FUNC(BN_value_one);
187DEFINE_FUNC(BN_value_one, 0);
191DEFINE_FUNC(BN_mul_word, 2)
192DEFINE_FUNC(BN_add_word, 2)
193DEFINE_FUNC(BN_sub_word, 2)
194DEFINE_FUNC(BN_set_word, 2)
195DEFINE_FUNC(BN_new, 0)
196DEFINE_FUNC(BN_cmp, 2)
198DEFINE_FUNC(BN_free, 1);
static constexpr auto SHLIB_VERSION
INIT_FUNC(BIO_meth_set_ctrl)
INIT_FUNC(BIO_meth_set_read)
INIT_FUNC(BIO_test_flags)
INIT_FUNC(BIO_meth_set_write)
INIT_FUNC(BIO_meth_set_gets)
INIT_FUNC(TLS_server_method)
INIT_FUNC(BIO_clear_flags)
INIT_FUNC(ERR_error_string)
INIT_FUNC(BIO_meth_set_create)
static std::unique_ptr< QLibrary > loadLib()
INIT_FUNC(SSL_CTX_use_PrivateKey_file)
INIT_FUNC(TLS_client_method)
static char ErrorString[]
INIT_FUNC(BIO_meth_set_destroy)
INIT_FUNC(BIO_meth_set_puts)
INIT_FUNC(SSL_CTX_load_verify_locations)
INIT_FUNC(BIO_meth_set_callback_ctrl)
INIT_FUNC(BN_num_bits_word)
INIT_FUNC(SSL_CTX_set_verify)
INIT_FUNC(SSL_CTX_use_PrivateKey)
INIT_FUNC(SSL_CTX_use_certificate_chain_file)
INIT_FUNC(SSL_CTX_set_options)
INIT_FUNC(SSL_CTX_up_ref)
CHECK_VERSIONS("va-drm", VA_DRM_NEEDED_SOVERSION, VA_MAJOR_VERSION+1)
DEFINE_FUNC(pw_deinit, 0)