diff options
Diffstat (limited to 'recipes-connectivity/openssl/openssl-qoriq')
8 files changed, 147 insertions, 405 deletions
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 @@ | |||
1 | From 3fdb1e2a16ea405c6731447a8994f222808ef7e6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Fri, 7 Apr 2017 18:01:52 +0300 | ||
4 | Subject: [PATCH] Remove test that requires running as non-root | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe-core specific] | ||
7 | Signed-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 | |||
12 | diff --git a/test/recipes/40-test_rehash.t b/test/recipes/40-test_rehash.t | ||
13 | index 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 | -- | ||
48 | 2.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 @@ | |||
1 | From 08face4353d80111973aba9c1304c92158cfad0e Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Tue, 28 Mar 2017 16:40:12 +0300 | ||
4 | Subject: [PATCH] Take linking flags from LDFLAGS env var | ||
5 | |||
6 | This fixes "No GNU_HASH in the elf binary" issues. | ||
7 | |||
8 | Upstream-Status: Inappropriate [oe-core specific] | ||
9 | Signed-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 | |||
15 | diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl | ||
16 | index 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} || "" -} | ||
28 | diff --git a/Configure b/Configure | ||
29 | index 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 | -- | ||
42 | 2.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 @@ | |||
1 | From bcc096a50811bf0f0c4fd34b2993fed7a7015972 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andy Polyakov <appro@openssl.org> | ||
3 | Date: Fri, 3 Nov 2017 23:30:01 +0100 | ||
4 | Subject: [PATCH] aes/asm/{aes-armv4|bsaes-armv7}.pl: make it work with | ||
5 | binutils-2.29. | ||
6 | |||
7 | It's not clear if it's a feature or bug, but binutils-2.29[.1] | ||
8 | interprets 'adr' instruction with Thumb2 code reference differently, | ||
9 | in a way that affects calculation of addresses of constants' tables. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | |||
13 | Reviewed-by: Tim Hudson <tjh@openssl.org> | ||
14 | Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> | ||
15 | Signed-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 | |||
24 | diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl | ||
25 | index 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__ | ||
55 | diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl | ||
56 | index 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 | -- | ||
87 | 2.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 @@ | |||
1 | From 3e1d00481093e10775eaf69d619c45b32a4aa7dc Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <martin@geanix.com> | ||
3 | Date: Tue, 6 Nov 2018 14:50:47 +0100 | ||
4 | Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler | ||
5 | info | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | The openssl build system generates buildinf.h containing the full | ||
11 | compiler command line used to compile objects. This breaks | ||
12 | reproducibility, as the compile command is baked into libcrypto, where | ||
13 | it is used when running `openssl version -f`. | ||
14 | |||
15 | Add stripped build variables for the compiler and cflags lines, and use | ||
16 | those when generating buildinfo.h. | ||
17 | |||
18 | This is based on a similar patch for older openssl versions: | ||
19 | https://patchwork.openembedded.org/patch/147229/ | ||
20 | |||
21 | Upstream-Status: Inappropriate [OE specific] | ||
22 | Signed-off-by: Martin Hundebøll <martin@geanix.com> | ||
23 | |||
24 | |||
25 | Update to fix buildpaths qa issue for '-fmacro-prefix-map'. | ||
26 | |||
27 | Signed-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 | |||
33 | diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl | ||
34 | index 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 | ||
61 | diff --git a/crypto/build.info b/crypto/build.info | ||
62 | index 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 | -- | ||
75 | 2.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 @@ | |||
1 | From 097b9081eced6ffc13c6cbb83abf7110baeca902 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chunrong Guo <chunrong.guo@nxp.com> | ||
3 | Date: Mon, 14 Oct 2019 14:59:11 +0800 | ||
4 | Subject: [PATCH] skip test_symbol_presence | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE Specific] | ||
7 | |||
8 | Signed-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 | |||
13 | diff --git a/test/recipes/01-test_symbol_presence.t b/test/recipes/01-test_symbol_presence.t | ||
14 | index 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 | -- | ||
28 | 2.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 @@ | |||
1 | Don't refuse to build afalgeng if cross-compiling or the host kernel is too old. | ||
2 | |||
3 | Upstream-Status: Submitted [hhttps://github.com/openssl/openssl/pull/7688] | ||
4 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
5 | |||
6 | diff --git a/Configure b/Configure | ||
7 | index 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 | ||
15 | DIR=/etc/openssl | ||
16 | |||
17 | # for filetype bitfield | ||
18 | IS_CERT=$(( 1 << 0 )) | ||
19 | IS_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 | # | ||
28 | check_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 | # | ||
76 | fingerprint() | ||
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 | # | ||
90 | link_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 | ||
128 | hash_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 | ||
178 | if [ -n "${OPENSSL}" ] | ||
179 | then | ||
180 | SSL_CMD=$(which ${OPENSSL} 2>/dev/null) | ||
181 | else | ||
182 | SSL_CMD=/usr/bin/openssl | ||
183 | OPENSSL=${SSL_CMD} | ||
184 | export OPENSSL | ||
185 | fi | ||
186 | |||
187 | # fix paths | ||
188 | PATH=${PATH}:${DIR}/bin | ||
189 | export PATH | ||
190 | |||
191 | # confirm existance/executability of ssl command | ||
192 | if ! [ -x ${SSL_CMD} ] | ||
193 | then | ||
194 | echo "${0}: rehashing skipped ('openssl' program not available)" >&2 | ||
195 | exit 0 | ||
196 | fi | ||
197 | |||
198 | # determine which directories to process | ||
199 | old_IFS=$IFS | ||
200 | if [ ${#} -gt 0 ] | ||
201 | then | ||
202 | IFS=':' | ||
203 | DIRLIST=${*} | ||
204 | elif [ -n "${SSL_CERT_DIR}" ] | ||
205 | then | ||
206 | DIRLIST=$SSL_CERT_DIR | ||
207 | else | ||
208 | DIRLIST=${DIR}/certs | ||
209 | fi | ||
210 | |||
211 | IFS=':' | ||
212 | |||
213 | # process directories | ||
214 | for CERT_DIR in ${DIRLIST} | ||
215 | do | ||
216 | if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ] | ||
217 | then | ||
218 | IFS=$old_IFS | ||
219 | hash_dir ${CERT_DIR} | ||
220 | IFS=':' | ||
221 | fi | ||
222 | done | ||
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 |
2 | cd test | 2 | |
3 | OPENSSL_ENGINES=../engines BLDTOP=.. SRCTOP=.. perl run_tests.pl | 3 | set -e |
4 | cd .. | 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 | |||
8 | export TOP=. | ||
9 | # OPENSSL_ENGINES is relative from the test binaries | ||
10 | export OPENSSL_ENGINES=../engines | ||
11 | |||
12 | perl ./test/run_tests.pl $* | perl -0pe 's#(.*) \.*.ok#PASS: \1#g; s#(.*) \.*.skipped: (.*)#SKIP: \1 (\2)#g; s#(.*) \.*.\nDubious#FAIL: \1#;' | ||