summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity
diff options
context:
space:
mode:
authorCristian Bercaru <cristian.bercaru@enea.com>2018-05-14 15:09:15 +0200
committerCristian Bercaru <cristian.bercaru@enea.com>2018-05-14 15:09:15 +0200
commitc4127de63ca38ca6bdcfb8b75c84589ab887893f (patch)
tree1af5f1e669eeaafbd19e470094fb725283094271 /recipes-connectivity
parent522cbc53e56efb9ca3b9b775e8ee1bb095fc220a (diff)
downloadmeta-freescale-c4127de63ca38ca6bdcfb8b75c84589ab887893f.tar.gz
openssl-qoriq: add version 1.1.0hpyro-fnc-el7
Diffstat (limited to 'recipes-connectivity')
-rwxr-xr-xrecipes-connectivity/openssl/openssl-qoriq/perlpath.pl35
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/run-ptest.new4
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq_1.1.0h.bb79
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc267
4 files changed, 385 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl-qoriq/perlpath.pl b/recipes-connectivity/openssl/openssl-qoriq/perlpath.pl
new file mode 100755
index 00000000..79d4a406
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq/perlpath.pl
@@ -0,0 +1,35 @@
1#!/media/data/fb/daaz/p2040/tmp/work/ppce500mc-qoriq-poky-linux/openssl-qoriq/1.0.2l-r0/recipe-sysroot-native/usr/bin/perl
2#
3# modify the '#!/usr/local/bin/perl'
4# line in all scripts that rely on perl.
5#
6
7require "find.pl";
8
9$#ARGV == 0 || print STDERR "usage: perlpath newpath (eg /usr/bin)\n";
10&find(".");
11
12sub wanted
13 {
14 return unless /\.pl$/ || /^[Cc]onfigur/;
15
16 open(IN,"<$_") || die "unable to open $dir/$_:$!\n";
17 @a=<IN>;
18 close(IN);
19
20 if (-d $ARGV[0]) {
21 $a[0]="#!$ARGV[0]/perl\n";
22 }
23 else {
24 $a[0]="#!$ARGV[0]\n";
25 }
26
27 # Playing it safe...
28 $new="$_.new";
29 open(OUT,">$new") || die "unable to open $dir/$new:$!\n";
30 print OUT @a;
31 close(OUT);
32
33 rename($new,$_) || die "unable to rename $dir/$new:$!\n";
34 chmod(0755,$_) || die "unable to chmod $dir/$new:$!\n";
35 }
diff --git a/recipes-connectivity/openssl/openssl-qoriq/run-ptest.new b/recipes-connectivity/openssl/openssl-qoriq/run-ptest.new
new file mode 100644
index 00000000..65c6cc7b
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq/run-ptest.new
@@ -0,0 +1,4 @@
1#!/bin/sh
2cd test
3OPENSSL_ENGINES=../engines BLDTOP=.. SRCTOP=.. perl run_tests.pl
4cd ..
diff --git a/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.bb b/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.bb
new file mode 100644
index 00000000..53a21814
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.bb
@@ -0,0 +1,79 @@
1require openssl-qoriq_1.1.0h.inc
2
3DISABLE_STATIC = ""
4# For target side versions of openssl enable support for OCF Linux driver
5# if they are available.
6DEPENDS += "cryptodev-linux"
7
8CFLAGS += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
9
10LIC_FILES_CHKSUM = "file://LICENSE;md5=d57d511030c9d66ef5f5966bee5a7eff"
11
12SRC_URI[md5sum] = "5271477e4d93f4ea032b665ef095ff24"
13
14export DIRS = "crypto ssl apps engines"
15export OE_LDFLAGS="${LDFLAGS}"
16
17SRC_URI = " \
18 https://www.openssl.org/source/openssl-1.1.0h.tar.gz \
19 file://openssl-c_rehash.sh \
20 file://run-ptest \
21 file://perlpath.pl \
22 file://find.pl \
23 file://debian/pic.patch \
24 file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \
25 file://openssl-1.0.2a-x32-asm.patch \
26 "
27# file://0001-Fix-build-with-clang-using-external-assembler.patch \
28# file://Use-SHA256-not-MD5-as-default-digest.patch \
29# file://openssl-util-perlpath.pl-cwd.patch \
30# file://parallel.patch \
31# file://configure-musl-target.patch \
32# file://ptest_makefile_deps.patch \
33# file://ptest-deps.patch \
34# file://Makefiles-ptest.patch \
35# file://openssl-fix-des.pod-error.patch \
36# file://openssl_fix_for_x32.patch \
37# file://debian1.0.2/soname.patch \
38# file://debian1.0.2/version-script.patch \
39# file://debian/no-symbolic.patch \
40# file://debian/no-rpath.patch \
41# file://debian/man-dir.patch \
42# file://debian/man-section.patch \
43# file://debian/debian-targets.patch \
44# file://debian/c_rehash-compat.patch \
45# file://debian/ca.patch \
46# file://debian1.0.2/block_digicert_malaysia.patch \
47# file://debian1.0.2/block_diginotar.patch \
48# file://engines-install-in-libdir-ssl.patch \
49# file://oe-ldflags.patch \
50# file://shared-libs.patch \
51# file://configure-targets.patch
52#
53
54S = "${WORKDIR}/openssl-1.1.0h/"
55
56PACKAGES =+ "${PN}-engines"
57
58FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines ${libdir}/engines-1.1/*.so"
59
60# The crypto_use_bigint patch means that perl's bignum module needs to be
61# installed, but some distributions (for example Fedora 23) don't ship it by
62# default. As the resulting error is very misleading check for bignum before
63# building.
64do_configure_prepend() {
65 mkdir -p ${S}/util/
66 cp ${WORKDIR}/perlpath.pl ${S}/util/
67 cp ${WORKDIR}/find.pl ${S}/util/
68 if ! perl -Mbigint -e true; then
69 bbfatal "The perl module 'bignum' was not found but this is required to build openssl. Please install this module (often packaged as perl-bignum) and re-run bitbake."
70 fi
71}
72
73do_compile_ptest_base() {
74 echo
75}
76
77TARGET_CC_ARCH += "${LDFLAGS}"
78
79COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc b/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc
new file mode 100644
index 00000000..db768084
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc
@@ -0,0 +1,267 @@
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=f9a8f968107345e0b75aa8c2ecaa7ec8"
10
11DEPENDS = "makedepend-native hostperl-runtime-native"
12DEPENDS_append_class-target = " openssl-native"
13
14PROVIDES = "openssl"
15
16python() {
17 pkgs = d.getVar('PACKAGES', True).split()
18 for p in pkgs:
19 if 'openssl-qoriq' in p:
20 d.appendVar("RPROVIDES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
21 d.appendVar("RCONFLICTS_%s" % p, p.replace('openssl-qoriq', 'openssl'))
22 d.appendVar("RREPLACES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
23}
24
25SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/openssl;nobranch=1"
26
27S = "${WORKDIR}/git"
28
29PACKAGECONFIG[perl] = ",,,"
30
31TERMIO_libc-musl = "-DTERMIOS"
32TERMIO ?= "-DTERMIO"
33# Avoid binaries being marked as requiring an executable stack since it
34# doesn't(which causes and this causes issues with SELinux
35CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
36 ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
37
38export DIRS = "crypto ssl apps"
39export EX_LIBS = "-lgcc -ldl"
40export AS = "${CC} -c"
41
42inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
43
44PACKAGES =+ "libcrypto libssl ${PN}-misc ${PN}-conf"
45FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
46FILES_libssl = "${libdir}/libssl${SOLIBS}"
47FILES_${PN} =+ " ${libdir}/ssl/*"
48FILES_${PN}-misc = "${libdir}/ssl/misc"
49RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
50
51PROVIDES += "openssl10"
52
53# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
54# package RRECOMMENDS on this package. This will enable the configuration
55# file to be installed for both the base openssl package and the libcrypto
56# package since the base openssl package depends on the libcrypto package.
57FILES_${PN}-conf = "${sysconfdir}/ssl/openssl.cnf"
58CONFFILES_${PN}-conf = "${sysconfdir}/ssl/openssl.cnf"
59RRECOMMENDS_libcrypto += "${PN}-conf"
60RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
61
62# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
63# vulnerability
64EXTRA_OECONF = " -no-ssl3"
65
66do_configure_prepend_darwin () {
67 sed -i -e '/version-script=openssl\.ld/d' Configure
68}
69
70do_configure () {
71 cd util
72 perl perlpath.pl ${STAGING_BINDIR_NATIVE}
73 cd ..
74 ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
75
76 os=${HOST_OS}
77 case $os in
78 linux-uclibc |\
79 linux-uclibceabi |\
80 linux-gnueabi |\
81 linux-uclibcspe |\
82 linux-gnuspe |\
83 linux-musl*)
84 os=linux
85 ;;
86 *)
87 ;;
88 esac
89 target="$os-${HOST_ARCH}"
90 case $target in
91 linux-arm)
92 target=linux-armv4
93 ;;
94 linux-armeb)
95 target=linux-elf-armeb
96 ;;
97 linux-aarch64*)
98 target=linux-aarch64
99 ;;
100 linux-sh3)
101 target=debian-sh3
102 ;;
103 linux-sh4)
104 target=debian-sh4
105 ;;
106 linux-i486)
107 target=debian-i386-i486
108 ;;
109 linux-i586 | linux-viac3)
110 target=debian-i386-i586
111 ;;
112 linux-i686)
113 target=debian-i386-i686/cmov
114 ;;
115 linux-gnux32-x86_64)
116 target=linux-x32
117 ;;
118 linux-gnu64-x86_64)
119 target=linux-x86_64
120 ;;
121 linux-gnun32-mips*el)
122 target=debian-mipsn32el
123 ;;
124 linux-gnun32-mips*)
125 target=debian-mipsn32
126 ;;
127 linux-mips*64*el)
128 target=debian-mips64el
129 ;;
130 linux-mips*64*)
131 target=debian-mips64
132 ;;
133 linux-mips*el)
134 target=debian-mipsel
135 ;;
136 linux-mips*)
137 target=debian-mips
138 ;;
139 linux-microblaze*|linux-nios2*)
140 target=linux-generic32
141 ;;
142 linux-powerpc)
143 target=linux-ppc
144 ;;
145 linux-powerpc64)
146 target=linux-ppc64
147 ;;
148 linux-supersparc)
149 target=linux-sparcv8
150 ;;
151 linux-sparc)
152 target=linux-sparcv8
153 ;;
154 darwin-i386)
155 target=darwin-i386-cc
156 ;;
157 esac
158 # inject machine-specific flags
159 sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
160 useprefix=${prefix}
161 if [ "x$useprefix" = "x" ]; then
162 useprefix=/
163 fi
164 perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target
165}
166
167do_compile_prepend_class-target () {
168 sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
169}
170
171do_compile () {
172 oe_runmake depend
173 oe_runmake
174}
175
176do_compile_ptest () {
177 # build dependencies for test directory too
178 rm -rf test/ssltest_old
179 rm -rf test/x509aux
180 rm -rf test/v3ext
181 export DIRS="$DIRS test"
182 oe_runmake depend
183 oe_runmake buildtest
184}
185
186do_install () {
187 # Create ${D}/${prefix} to fix parallel issues
188 mkdir -p ${D}/${prefix}/
189
190 oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" DESTDIR="${D}" install
191
192 oe_libinstall -so libcrypto ${D}${libdir}
193 oe_libinstall -so libssl ${D}${libdir}
194 oe_libinstall -so capi ${D}${libdir}
195 oe_libinstall -so padlock ${D}${libdir}
196
197 install -d ${D}${includedir}
198 cp --dereference -R include/openssl ${D}${includedir}
199
200 install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
201 sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
202
203 oe_multilib_header openssl/opensslconf.h
204 if [ "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" ]; then
205 sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
206 sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
207 else
208 rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
209 fi
210
211 # Create SSL structure
212 install -d ${D}${sysconfdir}/ssl/
213 mv ${D}${libdir}/ssl/openssl.cnf \
214 ${D}${libdir}/ssl/certs \
215 ${D}${libdir}/ssl/private \
216 \
217 ${D}${sysconfdir}/ssl/
218 ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl/certs
219 ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl/private
220 ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl/openssl.cnf
221}
222
223do_install_ptest () {
224 # cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
225 cp -r -L Makefile test ${D}${PTEST_PATH}
226
227 # Replace the path to native perl with the path to target perl
228 sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
229
230 cp Configure config e_os.h ${D}${PTEST_PATH}
231 cp -r -L include ${D}${PTEST_PATH}
232 ln -sf ${libdir}/libcrypto.a ${D}${PTEST_PATH}
233 ln -sf ${libdir}/libssl.a ${D}${PTEST_PATH}
234 mkdir -p ${D}${PTEST_PATH}/crypto
235 cp include/internal/constant_time_locl.h ${D}${PTEST_PATH}/crypto
236 cp -r demos/certs ${D}${PTEST_PATH}
237 mkdir -p ${D}${PTEST_PATH}/apps
238 ln -sf ${libdir}/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps
239 ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
240 ln -sf ${bindir}/openssl ${D}${PTEST_PATH}/apps
241 cp apps/server.pem ${D}${PTEST_PATH}/apps
242 cp apps/server2.pem ${D}${PTEST_PATH}/apps
243 mkdir -p ${D}${PTEST_PATH}/util
244 install util/opensslwrap.sh ${D}${PTEST_PATH}/util
245 install util/shlib_wrap.sh ${D}${PTEST_PATH}/util
246 # Time stamps are relevant for "make alltests", otherwise
247 # make may try to recompile binaries. Not only must the
248 # binary files be newer than the sources, they also must
249 # be more recent than the header files in /usr/include.
250 #
251 # Using "cp -a" is not sufficient, because do_install
252 # does not preserve the original time stamps.
253 #
254 # So instead of using the original file stamps, we set
255 # the current time for all files. Binaries will get
256 # modified again later when stripping them, but that's okay.
257 touch ${D}${PTEST_PATH}
258 find ${D}${PTEST_PATH} -type f -print0 | xargs --verbose -0 touch -r ${D}${PTEST_PATH}
259}
260
261do_install_append_class-native() {
262 create_wrapper ${D}${bindir}/openssl \
263 OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
264 SSL_CERT_DIR=${libdir}/ssl/certs \
265 SSL_CERT_FILE=${libdir}/ssl/cert.pem \
266 OPENSSL_ENGINES=${libdir}/ssl/engines
267}