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