summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl_1.1.1-pre9.bb
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2018-08-28 12:23:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-04 11:03:56 +0100
commitd9704260def0c2058ea62398cefff2e7574fba37 (patch)
tree1ca189cbc812c64d4a6f07581bb54dfb9fb854ed /meta/recipes-connectivity/openssl/openssl_1.1.1-pre9.bb
parent1343314af942b58fb659b06221d3df6ab299e35c (diff)
downloadpoky-d9704260def0c2058ea62398cefff2e7574fba37.tar.gz
openssl: update to 1.1.1
At the moment 1.1.1 is in pre-release stage, however the final release should be available within a few weeks. The major selling point is that it supports the new TLS 1.3 specification. It will also be the new long term support version. More information: https://www.openssl.org/policies/releasestrat.html (From OE-Core rev: 9f14a32a3b47b83877fe4fa58b13caeeb38f183a) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl_1.1.1-pre9.bb')
-rw-r--r--meta/recipes-connectivity/openssl/openssl_1.1.1-pre9.bb182
1 files changed, 182 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.1-pre9.bb b/meta/recipes-connectivity/openssl/openssl_1.1.1-pre9.bb
new file mode 100644
index 0000000000..1917c3301f
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl_1.1.1-pre9.bb
@@ -0,0 +1,182 @@
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 | SSLeay" dual license
8LICENSE = "openssl"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=d57d511030c9d66ef5f5966bee5a7eff"
10
11DEPENDS = "hostperl-runtime-native"
12
13SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
14 file://run-ptest \
15 file://openssl-c_rehash.sh \
16 "
17
18SRC_URI_append_class-nativesdk = " \
19 file://environment.d-openssl.sh \
20 "
21
22SRC_URI[md5sum] = "6aa32e976e2c9a4aee858ced135d2573"
23SRC_URI[sha256sum] = "95ebdfbb05e8451fb01a186ccaa4a7da0eff9a48999ede9fe1a7d90db75ccb4c"
24
25inherit lib_package multilib_header ptest
26
27#| ./libcrypto.so: undefined reference to `getcontext'
28#| ./libcrypto.so: undefined reference to `setcontext'
29#| ./libcrypto.so: undefined reference to `makecontext'
30CPPFLAGS_append_libc-musl = " -DOPENSSL_NO_ASYNC"
31
32# This prevents openssl from using getrandom() which is not available on older glibc versions
33# (native versions can be built with newer glibc, but then relocated onto a system with older glibc)
34EXTRA_OECONF_class-native = "--with-rand-seed=devrandom"
35EXTRA_OECONF_class-nativesdk = "--with-rand-seed=devrandom"
36
37# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate.
38CFLAGS_append_class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin"
39CFLAGS_append_class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin"
40
41do_configure () {
42 os=${HOST_OS}
43 case $os in
44 linux-gnueabi |\
45 linux-gnuspe |\
46 linux-musleabi |\
47 linux-muslspe |\
48 linux-musl )
49 os=linux
50 ;;
51 *)
52 ;;
53 esac
54 target="$os-${HOST_ARCH}"
55 case $target in
56 linux-arm*)
57 target=linux-armv4
58 ;;
59 linux-aarch64*)
60 target=linux-aarch64
61 ;;
62 linux-i?86 | linux-viac3)
63 target=linux-x86
64 ;;
65 linux-gnux32-x86_64 | linux-muslx32-x86_64 )
66 target=linux-x32
67 ;;
68 linux-gnu64-x86_64)
69 target=linux-x86_64
70 ;;
71 linux-mips | linux-mipsel)
72 # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags
73 target="linux-mips32 ${TARGET_CC_ARCH}"
74 ;;
75 linux-gnun32-mips*)
76 target=linux-mips64
77 ;;
78 linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el)
79 target=linux64-mips64
80 ;;
81 linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4)
82 target=linux-generic32
83 ;;
84 linux-powerpc)
85 target=linux-ppc
86 ;;
87 linux-powerpc64)
88 target=linux-ppc64
89 ;;
90 linux-riscv32)
91 target=linux-generic32
92 ;;
93 linux-riscv64)
94 target=linux-generic64
95 ;;
96 linux-sparc | linux-supersparc)
97 target=linux-sparcv9
98 ;;
99 esac
100
101 useprefix=${prefix}
102 if [ "x$useprefix" = "x" ]; then
103 useprefix=/
104 fi
105 # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the
106 # environment variables set by bitbake. Adjust the environment variables instead.
107 perl ./Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdir} $target
108}
109
110do_install () {
111 oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
112
113 oe_multilib_header openssl/opensslconf.h
114
115 # Create SSL structure for packages such as ca-certificates which
116 # contain hard-coded paths to /etc/ssl. Debian does the same.
117 install -d ${D}${sysconfdir}/ssl
118 mv ${D}${libdir}/ssl-1.1/certs \
119 ${D}${libdir}/ssl-1.1/private \
120 ${D}${libdir}/ssl-1.1/openssl.cnf \
121 ${D}${sysconfdir}/ssl/
122
123 # Although absolute symlinks would be OK for the target, they become
124 # invalid if native or nativesdk are relocated from sstate.
125 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs
126 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private
127 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf
128}
129
130do_install_append_class-native () {
131 create_wrapper ${D}${bindir}/openssl \
132 OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \
133 SSL_CERT_DIR=${libdir}/ssl-1.1/certs \
134 SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \
135 OPENSSL_ENGINES=${libdir}/ssl-1.1/engines
136
137 # Install a custom version of c_rehash that can handle sysroots properly.
138 # This version is used for example when installing ca-certificates during
139 # image creation.
140 install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
141 sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
142}
143
144do_install_append_class-nativesdk () {
145 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
146 install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
147 sed 's|/usr/lib/ssl/|/usr/lib/ssl-1.1/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
148}
149
150do_install_ptest () {
151 cp -r * ${D}${PTEST_PATH}
152
153 # Putting .so files in ptest package will mess up the dependencies of the main openssl package
154 # so we rename them to .so.ptest and patch the test accordingly
155 mv ${D}${PTEST_PATH}/libcrypto.so ${D}${PTEST_PATH}/libcrypto.so.ptest
156 mv ${D}${PTEST_PATH}/libssl.so ${D}${PTEST_PATH}/libssl.so.ptest
157 sed -i 's/$target{shared_extension_simple}/".so.ptest"/' ${D}${PTEST_PATH}/test/recipes/90-test_shlibload.t
158}
159
160# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
161# package RRECOMMENDS on this package. This will enable the configuration
162# file to be installed for both the openssl-bin package and the libcrypto
163# package since the openssl-bin package depends on the libcrypto package.
164
165PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc"
166
167FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
168FILES_libssl = "${libdir}/libssl${SOLIBS}"
169FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
170FILES_${PN}-engines = "${libdir}/engines-1.1"
171FILES_${PN}-misc = "${libdir}/ssl-1.1/misc"
172FILES_${PN} =+ "${libdir}/ssl-1.1/*"
173FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
174
175CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
176
177RRECOMMENDS_libcrypto += "openssl-conf"
178RDEPENDS_${PN}-bin = "perl"
179RDEPENDS_${PN}-misc = "perl"
180RDEPENDS_${PN}-ptest += "perl-module-file-spec-functions bash python"
181
182BBCLASSEXTEND = "native nativesdk"