diff --git a/meson.build b/meson.build index 0808c4d39..6c7d8f8b9 100644 --- a/meson.build +++ b/meson.build @@ -161,7 +161,7 @@ lib_lz4 = dependency('liblz4') configuration.set('HAVE_LIBLZ4', true, description: 'Is liblz4 present?') # Find required openssl library -lib_openssl = dependency('openssl') +lib_openssl = dependency('openssl', version : '>=1.1.1') # Find required pq library lib_pq = dependency('libpq') diff --git a/src/common/crypto/common.c b/src/common/crypto/common.c index db93c143a..7e603a387 100644 --- a/src/common/crypto/common.c +++ b/src/common/crypto/common.c @@ -59,14 +59,8 @@ cryptoInit(void) ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); - // SSL initialization depends on the version of OpenSSL -#if OPENSSL_VERSION_NUMBER < 0x10100000L - OPENSSL_config(NULL); - SSL_library_init(); - SSL_load_error_strings(); -#else + // Initialization OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL); -#endif // Mark crypto as initialized cryptoInitDone = true; diff --git a/src/common/io/tls/common.c b/src/common/io/tls/common.c index 1af7cacfc..3cb9a3dd6 100644 --- a/src/common/io/tls/common.c +++ b/src/common/io/tls/common.c @@ -16,7 +16,7 @@ TLS Common /**********************************************************************************************************************************/ FN_EXTERN String * -tlsAsn1ToStr(ASN1_STRING *const nameAsn1) +tlsAsn1ToStr(const ASN1_STRING *const nameAsn1) { FUNCTION_TEST_BEGIN(); FUNCTION_TEST_PARAM_P(VOID, nameAsn1); @@ -29,11 +29,7 @@ tlsAsn1ToStr(ASN1_STRING *const nameAsn1) FUNCTION_TEST_RETURN( // {vm_covered} STRING, strNewZN( -#if OPENSSL_VERSION_NUMBER < 0x10100000L - (const char *)ASN1_STRING_data(nameAsn1), -#else (const char *)ASN1_STRING_get0_data(nameAsn1), -#endif (size_t)ASN1_STRING_length(nameAsn1))); } diff --git a/src/common/io/tls/common.h b/src/common/io/tls/common.h index b9bd3863a..fa9c6cbec 100644 --- a/src/common/io/tls/common.h +++ b/src/common/io/tls/common.h @@ -12,7 +12,7 @@ TLS Common Functions ***********************************************************************************************************************************/ // Convert an ASN1 string used in certificates to a String -FN_EXTERN String *tlsAsn1ToStr(ASN1_STRING *nameAsn1); +FN_EXTERN String *tlsAsn1ToStr(const ASN1_STRING *nameAsn1); // Get common name from a certificate FN_EXTERN String *tlsCertCommonName(X509 *certificate); diff --git a/src/storage/gcs/storage.c b/src/storage/gcs/storage.c index 1b34b9253..6ca0d2d4b 100644 --- a/src/storage/gcs/storage.c +++ b/src/storage/gcs/storage.c @@ -249,11 +249,7 @@ storageGcsAuthJwt(StorageGcs *const this, const time_t timeBegin) FINALLY() { BIO_free((BIO *)bio); -#if OPENSSL_VERSION_NUMBER < 0x10100000L - EVP_MD_CTX_cleanup((EVP_MD_CTX *)sign); -#else EVP_MD_CTX_free((EVP_MD_CTX *)sign); -#endif EVP_PKEY_free((EVP_PKEY *)privateKey); } TRY_END();