> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> c...@lists.openembedded.org> On Behalf Of Alexander Kanavin
> Sent: den 11 oktober 2021 11:41
> To: openembedded-core@lists.openembedded.org
> Cc: Alexander Kanavin <a...@linutronix.de>; Hongxu Jia
> <hongxu....@windriver.com>; Richard Purdie
> <richard.pur...@linuxfoundation.org>
> Subject: [OE-core] [PATCH 07/25] openssl: update 1.1.1l -> 3.0.0
> 
> Drop 0001-skip-test_symbol_presence.patch - testing revealed
> no need for it, and I couldn't quite understand what it does.
> 
> Drop reproducible.patch - upstream has removed the non-reproducible
> bit.
> 
> Process lines in run-ptest with sed one by one rather than with
> perl after the test completes, avoiding ptest-runner timeout errors.
> 
> License-Update: openssl relicense to apache 2.0. Goodbye awkward
> gpl exceptions in consumers.
> 
> DEPRECATED_CRYPTO_FLAGS is now empty by default but available
> by anyone who wants to set it. Trying to come up with a working
> set was not a good idea as shown in the deleted comment.
> 
> Signed-off-by: Alexander Kanavin <a...@linutronix.de>
> ---
>  ...1-Configure-do-not-tweak-mips-cflags.patch | 36 +++++++++
>  ...sysroot-and-debug-prefix-map-from-co.patch | 21 ++---
>  .../0001-skip-test_symbol_presence.patch      | 46 -----------
>  .../openssl/openssl/reproducible.patch        | 32 --------
>  .../openssl/openssl/run-ptest                 |  2 +-
>  .../{openssl_1.1.1l.bb => openssl_3.0.0.bb}   | 81 ++++++++++---------
>  6 files changed, 90 insertions(+), 128 deletions(-)
>  create mode 100644 
> meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch
>  delete mode 100644 
> meta/recipes-connectivity/openssl/openssl/0001-skip-test_symbol_presence.patch
>  delete mode 100644 
> meta/recipes-connectivity/openssl/openssl/reproducible.patch
>  rename meta/recipes-connectivity/openssl/{openssl_1.1.1l.bb => 
> openssl_3.0.0.bb} (76%)
> 

[cut]

> diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.1l.bb 
> b/meta/recipes-connectivity/openssl/openssl_3.0.0.bb
> similarity index 76%
> rename from meta/recipes-connectivity/openssl/openssl_1.1.1l.bb
> rename to meta/recipes-connectivity/openssl/openssl_3.0.0.bb
> index b241ba78bcc..d8c50a80118 100644
> --- a/meta/recipes-connectivity/openssl/openssl_1.1.1l.bb
> +++ b/meta/recipes-connectivity/openssl/openssl_3.0.0.bb
> @@ -4,19 +4,14 @@ HOMEPAGE = "http://www.openssl.org/";
>  BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html";
>  SECTION = "libs/network"
> 
> -# "openssl" here actually means both OpenSSL and SSLeay licenses apply
> -# (see meta/files/common-licenses/OpenSSL to which "openssl" is 
> SPDXLICENSEMAPped)
> -LICENSE = "openssl"
> -LIC_FILES_CHKSUM = "file://LICENSE;md5=d343e62fc9c833710bbbed25f27364c8"
> -
> -DEPENDS = "hostperl-runtime-native"
> +LICENSE = "Apache-2.0"
> +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=c75985e733726beaba57bc5253e96d04"
> 
>  SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
>             file://run-ptest \
> -           file://0001-skip-test_symbol_presence.patch \
>             
> file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
>             file://afalg.patch \
> -           file://reproducible.patch \
> +           file://0001-Configure-do-not-tweak-mips-cflags.patch \
>             "
> 
>  SRC_URI:append:class-nativesdk = " \
> @@ -28,9 +23,9 @@ SRC_URI:append:riscv32 = " \
>             file://0004-Fixup-support-for-io_pgetevents_time64-syscall.patch \
>             "
> 
> -SRC_URI[sha256sum] = 
> "0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1"
> +SRC_URI[sha256sum] = 
> "59eedfcb46c25214c9bd37ed6078297b4df01d012267fe9e9eee31f61bc70536"
> 
> -inherit lib_package multilib_header multilib_script ptest
> +inherit lib_package multilib_header multilib_script ptest perlnative
>  MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
> 
>  PACKAGECONFIG ?= ""
> @@ -59,19 +54,9 @@ EXTRA_OECONF:class-nativesdk = 
> "--with-rand-seed=os,devrandom"
>  CFLAGS:append:class-native = " -DOPENSSLDIR=/not/builtin 
> -DENGINESDIR=/not/builtin"
>  CFLAGS:append:class-nativesdk = " -DOPENSSLDIR=/not/builtin 
> -DENGINESDIR=/not/builtin"
> 
> -# Disable deprecated crypto algorithms
> -# Retained for compatibilty
> -# des (curl)
> -# dh (python-ssl)
> -# dsa (rpm)
> -# md4 (cyrus-sasl freeradius hostapd)
> -# bf (wvstreams postgresql x11vnc crda znc cfengine)
> -# rc4 (freerdp librtorrent ettercap xrdp transmission pam-ssh-agent-auth php)
> -# rc2 (mailx)
> -# psk (qt5)
> -# srp (libest)
> -# whirlpool (qca)
> -DEPRECATED_CRYPTO_FLAGS = "no-ssl no-idea no-rc5 no-md2 no-camellia no-mdc2 
> no-scrypt no-seed no-siphash no-sm2 no-sm3 no-sm4"
> +# This allows disabling deprecated or undesirable crypto algorithms.
> +# The default is to trust upstream choices.
> +DEPRECATED_CRYPTO_FLAGS ?= ""
> 
>  do_configure () {
>       os=${HOST_OS}
> @@ -146,7 +131,7 @@ do_configure () {
>       # WARNING: do not set compiler/linker flags (-I/-D etc.) in 
> EXTRA_OECONF, as they will fully replace the
>       # environment variables set by bitbake. Adjust the environment 
> variables instead.
>       HASHBANGPERL="/usr/bin/env perl" PERL=perl 
> PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \
> -     perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} 
> ${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 
> --libdir=${libdir} $target
> +     perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} 
> ${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-3 
> --libdir=${libdir} $target
>       perl ${B}/configdata.pm --dump
>  }
> 
> @@ -154,43 +139,49 @@ do_install () {
>       oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
> 
>       oe_multilib_header openssl/opensslconf.h
> +     oe_multilib_header openssl/configuration.h
> 
>       # Create SSL structure for packages such as ca-certificates which
>       # contain hard-coded paths to /etc/ssl. Debian does the same.
>       install -d ${D}${sysconfdir}/ssl
> -     mv ${D}${libdir}/ssl-1.1/certs \
> -        ${D}${libdir}/ssl-1.1/private \
> -        ${D}${libdir}/ssl-1.1/openssl.cnf \
> +     mv ${D}${libdir}/ssl-3/certs \
> +        ${D}${libdir}/ssl-3/private \
> +        ${D}${libdir}/ssl-3/openssl.cnf \

Given that "${libdir}/ssl-3" is all over the recipe, wouldn't it make 
sense to turn it into a variable? Then it will at least only be one 
place to update the next time they change the version.

>          ${D}${sysconfdir}/ssl/
> 
>       # Although absolute symlinks would be OK for the target, they become
>       # invalid if native or nativesdk are relocated from sstate.
> -     ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', 
> '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs
> -     ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', 
> '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private
> -     ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', 
> '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf
> +     ln -sf ${@oe.path.relative('${libdir}/ssl-3', 
> '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-3/certs
> +     ln -sf ${@oe.path.relative('${libdir}/ssl-3', 
> '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-3/private
> +     ln -sf ${@oe.path.relative('${libdir}/ssl-3', 
> '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-3/openssl.cnf
>  }
> 
>  do_install:append:class-native () {
>       create_wrapper ${D}${bindir}/openssl \
> -         OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \
> -         SSL_CERT_DIR=${libdir}/ssl-1.1/certs \
> -         SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \
> -         OPENSSL_ENGINES=${libdir}/engines-1.1
> +         OPENSSL_CONF=${libdir}/ssl-3/openssl.cnf \
> +         SSL_CERT_DIR=${libdir}/ssl-3/certs \
> +         SSL_CERT_FILE=${libdir}/ssl-3/cert.pem \
> +         OPENSSL_ENGINES=${libdir}/engines-3
>  }
> 
>  do_install:append:class-nativesdk () {
>       mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
>       install -m 644 ${WORKDIR}/environment.d-openssl.sh 
> ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
> -     sed 's|/usr/lib/ssl/|/usr/lib/ssl-1.1/|g' -i 
> ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
> +     sed 's|/usr/lib/ssl/|/usr/lib/ssl-3/|g' -i 
> ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
>  }
> 
>  PTEST_BUILD_HOST_FILES += "configdata.pm"
>  PTEST_BUILD_HOST_PATTERN = "perl_version ="
>  do_install_ptest () {
> +     install -d ${D}${PTEST_PATH}/test
> +     install -m755 ${B}/test/p_test.so ${D}${PTEST_PATH}/test
> +     install -m755 ${B}/test/provider_internal_test.cnf 
> ${D}${PTEST_PATH}/test
> +
>       # Prune the build tree
>       rm -f ${B}/fuzz/*.* ${B}/test/*.*
> 
>       cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH}
> +     sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm
>       cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util 
> ${D}${PTEST_PATH}
> 
>       # For test_shlibload
> @@ -204,10 +195,20 @@ do_install_ptest () {
> 
>       install -d ${D}${PTEST_PATH}/engines
>       install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines
> +     install -m755 ${B}/engines/loader_attic.so ${D}${PTEST_PATH}/engines
> +
> +     install -d ${D}${PTEST_PATH}/providers
> +     install -m755 ${B}/providers/legacy.so ${D}${PTEST_PATH}/providers
> +
> +        install -d ${D}${PTEST_PATH}/Configurations
> +        cp -rf ${S}/Configurations/* ${D}${PTEST_PATH}/Configurations/
> 
>          # seems to be needed with perl 5.32.1
>          install -d ${D}${PTEST_PATH}/util/perl/recipes
>          cp ${D}${PTEST_PATH}/test/recipes/tconversion.pl 
> ${D}${PTEST_PATH}/util/perl/recipes/
> +
> +     sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/util/wrap.pl

There is a mix of tab and space indentation above (both in the original 
code and in the added lines).

> +

Unnecessary empty line.

>  }
> 
>  # Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
> @@ -220,13 +221,13 @@ PACKAGES =+ "libcrypto libssl openssl-conf 
> ${PN}-engines ${PN}-misc"
>  FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}"
>  FILES:libssl = "${libdir}/libssl${SOLIBS}"
>  FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf \
> -                      ${libdir}/ssl-1.1/openssl.cnf* \
> +                      ${libdir}/ssl-3/openssl.cnf* \
>                        "
> -FILES:${PN}-engines = "${libdir}/engines-1.1"
> +FILES:${PN}-engines = "${libdir}/engines-3"
>  # ${prefix} comes from what we pass into --prefix at configure time (which 
> is used for INSTALLTOP)
> -FILES:${PN}-engines:append:mingw32:class-nativesdk = 
> "${prefix}${libdir}/engines-1_1"
> -FILES:${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash"
> -FILES:${PN} =+ "${libdir}/ssl-1.1/*"
> +FILES:${PN}-engines:append:mingw32:class-nativesdk = 
> "${prefix}${libdir}/engines-3"
> +FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash"
> +FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/"

Might as well change the "=+" to "+=".

>  FILES:${PN}:append:class-nativesdk = " 
> ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
> 
>  CONFFILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
> --
> 2.20.1

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156848): 
https://lists.openembedded.org/g/openembedded-core/message/156848
Mute This Topic: https://lists.openembedded.org/mt/86232768/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to