summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl_1.1.1w.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl_1.1.1w.bb')
-rw-r--r--meta/recipes-connectivity/openssl/openssl_1.1.1w.bb222
1 files changed, 222 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.1w.bb b/meta/recipes-connectivity/openssl/openssl_1.1.1w.bb
new file mode 100644
index 0000000000..0e490eabc3
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl_1.1.1w.bb
@@ -0,0 +1,222 @@
1SUMMARY = "Secure Socket Layer"
2DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
3HOMEPAGE = "http://www.openssl.org/"
4BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
5SECTION = "libs/network"
6
7# "openssl" here actually means both OpenSSL and SSLeay licenses apply
8# (see meta/files/common-licenses/OpenSSL to which "openssl" is SPDXLICENSEMAPped)
9LICENSE = "openssl"
10LIC_FILES_CHKSUM = "file://LICENSE;md5=d343e62fc9c833710bbbed25f27364c8"
11
12DEPENDS = "hostperl-runtime-native"
13
14SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
15 file://run-ptest \
16 file://0001-skip-test_symbol_presence.patch \
17 file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
18 file://afalg.patch \
19 file://reproducible.patch \
20 file://reproducibility.patch \
21 file://0001-Configure-add-2-missing-key-sorts.patch \
22 file://0001-Configure-do-not-tweak-mips-cflags.patch \
23 file://CVE-2024-0727.patch \
24 "
25
26SRC_URI_append_class-nativesdk = " \
27 file://environment.d-openssl.sh \
28 "
29
30SRC_URI[sha256sum] = "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8"
31
32inherit lib_package multilib_header multilib_script ptest
33MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
34
35PACKAGECONFIG ?= ""
36PACKAGECONFIG_class-native = ""
37PACKAGECONFIG_class-nativesdk = ""
38
39PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module"
40
41B = "${WORKDIR}/build"
42do_configure[cleandirs] = "${B}"
43
44#| ./libcrypto.so: undefined reference to `getcontext'
45#| ./libcrypto.so: undefined reference to `setcontext'
46#| ./libcrypto.so: undefined reference to `makecontext'
47EXTRA_OECONF_append_libc-musl = " no-async"
48EXTRA_OECONF_append_libc-musl_powerpc64 = " no-asm"
49
50# adding devrandom prevents openssl from using getrandom() which is not available on older glibc versions
51# (native versions can be built with newer glibc, but then relocated onto a system with older glibc)
52EXTRA_OECONF_class-native = "--with-rand-seed=os,devrandom"
53EXTRA_OECONF_class-nativesdk = "--with-rand-seed=os,devrandom"
54
55# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate.
56CFLAGS_append_class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin"
57CFLAGS_append_class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin"
58
59do_configure () {
60 os=${HOST_OS}
61 case $os in
62 linux-gnueabi |\
63 linux-gnuspe |\
64 linux-musleabi |\
65 linux-muslspe |\
66 linux-musl )
67 os=linux
68 ;;
69 *)
70 ;;
71 esac
72 target="$os-${HOST_ARCH}"
73 case $target in
74 linux-arm*)
75 target=linux-armv4
76 ;;
77 linux-aarch64*)
78 target=linux-aarch64
79 ;;
80 linux-i?86 | linux-viac3)
81 target=linux-x86
82 ;;
83 linux-gnux32-x86_64 | linux-muslx32-x86_64 )
84 target=linux-x32
85 ;;
86 linux-gnu64-x86_64)
87 target=linux-x86_64
88 ;;
89 linux-mips | linux-mipsel)
90 # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags
91 target="linux-mips32 ${TARGET_CC_ARCH}"
92 ;;
93 linux-gnun32-mips*)
94 target=linux-mips64
95 ;;
96 linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el)
97 target=linux64-mips64
98 ;;
99 linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*)
100 target=linux-generic32
101 ;;
102 linux-powerpc)
103 target=linux-ppc
104 ;;
105 linux-powerpc64)
106 target=linux-ppc64
107 ;;
108 linux-powerpc64le)
109 target=linux-ppc64le
110 ;;
111 linux-riscv32)
112 target=linux-generic32
113 ;;
114 linux-riscv64)
115 target=linux-generic64
116 ;;
117 linux-sparc | linux-supersparc)
118 target=linux-sparcv9
119 ;;
120 esac
121
122 useprefix=${prefix}
123 if [ "x$useprefix" = "x" ]; then
124 useprefix=/
125 fi
126 # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the
127 # environment variables set by bitbake. Adjust the environment variables instead.
128 HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \
129 perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdir} $target
130 perl ${B}/configdata.pm --dump
131}
132
133do_install () {
134 oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
135
136 oe_multilib_header openssl/opensslconf.h
137
138 # Create SSL structure for packages such as ca-certificates which
139 # contain hard-coded paths to /etc/ssl. Debian does the same.
140 install -d ${D}${sysconfdir}/ssl
141 mv ${D}${libdir}/ssl-1.1/certs \
142 ${D}${libdir}/ssl-1.1/private \
143 ${D}${libdir}/ssl-1.1/openssl.cnf \
144 ${D}${sysconfdir}/ssl/
145
146 # Although absolute symlinks would be OK for the target, they become
147 # invalid if native or nativesdk are relocated from sstate.
148 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs
149 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private
150 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf
151}
152
153do_install_append_class-native () {
154 create_wrapper ${D}${bindir}/openssl \
155 OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \
156 SSL_CERT_DIR=${libdir}/ssl-1.1/certs \
157 SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \
158 OPENSSL_ENGINES=${libdir}/engines-1.1
159}
160
161do_install_append_class-nativesdk () {
162 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
163 install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
164 sed 's|/usr/lib/ssl/|/usr/lib/ssl-1.1/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
165}
166
167PTEST_BUILD_HOST_FILES += "configdata.pm"
168PTEST_BUILD_HOST_PATTERN = "perl_version ="
169do_install_ptest () {
170 # Prune the build tree
171 rm -f ${B}/fuzz/*.* ${B}/test/*.*
172
173 cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH}
174 cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util ${D}${PTEST_PATH}
175
176 # For test_shlibload
177 ln -s ${libdir}/libcrypto.so.1.1 ${D}${PTEST_PATH}/
178 ln -s ${libdir}/libssl.so.1.1 ${D}${PTEST_PATH}/
179
180 install -d ${D}${PTEST_PATH}/apps
181 ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps
182 install -m644 ${S}/apps/*.pem ${S}/apps/*.srl ${S}/apps/openssl.cnf ${D}${PTEST_PATH}/apps
183 install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps
184
185 install -d ${D}${PTEST_PATH}/engines
186 install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines
187 install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines
188}
189
190# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
191# package RRECOMMENDS on this package. This will enable the configuration
192# file to be installed for both the openssl-bin package and the libcrypto
193# package since the openssl-bin package depends on the libcrypto package.
194
195PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc"
196
197FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
198FILES_libssl = "${libdir}/libssl${SOLIBS}"
199FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf \
200 ${libdir}/ssl-1.1/openssl.cnf* \
201 "
202FILES_${PN}-engines = "${libdir}/engines-1.1"
203FILES_${PN}-misc = "${libdir}/ssl-1.1/misc"
204FILES_${PN} =+ "${libdir}/ssl-1.1/*"
205FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
206
207CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
208
209RRECOMMENDS_libcrypto += "openssl-conf"
210RDEPENDS_${PN}-ptest += "openssl-bin perl perl-modules bash"
211
212RDEPENDS_${PN}-bin += "openssl-conf"
213
214BBCLASSEXTEND = "native nativesdk"
215
216CVE_PRODUCT = "openssl:openssl"
217
218CVE_VERSION_SUFFIX = "alphabetical"
219
220# Only affects OpenSSL >= 1.1.1 in combination with Apache < 2.4.37
221# Apache in meta-webserver is already recent enough
222CVE_CHECK_WHITELIST += "CVE-2019-0190"