summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity
diff options
context:
space:
mode:
authorChunrong Guo <chunrong.guo@nxp.com>2019-10-15 14:53:45 +0800
committerOtavio Salvador <otavio@ossystems.com.br>2019-10-21 09:07:06 -0300
commit5acc00bf16900b59a49f8804bda5a5ce507d1917 (patch)
tree8ff93bfb7597ce4b5d90a66bb8e79e078ff82add /recipes-connectivity
parentb52c7a789b9a5ff7f8fe382ba8c93f9bb12a491c (diff)
downloadmeta-freescale-5acc00bf16900b59a49f8804bda5a5ce507d1917.tar.gz
openssl-qoriq: Upgrade 1.1.0g -> 1.1.1d
*update to lsdk 1909 tag include the following changes: 894da2f - Prepare for 1.1.1d release 1cb7eff - Update copyright year a95b081 - Remove duplicate CHANGES entry 08229ad - Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey 7ff84d8 - Update CHANGES and NEWS for the new release 79f5e2f - Fix a potential crash in rand_unix.c 1d36536 - Fix a strict warnings error in rand_pool_acquire_entropy 6318018 - drbg: fix issue where DRBG_CTR fails if NO_DF is used (2nd attempt) 5520695 - drbg: add fork id to additional data on UNIX systems 1b0fe00 - drbg: ensure fork-safety without using a pthread_atfork handler 73a683b - [test] ECC: check the bounds for auto computing cofactor 827eab4 - Fix build with VS2008 4bf9781 - Use BN_clear_free in DH_set0_key 8003138 - DH_check_pub_key_ex was accidentally calling DH_check, so results were undefined. 1f9dc86 - Change DH_generate_parameters back to order 2q subgroup 288241b - Fix spacing nit in test/ectest.c 9a43a73 - [ec] Match built-in curves on EC_GROUP_new_from_ecparameters ad9c296 - Configure: clang: move -Wno-unknown-warning-option to the front 9580391 - Append CVE-2019-1547 to related CHANGES entry 87bea65 - Remove x86/x86_64 BSAES and AES_ASM support a6186f3 - CHANGES entry: for ECC parameters with NULL or zero cofactor, compute it eb1ec38 - [test] computing ECC cofactors: regression test 30c22fa - [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it ed0ac11 - [ec/ecp_nistp*.c] restyle: use {} around `else` too Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
Diffstat (limited to 'recipes-connectivity')
-rw-r--r--recipes-connectivity/openssl/files/environment.d-openssl.sh1
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/0001-Remove-test-that-requires-running-as-non-root.patch49
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/0001-Take-linking-flags-from-LDFLAGS-env-var.patch43
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch88
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch76
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/0001-skip-test_symbol_presence.patch29
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/afalg.patch31
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/openssl-c_rehash.sh222
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/run-ptest14
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq_1.1.0g.bb184
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq_1.1.1d.bb217
11 files changed, 365 insertions, 589 deletions
diff --git a/recipes-connectivity/openssl/files/environment.d-openssl.sh b/recipes-connectivity/openssl/files/environment.d-openssl.sh
new file mode 100644
index 00000000..b9cc24a7
--- /dev/null
+++ b/recipes-connectivity/openssl/files/environment.d-openssl.sh
@@ -0,0 +1 @@
export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf"
diff --git a/recipes-connectivity/openssl/openssl-qoriq/0001-Remove-test-that-requires-running-as-non-root.patch b/recipes-connectivity/openssl/openssl-qoriq/0001-Remove-test-that-requires-running-as-non-root.patch
deleted file mode 100644
index 736bb39a..00000000
--- a/recipes-connectivity/openssl/openssl-qoriq/0001-Remove-test-that-requires-running-as-non-root.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From 3fdb1e2a16ea405c6731447a8994f222808ef7e6 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 7 Apr 2017 18:01:52 +0300
4Subject: [PATCH] Remove test that requires running as non-root
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 test/recipes/40-test_rehash.t | 17 +----------------
10 1 file changed, 1 insertion(+), 16 deletions(-)
11
12diff --git a/test/recipes/40-test_rehash.t b/test/recipes/40-test_rehash.t
13index f902c23..c7567c1 100644
14--- a/test/recipes/40-test_rehash.t
15+++ b/test/recipes/40-test_rehash.t
16@@ -23,7 +23,7 @@ setup("test_rehash");
17 plan skip_all => "test_rehash is not available on this platform"
18 unless run(app(["openssl", "rehash", "-help"]));
19
20-plan tests => 5;
21+plan tests => 3;
22
23 indir "rehash.$$" => sub {
24 prepare();
25@@ -42,21 +42,6 @@ indir "rehash.$$" => sub {
26 'Testing rehash operations on empty directory');
27 }, create => 1, cleanup => 1;
28
29-indir "rehash.$$" => sub {
30- prepare();
31- chmod 0500, curdir();
32- SKIP: {
33- if (!ok(!open(FOO, ">unwritable.txt"),
34- "Testing that we aren't running as a privileged user, such as root")) {
35- close FOO;
36- skip "It's pointless to run the next test as root", 1;
37- }
38- isnt(run(app(["openssl", "rehash", curdir()])), 1,
39- 'Testing rehash operations on readonly directory');
40- }
41- chmod 0700, curdir(); # make it writable again, so cleanup works
42-}, create => 1, cleanup => 1;
43-
44 sub prepare {
45 my @pemsourcefiles = sort glob(srctop_file('test', "*.pem"));
46 my @destfiles = ();
47--
482.11.0
49
diff --git a/recipes-connectivity/openssl/openssl-qoriq/0001-Take-linking-flags-from-LDFLAGS-env-var.patch b/recipes-connectivity/openssl/openssl-qoriq/0001-Take-linking-flags-from-LDFLAGS-env-var.patch
deleted file mode 100644
index 6ce4e47d..00000000
--- a/recipes-connectivity/openssl/openssl-qoriq/0001-Take-linking-flags-from-LDFLAGS-env-var.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 08face4353d80111973aba9c1304c92158cfad0e Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 28 Mar 2017 16:40:12 +0300
4Subject: [PATCH] Take linking flags from LDFLAGS env var
5
6This fixes "No GNU_HASH in the elf binary" issues.
7
8Upstream-Status: Inappropriate [oe-core specific]
9Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
10---
11 Configurations/unix-Makefile.tmpl | 2 +-
12 Configure | 2 +-
13 2 files changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
16index c029817..43b769b 100644
17--- a/Configurations/unix-Makefile.tmpl
18+++ b/Configurations/unix-Makefile.tmpl
19@@ -173,7 +173,7 @@ CROSS_COMPILE= {- $config{cross_compile_prefix} -}
20 CC= $(CROSS_COMPILE){- $target{cc} -}
21 CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -}
22 CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
23-LDFLAGS= {- $target{lflags} -}
24+LDFLAGS= {- $target{lflags}." ".$ENV{'LDFLAGS'} -}
25 PLIB_LDFLAGS= {- $target{plib_lflags} -}
26 EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -}
27 LIB_CFLAGS={- $target{shared_cflag} || "" -}
28diff --git a/Configure b/Configure
29index aee7cc3..274d236 100755
30--- a/Configure
31+++ b/Configure
32@@ -979,7 +979,7 @@ $config{build_file} = $target{build_file};
33 $config{defines} = [];
34 $config{cflags} = "";
35 $config{ex_libs} = "";
36-$config{shared_ldflag} = "";
37+$config{shared_ldflag} = $ENV{'LDFLAGS'};
38
39 # Make sure build_scheme is consistent.
40 $target{build_scheme} = [ $target{build_scheme} ]
41--
422.11.0
43
diff --git a/recipes-connectivity/openssl/openssl-qoriq/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch b/recipes-connectivity/openssl/openssl-qoriq/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch
deleted file mode 100644
index bb0a1689..00000000
--- a/recipes-connectivity/openssl/openssl-qoriq/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch
+++ /dev/null
@@ -1,88 +0,0 @@
1From bcc096a50811bf0f0c4fd34b2993fed7a7015972 Mon Sep 17 00:00:00 2001
2From: Andy Polyakov <appro@openssl.org>
3Date: Fri, 3 Nov 2017 23:30:01 +0100
4Subject: [PATCH] aes/asm/{aes-armv4|bsaes-armv7}.pl: make it work with
5 binutils-2.29.
6
7It's not clear if it's a feature or bug, but binutils-2.29[.1]
8interprets 'adr' instruction with Thumb2 code reference differently,
9in a way that affects calculation of addresses of constants' tables.
10
11Upstream-Status: Backport
12
13Reviewed-by: Tim Hudson <tjh@openssl.org>
14Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
15Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
16(Merged from https://github.com/openssl/openssl/pull/4669)
17
18(cherry picked from commit b82acc3c1a7f304c9df31841753a0fa76b5b3cda)
19---
20 crypto/aes/asm/aes-armv4.pl | 6 +++---
21 crypto/aes/asm/bsaes-armv7.pl | 6 +++---
22 2 files changed, 6 insertions(+), 6 deletions(-)
23
24diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl
25index 16d79aae53..c6474b8aad 100644
26--- a/crypto/aes/asm/aes-armv4.pl
27+++ b/crypto/aes/asm/aes-armv4.pl
28@@ -200,7 +200,7 @@ AES_encrypt:
29 #ifndef __thumb2__
30 sub r3,pc,#8 @ AES_encrypt
31 #else
32- adr r3,AES_encrypt
33+ adr r3,.
34 #endif
35 stmdb sp!,{r1,r4-r12,lr}
36 #ifdef __APPLE__
37@@ -450,7 +450,7 @@ _armv4_AES_set_encrypt_key:
38 #ifndef __thumb2__
39 sub r3,pc,#8 @ AES_set_encrypt_key
40 #else
41- adr r3,AES_set_encrypt_key
42+ adr r3,.
43 #endif
44 teq r0,#0
45 #ifdef __thumb2__
46@@ -976,7 +976,7 @@ AES_decrypt:
47 #ifndef __thumb2__
48 sub r3,pc,#8 @ AES_decrypt
49 #else
50- adr r3,AES_decrypt
51+ adr r3,.
52 #endif
53 stmdb sp!,{r1,r4-r12,lr}
54 #ifdef __APPLE__
55diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl
56index 9f288660ef..a27bb4a179 100644
57--- a/crypto/aes/asm/bsaes-armv7.pl
58+++ b/crypto/aes/asm/bsaes-armv7.pl
59@@ -744,7 +744,7 @@ $code.=<<___;
60 .type _bsaes_decrypt8,%function
61 .align 4
62 _bsaes_decrypt8:
63- adr $const,_bsaes_decrypt8
64+ adr $const,.
65 vldmia $key!, {@XMM[9]} @ round 0 key
66 #ifdef __APPLE__
67 adr $const,.LM0ISR
68@@ -843,7 +843,7 @@ _bsaes_const:
69 .type _bsaes_encrypt8,%function
70 .align 4
71 _bsaes_encrypt8:
72- adr $const,_bsaes_encrypt8
73+ adr $const,.
74 vldmia $key!, {@XMM[9]} @ round 0 key
75 #ifdef __APPLE__
76 adr $const,.LM0SR
77@@ -951,7 +951,7 @@ $code.=<<___;
78 .type _bsaes_key_convert,%function
79 .align 4
80 _bsaes_key_convert:
81- adr $const,_bsaes_key_convert
82+ adr $const,.
83 vld1.8 {@XMM[7]}, [$inp]! @ load round 0 key
84 #ifdef __APPLE__
85 adr $const,.LM0
86--
872.15.0
88
diff --git a/recipes-connectivity/openssl/openssl-qoriq/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch b/recipes-connectivity/openssl/openssl-qoriq/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch
new file mode 100644
index 00000000..949c7883
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch
@@ -0,0 +1,76 @@
1From 3e1d00481093e10775eaf69d619c45b32a4aa7dc Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <martin@geanix.com>
3Date: Tue, 6 Nov 2018 14:50:47 +0100
4Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler
5 info
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10The openssl build system generates buildinf.h containing the full
11compiler command line used to compile objects. This breaks
12reproducibility, as the compile command is baked into libcrypto, where
13it is used when running `openssl version -f`.
14
15Add stripped build variables for the compiler and cflags lines, and use
16those when generating buildinfo.h.
17
18This is based on a similar patch for older openssl versions:
19https://patchwork.openembedded.org/patch/147229/
20
21Upstream-Status: Inappropriate [OE specific]
22Signed-off-by: Martin Hundebøll <martin@geanix.com>
23
24
25Update to fix buildpaths qa issue for '-fmacro-prefix-map'.
26
27Signed-off-by: Kai Kang <kai.kang@windriver.com>
28---
29 Configurations/unix-Makefile.tmpl | 10 +++++++++-
30 crypto/build.info | 2 +-
31 2 files changed, 10 insertions(+), 2 deletions(-)
32
33diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
34index 16af4d2087..54c162784c 100644
35--- a/Configurations/unix-Makefile.tmpl
36+++ b/Configurations/unix-Makefile.tmpl
37@@ -317,13 +317,22 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
38 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
39 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
40
41-# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
42+# *_Q variables are used for one thing only: to build up buildinf.h
43 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
44 $cppflags2 =~ s|([\\"])|\\$1|g;
45 $lib_cppflags =~ s|([\\"])|\\$1|g;
46 join(' ', $lib_cppflags || (), $cppflags2 || (),
47 $cppflags1 || ()) -}
48
49+CFLAGS_Q={- for (@{$config{CFLAGS}}) {
50+ s|-fdebug-prefix-map=[^ ]+|-fdebug-prefix-map=|g;
51+ s|-fmacro-prefix-map=[^ ]+|-fmacro-prefix-map=|g;
52+ }
53+ join(' ', @{$config{CFLAGS}}) -}
54+
55+CC_Q={- $config{CC} =~ s|--sysroot=[^ ]+|--sysroot=recipe-sysroot|g;
56+ join(' ', $config{CC}) -}
57+
58 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
59
60 # For x86 assembler: Set PROCESSOR to 386 if you want to support
61diff --git a/crypto/build.info b/crypto/build.info
62index b515b7318e..8c9cee2a09 100644
63--- a/crypto/build.info
64+++ b/crypto/build.info
65@@ -10,7 +10,7 @@ EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \
66 ppccpuid.pl pariscid.pl alphacpuid.pl arm64cpuid.pl armv4cpuid.pl
67
68 DEPEND[cversion.o]=buildinf.h
69-GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"
70+GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC_Q) $(CFLAGS_Q) $(CPPFLAGS_Q)" "$(PLATFORM)"
71 DEPEND[buildinf.h]=../configdata.pm
72
73 GENERATE[uplink-x86.s]=../ms/uplink-x86.pl $(PERLASM_SCHEME)
74--
752.19.1
76
diff --git a/recipes-connectivity/openssl/openssl-qoriq/0001-skip-test_symbol_presence.patch b/recipes-connectivity/openssl/openssl-qoriq/0001-skip-test_symbol_presence.patch
new file mode 100644
index 00000000..e632bc45
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq/0001-skip-test_symbol_presence.patch
@@ -0,0 +1,29 @@
1From 097b9081eced6ffc13c6cbb83abf7110baeca902 Mon Sep 17 00:00:00 2001
2From: Chunrong Guo <chunrong.guo@nxp.com>
3Date: Mon, 14 Oct 2019 14:59:11 +0800
4Subject: [PATCH] skip test_symbol_presence
5
6Upstream-Status: Inappropriate [OE Specific]
7
8Signed-off-by: BJ DevOps Team <bjdevops@NXP1.onmicrosoft.com>
9---
10 test/recipes/01-test_symbol_presence.t | 3 +--
11 1 file changed, 1 insertion(+), 2 deletions(-)
12
13diff --git a/test/recipes/01-test_symbol_presence.t b/test/recipes/01-test_symbol_presence.t
14index 7f2a2d7..918a8a19 100644
15--- a/test/recipes/01-test_symbol_presence.t
16+++ b/test/recipes/01-test_symbol_presence.t
17@@ -14,8 +14,7 @@ use OpenSSL::Test::Utils;
18
19 setup("test_symbol_presence");
20
21-plan skip_all => "Only useful when building shared libraries"
22- if disabled("shared");
23+plan skip_all => "The case needs debug symbols then we just disable it";
24
25 my @libnames = ("crypto", "ssl");
26 my $testcount = scalar @libnames;
27--
282.7.4
29
diff --git a/recipes-connectivity/openssl/openssl-qoriq/afalg.patch b/recipes-connectivity/openssl/openssl-qoriq/afalg.patch
new file mode 100644
index 00000000..b7c0e969
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq/afalg.patch
@@ -0,0 +1,31 @@
1Don't refuse to build afalgeng if cross-compiling or the host kernel is too old.
2
3Upstream-Status: Submitted [hhttps://github.com/openssl/openssl/pull/7688]
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6diff --git a/Configure b/Configure
7index 3baa8ce..9ef52ed 100755
8--- a/Configure
9+++ b/Configure
10@@ -1550,20 +1550,7 @@ unless ($disabled{"crypto-mdebug-backtrace"})
11 unless ($disabled{afalgeng}) {
12 $config{afalgeng}="";
13 if (grep { $_ eq 'afalgeng' } @{$target{enable}}) {
14- my $minver = 4*10000 + 1*100 + 0;
15- if ($config{CROSS_COMPILE} eq "") {
16- my $verstr = `uname -r`;
17- my ($ma, $mi1, $mi2) = split("\\.", $verstr);
18- ($mi2) = $mi2 =~ /(\d+)/;
19- my $ver = $ma*10000 + $mi1*100 + $mi2;
20- if ($ver < $minver) {
21- disable('too-old-kernel', 'afalgeng');
22- } else {
23- push @{$config{engdirs}}, "afalg";
24- }
25- } else {
26- disable('cross-compiling', 'afalgeng');
27- }
28+ push @{$config{engdirs}}, "afalg";
29 } else {
30 disable('not-linux', 'afalgeng');
31 }
diff --git a/recipes-connectivity/openssl/openssl-qoriq/openssl-c_rehash.sh b/recipes-connectivity/openssl/openssl-qoriq/openssl-c_rehash.sh
deleted file mode 100644
index 6620fdcb..00000000
--- a/recipes-connectivity/openssl/openssl-qoriq/openssl-c_rehash.sh
+++ /dev/null
@@ -1,222 +0,0 @@
1#!/bin/sh
2#
3# Ben Secrest <blsecres@gmail.com>
4#
5# sh c_rehash script, scan all files in a directory
6# and add symbolic links to their hash values.
7#
8# based on the c_rehash perl script distributed with openssl
9#
10# LICENSE: See OpenSSL license
11# ^^acceptable?^^
12#
13
14# default certificate location
15DIR=/etc/openssl
16
17# for filetype bitfield
18IS_CERT=$(( 1 << 0 ))
19IS_CRL=$(( 1 << 1 ))
20
21
22# check to see if a file is a certificate file or a CRL file
23# arguments:
24# 1. the filename to be scanned
25# returns:
26# bitfield of file type; uses ${IS_CERT} and ${IS_CRL}
27#
28check_file()
29{
30 local IS_TYPE=0
31
32 # make IFS a newline so we can process grep output line by line
33 local OLDIFS=${IFS}
34 IFS=$( printf "\n" )
35
36 # XXX: could be more efficient to have two 'grep -m' but is -m portable?
37 for LINE in $( grep '^-----BEGIN .*-----' ${1} )
38 do
39 if echo ${LINE} \
40 | grep -q -E '^-----BEGIN (X509 |TRUSTED )?CERTIFICATE-----'
41 then
42 IS_TYPE=$(( ${IS_TYPE} | ${IS_CERT} ))
43
44 if [ $(( ${IS_TYPE} & ${IS_CRL} )) -ne 0 ]
45 then
46 break
47 fi
48 elif echo ${LINE} | grep -q '^-----BEGIN X509 CRL-----'
49 then
50 IS_TYPE=$(( ${IS_TYPE} | ${IS_CRL} ))
51
52 if [ $(( ${IS_TYPE} & ${IS_CERT} )) -ne 0 ]
53 then
54 break
55 fi
56 fi
57 done
58
59 # restore IFS
60 IFS=${OLDIFS}
61
62 return ${IS_TYPE}
63}
64
65
66#
67# use openssl to fingerprint a file
68# arguments:
69# 1. the filename to fingerprint
70# 2. the method to use (x509, crl)
71# returns:
72# none
73# assumptions:
74# user will capture output from last stage of pipeline
75#
76fingerprint()
77{
78 ${SSL_CMD} ${2} -fingerprint -noout -in ${1} | sed 's/^.*=//' | tr -d ':'
79}
80
81
82#
83# link_hash - create links to certificate files
84# arguments:
85# 1. the filename to create a link for
86# 2. the type of certificate being linked (x509, crl)
87# returns:
88# 0 on success, 1 otherwise
89#
90link_hash()
91{
92 local FINGERPRINT=$( fingerprint ${1} ${2} )
93 local HASH=$( ${SSL_CMD} ${2} -hash -noout -in ${1} )
94 local SUFFIX=0
95 local LINKFILE=''
96 local TAG=''
97
98 if [ ${2} = "crl" ]
99 then
100 TAG='r'
101 fi
102
103 LINKFILE=${HASH}.${TAG}${SUFFIX}
104
105 while [ -f ${LINKFILE} ]
106 do
107 if [ ${FINGERPRINT} = $( fingerprint ${LINKFILE} ${2} ) ]
108 then
109 echo "NOTE: Skipping duplicate file ${1}" >&2
110 return 1
111 fi
112
113 SUFFIX=$(( ${SUFFIX} + 1 ))
114 LINKFILE=${HASH}.${TAG}${SUFFIX}
115 done
116
117 echo "${3} => ${LINKFILE}"
118
119 # assume any system with a POSIX shell will either support symlinks or
120 # do something to handle this gracefully
121 ln -s ${3} ${LINKFILE}
122
123 return 0
124}
125
126
127# hash_dir create hash links in a given directory
128hash_dir()
129{
130 echo "Doing ${1}"
131
132 cd ${1}
133
134 ls -1 * 2>/dev/null | while read FILE
135 do
136 if echo ${FILE} | grep -q -E '^[[:xdigit:]]{8}\.r?[[:digit:]]+$' \
137 && [ -h "${FILE}" ]
138 then
139 rm ${FILE}
140 fi
141 done
142
143 ls -1 *.pem *.cer *.crt *.crl 2>/dev/null | while read FILE
144 do
145 REAL_FILE=${FILE}
146 # if we run on build host then get to the real files in rootfs
147 if [ -n "${SYSROOT}" -a -h ${FILE} ]
148 then
149 FILE=$( readlink ${FILE} )
150 # check the symlink is absolute (or dangling in other word)
151 if [ "x/" = "x$( echo ${FILE} | cut -c1 -)" ]
152 then
153 REAL_FILE=${SYSROOT}/${FILE}
154 fi
155 fi
156
157 check_file ${REAL_FILE}
158 local FILE_TYPE=${?}
159 local TYPE_STR=''
160
161 if [ $(( ${FILE_TYPE} & ${IS_CERT} )) -ne 0 ]
162 then
163 TYPE_STR='x509'
164 elif [ $(( ${FILE_TYPE} & ${IS_CRL} )) -ne 0 ]
165 then
166 TYPE_STR='crl'
167 else
168 echo "NOTE: ${FILE} does not contain a certificate or CRL: skipping" >&2
169 continue
170 fi
171
172 link_hash ${REAL_FILE} ${TYPE_STR} ${FILE}
173 done
174}
175
176
177# choose the name of an ssl application
178if [ -n "${OPENSSL}" ]
179then
180 SSL_CMD=$(which ${OPENSSL} 2>/dev/null)
181else
182 SSL_CMD=/usr/bin/openssl
183 OPENSSL=${SSL_CMD}
184 export OPENSSL
185fi
186
187# fix paths
188PATH=${PATH}:${DIR}/bin
189export PATH
190
191# confirm existance/executability of ssl command
192if ! [ -x ${SSL_CMD} ]
193then
194 echo "${0}: rehashing skipped ('openssl' program not available)" >&2
195 exit 0
196fi
197
198# determine which directories to process
199old_IFS=$IFS
200if [ ${#} -gt 0 ]
201then
202 IFS=':'
203 DIRLIST=${*}
204elif [ -n "${SSL_CERT_DIR}" ]
205then
206 DIRLIST=$SSL_CERT_DIR
207else
208 DIRLIST=${DIR}/certs
209fi
210
211IFS=':'
212
213# process directories
214for CERT_DIR in ${DIRLIST}
215do
216 if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ]
217 then
218 IFS=$old_IFS
219 hash_dir ${CERT_DIR}
220 IFS=':'
221 fi
222done
diff --git a/recipes-connectivity/openssl/openssl-qoriq/run-ptest b/recipes-connectivity/openssl/openssl-qoriq/run-ptest
index 65c6cc7b..3fb22471 100644
--- a/recipes-connectivity/openssl/openssl-qoriq/run-ptest
+++ b/recipes-connectivity/openssl/openssl-qoriq/run-ptest
@@ -1,4 +1,12 @@
1#!/bin/sh 1#!/bin/sh
2cd test 2
3OPENSSL_ENGINES=../engines BLDTOP=.. SRCTOP=.. perl run_tests.pl 3set -e
4cd .. 4
5# Optional arguments are 'list' to lists all tests, or the test name (base name
6# ie test_evp, not 03_test_evp.t).
7
8export TOP=.
9# OPENSSL_ENGINES is relative from the test binaries
10export OPENSSL_ENGINES=../engines
11
12perl ./test/run_tests.pl $* | perl -0pe 's#(.*) \.*.ok#PASS: \1#g; s#(.*) \.*.skipped: (.*)#SKIP: \1 (\2)#g; s#(.*) \.*.\nDubious#FAIL: \1#;'
diff --git a/recipes-connectivity/openssl/openssl-qoriq_1.1.0g.bb b/recipes-connectivity/openssl/openssl-qoriq_1.1.0g.bb
deleted file mode 100644
index b0e188ae..00000000
--- a/recipes-connectivity/openssl/openssl-qoriq_1.1.0g.bb
+++ /dev/null
@@ -1,184 +0,0 @@
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
7DISABLE_STATIC = ""
8
9# "openssl | SSLeay" dual license
10LICENSE = "openssl"
11LIC_FILES_CHKSUM = "file://LICENSE;md5=cae6da10f4ffd9703214776d2aabce32"
12
13DEPENDS += "cryptodev-linux hostperl-runtime-native"
14DEPENDS_append_class-target = " openssl-native"
15
16SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/openssl;nobranch=1 \
17 file://run-ptest \
18 file://openssl-c_rehash.sh \
19 file://0001-Take-linking-flags-from-LDFLAGS-env-var.patch \
20 file://0001-Remove-test-that-requires-running-as-non-root.patch \
21 file://0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch \
22 "
23
24SRCREV = "472c9c380669eb7a26819a52598632f257b3e72b"
25
26PROVIDES = "openssl"
27
28python() {
29 pkgs = d.getVar('PACKAGES').split()
30 for p in pkgs:
31 if 'openssl-qoriq' in p:
32 d.appendVar("RPROVIDES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
33 d.appendVar("RCONFLICTS_%s" % p, p.replace('openssl-qoriq', 'openssl'))
34 d.appendVar("RREPLACES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
35}
36
37S = "${WORKDIR}/git"
38
39inherit lib_package multilib_header ptest
40
41do_configure () {
42 os=${HOST_OS}
43 case $os in
44 linux-uclibc |\
45 linux-uclibceabi |\
46 linux-gnueabi |\
47 linux-uclibcspe |\
48 linux-gnuspe |\
49 linux-musl*)
50 os=linux
51 ;;
52 *)
53 ;;
54 esac
55 target="$os-${HOST_ARCH}"
56 case $target in
57 linux-arm)
58 target=linux-armv4
59 ;;
60 linux-armeb)
61 target=linux-armv4
62 ;;
63 linux-aarch64*)
64 target=linux-aarch64
65 ;;
66 linux-sh3)
67 target=linux-generic32
68 ;;
69 linux-sh4)
70 target=linux-generic32
71 ;;
72 linux-i486)
73 target=linux-elf
74 ;;
75 linux-i586 | linux-viac3)
76 target=linux-elf
77 ;;
78 linux-i686)
79 target=linux-elf
80 ;;
81 linux-gnux32-x86_64)
82 target=linux-x32
83 ;;
84 linux-gnu64-x86_64)
85 target=linux-x86_64
86 ;;
87 linux-mips)
88 # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags
89 target="linux-mips32 ${TARGET_CC_ARCH}"
90 ;;
91 linux-mipsel)
92 target="linux-mips32 ${TARGET_CC_ARCH}"
93 ;;
94 linux-gnun32-mips*)
95 target=linux-mips64
96 ;;
97 linux-*-mips64 | linux-mips64)
98 target=linux64-mips64
99 ;;
100 linux-*-mips64el | linux-mips64el)
101 target=linux64-mips64
102 ;;
103 linux-microblaze*|linux-nios2*)
104 target=linux-generic32
105 ;;
106 linux-powerpc)
107 target=linux-ppc
108 ;;
109 linux-powerpc64)
110 target=linux-ppc64
111 ;;
112 linux-riscv64)
113 target=linux-generic64
114 ;;
115 linux-riscv32)
116 target=linux-generic32
117 ;;
118 linux-supersparc)
119 target=linux-sparcv9
120 ;;
121 linux-sparc)
122 target=linux-sparcv9
123 ;;
124 darwin-i386)
125 target=darwin-i386-cc
126 ;;
127 esac
128 useprefix=${prefix}
129 if [ "x$useprefix" = "x" ]; then
130 useprefix=/
131 fi
132 libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
133 perl ./Configure -DHAVE_CRYPTODEV ${EXTRA_OECONF} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdirleaf} $target
134}
135
136#| engines/afalg/e_afalg.c: In function 'eventfd':
137#| engines/afalg/e_afalg.c:110:20: error: '__NR_eventfd' undeclared (first use in this function)
138#| return syscall(__NR_eventfd, n);
139#| ^~~~~~~~~~~~
140EXTRA_OECONF_aarch64 += "no-afalgeng"
141
142#| ./libcrypto.so: undefined reference to `getcontext'
143#| ./libcrypto.so: undefined reference to `setcontext'
144#| ./libcrypto.so: undefined reference to `makecontext'
145EXTRA_OECONF_libc-musl += "-DOPENSSL_NO_ASYNC"
146
147do_install () {
148 oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
149 oe_multilib_header openssl/opensslconf.h
150}
151
152do_install_append_class-native () {
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
160do_install_ptest() {
161 cp -r * ${D}${PTEST_PATH}
162
163 # Putting .so files in ptest package will mess up the dependencies of the main openssl package
164 # so we rename them to .so.ptest and patch the test accordingly
165 mv ${D}${PTEST_PATH}/libcrypto.so ${D}${PTEST_PATH}/libcrypto.so.ptest
166 mv ${D}${PTEST_PATH}/libssl.so ${D}${PTEST_PATH}/libssl.so.ptest
167 sed -i 's/$target{shared_extension_simple}/".so.ptest"/' ${D}${PTEST_PATH}/test/recipes/90-test_shlibload.t
168}
169
170RDEPENDS_${PN}-ptest += "perl-module-file-spec-functions bash"
171RRECOMMENDS_libcrypto += "openssl-conf"
172
173FILES_${PN} =+ " ${libdir}/ssl-1.1/*"
174
175PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc"
176FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
177FILES_libssl = "${libdir}/libssl${SOLIBS}"
178FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
179FILES_${PN}-engines = "${libdir}/engines-1.1"
180FILES_${PN}-misc = "${libdir}/ssl-1.1/misc"
181
182RPROVIDES_openssl-conf = "openssl10-conf"
183RREPLACES_openssl-conf = "openssl10-conf"
184RCONFLICTS_openssl-conf = "openssl10-conf"
diff --git a/recipes-connectivity/openssl/openssl-qoriq_1.1.1d.bb b/recipes-connectivity/openssl/openssl-qoriq_1.1.1d.bb
new file mode 100644
index 00000000..13d9fe75
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq_1.1.1d.bb
@@ -0,0 +1,217 @@
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
7DISABLE_STATIC = ""
8
9# "openssl" here actually means both OpenSSL and SSLeay licenses apply
10# (see meta/files/common-licenses/OpenSSL to which "openssl" is SPDXLICENSEMAPped)
11LICENSE = "openssl"
12LIC_FILES_CHKSUM = "file://LICENSE;md5=d343e62fc9c833710bbbed25f27364c8"
13
14DEPENDS = "hostperl-runtime-native"
15
16SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/openssl;nobranch=1 \
17 file://run-ptest \
18 file://0001-skip-test_symbol_presence.patch \
19 file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
20 file://afalg.patch \
21 "
22
23SRCREV = "894da2fb7ed5d314ee5c2fc9fd2d9b8b74111596"
24
25SRC_URI_append_class-nativesdk = " \
26 file://environment.d-openssl.sh \
27 "
28inherit lib_package multilib_header multilib_script ptest
29MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
30
31PROVIDES = "openssl"
32
33python() {
34 pkgs = d.getVar('PACKAGES').split()
35 for p in pkgs:
36 if 'openssl-qoriq' in p:
37 d.appendVar("RPROVIDES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
38 d.appendVar("RCONFLICTS_%s" % p, p.replace('openssl-qoriq', 'openssl'))
39 d.appendVar("RREPLACES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
40}
41
42PACKAGECONFIG ?= ""
43PACKAGECONFIG_class-native = ""
44PACKAGECONFIG_class-nativesdk = ""
45
46PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux"
47
48B = "${WORKDIR}/build"
49do_configure[cleandirs] = "${B}"
50
51S = "${WORKDIR}/git"
52
53#| ./libcrypto.so: undefined reference to `getcontext'
54#| ./libcrypto.so: undefined reference to `setcontext'
55#| ./libcrypto.so: undefined reference to `makecontext'
56EXTRA_OECONF_append_libc-musl = " no-async"
57EXTRA_OECONF_append_libc-musl_powerpc64 = " no-asm"
58
59# adding devrandom prevents openssl from using getrandom() which is not available on older glibc versions
60# (native versions can be built with newer glibc, but then relocated onto a system with older glibc)
61EXTRA_OECONF_class-native = "--with-rand-seed=os,devrandom"
62EXTRA_OECONF_class-nativesdk = "--with-rand-seed=os,devrandom"
63
64# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate.
65CFLAGS_append_class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin"
66CFLAGS_append_class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin"
67
68do_configure () {
69 os=${HOST_OS}
70 case $os in
71 linux-gnueabi |\
72 linux-gnuspe |\
73 linux-musleabi |\
74 linux-muslspe |\
75 linux-musl )
76 os=linux
77 ;;
78 *)
79 ;;
80 esac
81 target="$os-${HOST_ARCH}"
82 case $target in
83 linux-arm*)
84 target=linux-armv4
85 ;;
86 linux-aarch64*)
87 target=linux-aarch64
88 ;;
89 linux-i?86 | linux-viac3)
90 target=linux-x86
91 ;;
92 linux-gnux32-x86_64 | linux-muslx32-x86_64 )
93 target=linux-x32
94 ;;
95 linux-gnu64-x86_64)
96 target=linux-x86_64
97 ;;
98 linux-mips | linux-mipsel)
99 # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags
100 target="linux-mips32 ${TARGET_CC_ARCH}"
101 ;;
102 linux-gnun32-mips*)
103 target=linux-mips64
104 ;;
105 linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el)
106 target=linux64-mips64
107 ;;
108 linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*)
109 target=linux-generic32
110 ;;
111 linux-powerpc)
112 target=linux-ppc
113 ;;
114 linux-powerpc64)
115 target=linux-ppc64
116 ;;
117 linux-riscv32)
118 target=linux-generic32
119 ;;
120 linux-riscv64)
121 target=linux-generic64
122 ;;
123 linux-sparc | linux-supersparc)
124 target=linux-sparcv9
125 ;;
126 esac
127
128 useprefix=${prefix}
129 if [ "x$useprefix" = "x" ]; then
130 useprefix=/
131 fi
132 # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the
133 # environment variables set by bitbake. Adjust the environment variables instead.
134 PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \
135 perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdir} $target
136 perl ${B}/configdata.pm --dump
137}
138
139do_install () {
140 oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
141
142 oe_multilib_header openssl/opensslconf.h
143
144 # Create SSL structure for packages such as ca-certificates which
145 # contain hard-coded paths to /etc/ssl. Debian does the same.
146 install -d ${D}${sysconfdir}/ssl
147 mv ${D}${libdir}/ssl-1.1/certs \
148 ${D}${libdir}/ssl-1.1/private \
149 ${D}${libdir}/ssl-1.1/openssl.cnf \
150 ${D}${sysconfdir}/ssl/
151
152 # Although absolute symlinks would be OK for the target, they become
153 # invalid if native or nativesdk are relocated from sstate.
154 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs
155 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private
156 ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf
157}
158
159do_install_append_class-native () {
160 create_wrapper ${D}${bindir}/openssl \
161 OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \
162 SSL_CERT_DIR=${libdir}/ssl-1.1/certs \
163 SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \
164 OPENSSL_ENGINES=${libdir}/ssl-1.1/engines
165}
166
167do_install_append_class-nativesdk () {
168 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
169 install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
170 sed 's|/usr/lib/ssl/|/usr/lib/ssl-1.1/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
171}
172
173PTEST_BUILD_HOST_FILES += "configdata.pm"
174PTEST_BUILD_HOST_PATTERN = "perl_version ="
175do_install_ptest () {
176 # Prune the build tree
177 rm -f ${B}/fuzz/*.* ${B}/test/*.*
178
179 cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH}
180 cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util ${D}${PTEST_PATH}
181
182 # For test_shlibload
183 ln -s ${libdir}/libcrypto.so.1.1 ${D}${PTEST_PATH}/
184 ln -s ${libdir}/libssl.so.1.1 ${D}${PTEST_PATH}/
185
186 install -d ${D}${PTEST_PATH}/apps
187 ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps
188 install -m644 ${S}/apps/*.pem ${S}/apps/*.srl ${S}/apps/openssl.cnf ${D}${PTEST_PATH}/apps
189 install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps
190
191 install -d ${D}${PTEST_PATH}/engines
192 install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines
193}
194
195# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
196# package RRECOMMENDS on this package. This will enable the configuration
197# file to be installed for both the openssl-bin package and the libcrypto
198# package since the openssl-bin package depends on the libcrypto package.
199
200PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc"
201
202FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
203FILES_libssl = "${libdir}/libssl${SOLIBS}"
204FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
205FILES_${PN}-engines = "${libdir}/engines-1.1"
206FILES_${PN}-misc = "${libdir}/ssl-1.1/misc"
207FILES_${PN} =+ "${libdir}/ssl-1.1/*"
208FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
209
210CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
211
212RRECOMMENDS_libcrypto += "openssl-conf"
213RDEPENDS_${PN}-ptest += "openssl-bin perl perl-modules bash"
214
215BBCLASSEXTEND = "native nativesdk"
216
217CVE_PRODUCT = "openssl:openssl"