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