From 8c507db1731d0719df58206a2ac871f98ebfaedc Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 24 Mar 2023 16:50:48 +0100 Subject: [PATCH] build: Update OpenSSL wrap Update to OpenSSL 3.0.7. When the fallback was using v1 we never went into the v3 testing. With updating to v3 we are going to figure out if we have LibreSSL spin of the API. But cc.has_header_symbol() and cc.has_header() only work on external library and not on fallbacks. Thus if we use the fallback (internal) we just know it is API version 3 and don't do any crazy testing. Signed-off-by: Daniel Wagner --- meson.build | 51 ++++++++++++++++++++++------------------ subprojects/openssl.wrap | 17 +++++++------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/meson.build b/meson.build index 9b1abe0f..1b663554 100644 --- a/meson.build +++ b/meson.build @@ -61,38 +61,43 @@ else endif conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c required?') -# Check for OpenSSL availability -openssl_dep = dependency('openssl', - version: '>=1.1.0', - required: get_option('openssl'), - fallback : ['openssl', 'libssl_dep']) -if openssl_dep.found() - conf.set('CONFIG_OPENSSL', true, - description: 'Is OpenSSL/LibreSSL available?') +if get_option('openssl').disabled() + openssl_dep = dependency('', required: false) +else + openssl_dep = dependency('openssl', + version: '>=1.1.0', + required: get_option('openssl'), + fallback : ['openssl', 'libssl_dep']) - if openssl_dep.version().version_compare('<2.0.0') - api_version = 1 - endif + if openssl_dep.found() + if openssl_dep.version().version_compare('<2.0.0') + api_version = 1 + endif - if openssl_dep.version().version_compare('>=3.0.0') - api_version = 3 + if openssl_dep.version().version_compare('>=3.0.0') + api_version = 3 + endif # Test for LibreSSL v3.x with incomplete OpenSSL v3 APIs - is_libressl = cc.has_header_symbol('openssl/opensslv.h', - 'LIBRESSL_VERSION_NUMBER', - dependencies: openssl_dep) - has_header = cc.has_header('openssl/core_names.h', - dependencies: openssl_dep) - if is_libressl and not has_header - api_version = 1 + if openssl_dep.type_name() != 'internal' + is_libressl = cc.has_header_symbol('openssl/opensslv.h', + 'LIBRESSL_VERSION_NUMBER', + dependencies: openssl_dep) + has_header = cc.has_header('openssl/core_names.h', + dependencies: openssl_dep) + if is_libressl and not has_header + api_version = 1 + endif endif + conf.set('CONFIG_OPENSSL_@0@'.format(api_version), true, + description: 'OpenSSL/LibreSSL API version @0@'.format(api_version)) endif - - conf.set('CONFIG_OPENSSL_@0@'.format(api_version), true, - description: 'OpenSSL/LibreSSL API version @0@'.format(api_version)) endif +conf.set('CONFIG_OPENSSL', openssl_dep.found(), + description: 'Is OpenSSL/LibreSSL available?') + if get_option('libdbus').disabled() libdbus_dep = dependency('', required: false) else diff --git a/subprojects/openssl.wrap b/subprojects/openssl.wrap index ed293736..13544067 100644 --- a/subprojects/openssl.wrap +++ b/subprojects/openssl.wrap @@ -1,14 +1,15 @@ [wrap-file] -directory = openssl-1.1.1l -source_url = https://www.openssl.org/source/openssl-1.1.1l.tar.gz -source_filename = openssl-1.1.1l.tar.gz -source_hash = 0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 -patch_filename = openssl_1.1.1l-3_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/openssl_1.1.1l-3/get_patch -patch_hash = a0cb8285cda3ae0e1898b4e88427c19bf245184259f41395010182655f9f8ce6 +directory = openssl-3.0.7 +source_url = https://www.openssl.org/source/openssl-3.0.7.tar.gz +source_filename = openssl-3.0.7.tar.gz +source_hash = 83049d042a260e696f62406ac5c08bf706fd84383f945cf21bd61e9ed95c396e +patch_filename = openssl_3.0.7-2_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/openssl_3.0.7-2/get_patch +patch_hash = dcc5d21bb602a5ca43bbaf14de858955f748b2abb2c0102ba193bd3964ac13a4 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/openssl_3.0.7-2/openssl-3.0.7.tar.gz +wrapdb_version = 3.0.7-2 [provide] libcrypto = libcrypto_dep libssl = libssl_dep openssl = openssl_dep - -- 2.50.1