diff options
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl_1.1.1n.bb')
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl_1.1.1n.bb | 250 |
1 files changed, 250 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.1n.bb b/meta/recipes-connectivity/openssl/openssl_1.1.1n.bb new file mode 100644 index 0000000000..df13abf54e --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl_1.1.1n.bb | |||
@@ -0,0 +1,250 @@ | |||
1 | SUMMARY = "Secure Socket Layer" | ||
2 | DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools." | ||
3 | HOMEPAGE = "http://www.openssl.org/" | ||
4 | BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html" | ||
5 | SECTION = "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) | ||
9 | LICENSE = "openssl" | ||
10 | LIC_FILES_CHKSUM = "file://LICENSE;md5=d343e62fc9c833710bbbed25f27364c8" | ||
11 | |||
12 | DEPENDS = "hostperl-runtime-native" | ||
13 | |||
14 | SRC_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 | " | ||
22 | |||
23 | SRC_URI_append_class-nativesdk = " \ | ||
24 | file://environment.d-openssl.sh \ | ||
25 | " | ||
26 | |||
27 | SRC_URI_append_riscv32 = " \ | ||
28 | file://0003-Add-support-for-io_pgetevents_time64-syscall.patch \ | ||
29 | file://0004-Fixup-support-for-io_pgetevents_time64-syscall.patch \ | ||
30 | " | ||
31 | |||
32 | SRC_URI[sha256sum] = "40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" | ||
33 | |||
34 | inherit lib_package multilib_header multilib_script ptest | ||
35 | MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" | ||
36 | |||
37 | PACKAGECONFIG ?= "" | ||
38 | PACKAGECONFIG_class-native = "" | ||
39 | PACKAGECONFIG_class-nativesdk = "" | ||
40 | |||
41 | PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module" | ||
42 | PACKAGECONFIG[no-tls1] = "no-tls1" | ||
43 | PACKAGECONFIG[no-tls1_1] = "no-tls1_1" | ||
44 | |||
45 | B = "${WORKDIR}/build" | ||
46 | do_configure[cleandirs] = "${B}" | ||
47 | |||
48 | #| ./libcrypto.so: undefined reference to `getcontext' | ||
49 | #| ./libcrypto.so: undefined reference to `setcontext' | ||
50 | #| ./libcrypto.so: undefined reference to `makecontext' | ||
51 | EXTRA_OECONF_append_libc-musl = " no-async" | ||
52 | EXTRA_OECONF_append_libc-musl_powerpc64 = " no-asm" | ||
53 | |||
54 | # adding devrandom prevents openssl from using getrandom() which is not available on older glibc versions | ||
55 | # (native versions can be built with newer glibc, but then relocated onto a system with older glibc) | ||
56 | EXTRA_OECONF_class-native = "--with-rand-seed=os,devrandom" | ||
57 | EXTRA_OECONF_class-nativesdk = "--with-rand-seed=os,devrandom" | ||
58 | |||
59 | # Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. | ||
60 | CFLAGS_append_class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" | ||
61 | CFLAGS_append_class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" | ||
62 | |||
63 | # Disable deprecated crypto algorithms | ||
64 | # Retained for compatibilty | ||
65 | # des (curl) | ||
66 | # dh (python-ssl) | ||
67 | # dsa (rpm) | ||
68 | # md4 (cyrus-sasl freeradius hostapd) | ||
69 | # bf (wvstreams postgresql x11vnc crda znc cfengine) | ||
70 | # rc4 (freerdp librtorrent ettercap xrdp transmission pam-ssh-agent-auth php) | ||
71 | # rc2 (mailx) | ||
72 | # psk (qt5) | ||
73 | # srp (libest) | ||
74 | # whirlpool (qca) | ||
75 | 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" | ||
76 | |||
77 | do_configure () { | ||
78 | os=${HOST_OS} | ||
79 | case $os in | ||
80 | linux-gnueabi |\ | ||
81 | linux-gnuspe |\ | ||
82 | linux-musleabi |\ | ||
83 | linux-muslspe |\ | ||
84 | linux-musl ) | ||
85 | os=linux | ||
86 | ;; | ||
87 | *) | ||
88 | ;; | ||
89 | esac | ||
90 | target="$os-${HOST_ARCH}" | ||
91 | case $target in | ||
92 | linux-arm*) | ||
93 | target=linux-armv4 | ||
94 | ;; | ||
95 | linux-aarch64*) | ||
96 | target=linux-aarch64 | ||
97 | ;; | ||
98 | linux-i?86 | linux-viac3) | ||
99 | target=linux-x86 | ||
100 | ;; | ||
101 | linux-gnux32-x86_64 | linux-muslx32-x86_64 ) | ||
102 | target=linux-x32 | ||
103 | ;; | ||
104 | linux-gnu64-x86_64) | ||
105 | target=linux-x86_64 | ||
106 | ;; | ||
107 | linux-mips | linux-mipsel) | ||
108 | # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags | ||
109 | target="linux-mips32 ${TARGET_CC_ARCH}" | ||
110 | ;; | ||
111 | linux-gnun32-mips*) | ||
112 | target=linux-mips64 | ||
113 | ;; | ||
114 | linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el) | ||
115 | target=linux64-mips64 | ||
116 | ;; | ||
117 | linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*) | ||
118 | target=linux-generic32 | ||
119 | ;; | ||
120 | linux-powerpc) | ||
121 | target=linux-ppc | ||
122 | ;; | ||
123 | linux-powerpc64) | ||
124 | target=linux-ppc64 | ||
125 | ;; | ||
126 | linux-powerpc64le) | ||
127 | target=linux-ppc64le | ||
128 | ;; | ||
129 | linux-riscv32) | ||
130 | target=linux-generic32 | ||
131 | ;; | ||
132 | linux-riscv64) | ||
133 | target=linux-generic64 | ||
134 | ;; | ||
135 | linux-sparc | linux-supersparc) | ||
136 | target=linux-sparcv9 | ||
137 | ;; | ||
138 | mingw32-x86_64) | ||
139 | target=mingw64 | ||
140 | ;; | ||
141 | esac | ||
142 | |||
143 | useprefix=${prefix} | ||
144 | if [ "x$useprefix" = "x" ]; then | ||
145 | useprefix=/ | ||
146 | fi | ||
147 | # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the | ||
148 | # environment variables set by bitbake. Adjust the environment variables instead. | ||
149 | HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \ | ||
150 | perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} ${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdir} $target | ||
151 | perl ${B}/configdata.pm --dump | ||
152 | } | ||
153 | |||
154 | do_install () { | ||
155 | oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install | ||
156 | |||
157 | oe_multilib_header openssl/opensslconf.h | ||
158 | |||
159 | # Create SSL structure for packages such as ca-certificates which | ||
160 | # contain hard-coded paths to /etc/ssl. Debian does the same. | ||
161 | install -d ${D}${sysconfdir}/ssl | ||
162 | mv ${D}${libdir}/ssl-1.1/certs \ | ||
163 | ${D}${libdir}/ssl-1.1/private \ | ||
164 | ${D}${libdir}/ssl-1.1/openssl.cnf \ | ||
165 | ${D}${sysconfdir}/ssl/ | ||
166 | |||
167 | # Although absolute symlinks would be OK for the target, they become | ||
168 | # invalid if native or nativesdk are relocated from sstate. | ||
169 | ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs | ||
170 | ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private | ||
171 | ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf | ||
172 | } | ||
173 | |||
174 | do_install_append_class-native () { | ||
175 | create_wrapper ${D}${bindir}/openssl \ | ||
176 | OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \ | ||
177 | SSL_CERT_DIR=${libdir}/ssl-1.1/certs \ | ||
178 | SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \ | ||
179 | OPENSSL_ENGINES=${libdir}/engines-1.1 | ||
180 | } | ||
181 | |||
182 | do_install_append_class-nativesdk () { | ||
183 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d | ||
184 | install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh | ||
185 | sed 's|/usr/lib/ssl/|/usr/lib/ssl-1.1/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh | ||
186 | } | ||
187 | |||
188 | PTEST_BUILD_HOST_FILES += "configdata.pm" | ||
189 | PTEST_BUILD_HOST_PATTERN = "perl_version =" | ||
190 | do_install_ptest () { | ||
191 | # Prune the build tree | ||
192 | rm -f ${B}/fuzz/*.* ${B}/test/*.* | ||
193 | |||
194 | cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH} | ||
195 | cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util ${D}${PTEST_PATH} | ||
196 | |||
197 | # For test_shlibload | ||
198 | ln -s ${libdir}/libcrypto.so.1.1 ${D}${PTEST_PATH}/ | ||
199 | ln -s ${libdir}/libssl.so.1.1 ${D}${PTEST_PATH}/ | ||
200 | |||
201 | install -d ${D}${PTEST_PATH}/apps | ||
202 | ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps | ||
203 | install -m644 ${S}/apps/*.pem ${S}/apps/*.srl ${S}/apps/openssl.cnf ${D}${PTEST_PATH}/apps | ||
204 | install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps | ||
205 | |||
206 | install -d ${D}${PTEST_PATH}/engines | ||
207 | install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines | ||
208 | install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines | ||
209 | |||
210 | # seems to be needed with perl 5.32.1 | ||
211 | install -d ${D}${PTEST_PATH}/util/perl/recipes | ||
212 | cp ${D}${PTEST_PATH}/test/recipes/tconversion.pl ${D}${PTEST_PATH}/util/perl/recipes/ | ||
213 | } | ||
214 | |||
215 | # Add the openssl.cnf file to the openssl-conf package. Make the libcrypto | ||
216 | # package RRECOMMENDS on this package. This will enable the configuration | ||
217 | # file to be installed for both the openssl-bin package and the libcrypto | ||
218 | # package since the openssl-bin package depends on the libcrypto package. | ||
219 | |||
220 | PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc" | ||
221 | |||
222 | FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}" | ||
223 | FILES_libssl = "${libdir}/libssl${SOLIBS}" | ||
224 | FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf \ | ||
225 | ${libdir}/ssl-1.1/openssl.cnf* \ | ||
226 | " | ||
227 | FILES_${PN}-engines = "${libdir}/engines-1.1" | ||
228 | # ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP) | ||
229 | FILES_${PN}-engines_append_mingw32_class-nativesdk = " ${prefix}${libdir}/engines-1_1" | ||
230 | FILES_${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash" | ||
231 | FILES_${PN} =+ "${libdir}/ssl-1.1/*" | ||
232 | FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" | ||
233 | |||
234 | CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" | ||
235 | |||
236 | RRECOMMENDS_libcrypto += "openssl-conf" | ||
237 | RDEPENDS_${PN}-misc = "perl" | ||
238 | RDEPENDS_${PN}-ptest += "openssl-bin perl perl-modules bash" | ||
239 | |||
240 | RDEPENDS_${PN}-bin += "openssl-conf" | ||
241 | |||
242 | BBCLASSEXTEND = "native nativesdk" | ||
243 | |||
244 | CVE_PRODUCT = "openssl:openssl" | ||
245 | |||
246 | CVE_VERSION_SUFFIX = "alphabetical" | ||
247 | |||
248 | # Only affects OpenSSL >= 1.1.1 in combination with Apache < 2.4.37 | ||
249 | # Apache in meta-webserver is already recent enough | ||
250 | CVE_CHECK_WHITELIST += "CVE-2019-0190" | ||