summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/gnutls/gnutls
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/gnutls/gnutls')
-rw-r--r--meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch26
-rw-r--r--meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch57
-rw-r--r--meta/recipes-support/gnutls/gnutls/arm_eabi.patch7
-rw-r--r--meta/recipes-support/gnutls/gnutls/run-ptest100
4 files changed, 186 insertions, 4 deletions
diff --git a/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch b/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch
new file mode 100644
index 0000000000..2dccea7859
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch
@@ -0,0 +1,26 @@
1From c4f6cb380471b5e5478ae6f7f8c5604a6a64ec1c Mon Sep 17 00:00:00 2001
2From: Lei Maohui <leimaohui@fujitsu.com>
3Date: Mon, 23 May 2022 10:44:43 +0900
4Subject: [PATCH] Creating .hmac file should be excuted in target environment,
5 so deleted it from build process.
6
7Upstream-Status: Inappropriate [https://gitlab.com/gnutls/gnutls/-/issues/1373]
8Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
9---
10 lib/Makefile.am | 3 +--
11 1 file changed, 1 insertion(+), 2 deletions(-)
12
13diff --git a/lib/Makefile.am b/lib/Makefile.am
14index a50d311..193ea19 100644
15--- a/lib/Makefile.am
16+++ b/lib/Makefile.am
17@@ -272,8 +272,7 @@ hmac_file = .libs/.$(gnutls_so).hmac
18
19 all-local: $(hmac_file)
20
21-$(hmac_file): libgnutls.la fipshmac
22- $(AM_V_GEN) $(builddir)/fipshmac > $@-t && mv $@-t $@
23+.libs/.$(gnutls_so).hmac:
24
25 CLEANFILES = $(hmac_file)
26 endif
diff --git a/meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch b/meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch
new file mode 100644
index 0000000000..339d3d2f9e
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch
@@ -0,0 +1,57 @@
1From 6abc86acecff5a30173eb78a971ec5b65f77e1de Mon Sep 17 00:00:00 2001
2From: Ravineet Singh <ravineet.a.singh@est.tech>
3Date: Tue, 10 Jan 2023 16:11:10 +0100
4Subject: [PATCH] gnutls: add ptest support
5
6Upstream-Status: Inappropriate [embedded specific]
7Signed-off-by: Ravineet Singh <ravineet.a.singh@est.tech>
8---
9 Makefile.am | 3 +++
10 configure.ac | 2 ++
11 tests/Makefile.am | 6 ++++++
12 3 files changed, 11 insertions(+)
13
14diff --git a/Makefile.am b/Makefile.am
15index 843193f..816b09f 100644
16--- a/Makefile.am
17+++ b/Makefile.am
18@@ -194,6 +194,9 @@ dist-hook:
19 distcheck-hook:
20 @test -d "$(top_srcdir)/po/.reference" || { echo "PO files are not downloaded; run ./bootstrap without --skip-po"; exit 1; }
21
22+install-ptest:
23+ $(MAKE) -C tests DESTDIR=$(DESTDIR)/tests $@
24+
25 .PHONY: abi-check abi-dump-versioned abi-dump-latest pic-check symbol-check local-code-coverage-output files-update AUTHORS
26
27 include $(top_srcdir)/cligen/cligen.mk
28diff --git a/configure.ac b/configure.ac
29index 1744813..efb9e34 100644
30--- a/configure.ac
31+++ b/configure.ac
32@@ -1491,6 +1491,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS)
33
34 AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
35
36+AM_EXTRA_RECURSIVE_TARGETS([buildtest-TESTS])
37+
38 AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
39
40 hw_features=
41diff --git a/tests/Makefile.am b/tests/Makefile.am
42index 189d068..8430b05 100644
43--- a/tests/Makefile.am
44+++ b/tests/Makefile.am
45@@ -678,6 +678,12 @@ SH_LOG_COMPILER = $(SHELL)
46 AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind
47 LOG_COMPILER = $(LOG_VALGRIND)
48
49+install-ptest: $(check_PROGRAMS)
50+ @$(INSTALL) -d $(DESTDIR)
51+ @for file in $^; do \
52+ $(INSTALL_PROGRAM) $$file $(DESTDIR) ; \
53+ done
54+
55 distclean-local:
56 rm -rf softhsm-*.db softhsm-*.config *.tmp tmp-* x509-crt-list-import-url.config.db port.lock.d
57
diff --git a/meta/recipes-support/gnutls/gnutls/arm_eabi.patch b/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
index 6eb1edbdb1..d493448aab 100644
--- a/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
+++ b/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
@@ -1,4 +1,4 @@
1From 8a5c96057cf305bbeac0d6e0e59ee24fbb9497fe Mon Sep 17 00:00:00 2001 1From 46b3079095c5ceb0dc742785853bbaf288f325c6 Mon Sep 17 00:00:00 2001
2From: Joe Slater <jslater@windriver.com> 2From: Joe Slater <jslater@windriver.com>
3Date: Wed, 25 Jan 2017 13:52:59 -0800 3Date: Wed, 25 Jan 2017 13:52:59 -0800
4Subject: [PATCH] gnutls: account for ARM_EABI 4Subject: [PATCH] gnutls: account for ARM_EABI
@@ -9,16 +9,15 @@ reference to them.
9Upstream-Status: Pending 9Upstream-Status: Pending
10 10
11Signed-off-by: Joe Slater <jslater@windriver.com> 11Signed-off-by: Joe Slater <jslater@windriver.com>
12
13--- 12---
14 tests/seccomp.c | 2 ++ 13 tests/seccomp.c | 2 ++
15 1 file changed, 2 insertions(+) 14 1 file changed, 2 insertions(+)
16 15
17diff --git a/tests/seccomp.c b/tests/seccomp.c 16diff --git a/tests/seccomp.c b/tests/seccomp.c
18index ed14d00..3c5b726 100644 17index 881f0bb..5f9204a 100644
19--- a/tests/seccomp.c 18--- a/tests/seccomp.c
20+++ b/tests/seccomp.c 19+++ b/tests/seccomp.c
21@@ -53,7 +53,9 @@ int disable_system_calls(void) 20@@ -55,7 +55,9 @@ int disable_system_calls(void)
22 21
23 ADD_SYSCALL(nanosleep, 0); 22 ADD_SYSCALL(nanosleep, 0);
24 ADD_SYSCALL(clock_nanosleep, 0); 23 ADD_SYSCALL(clock_nanosleep, 0);
diff --git a/meta/recipes-support/gnutls/gnutls/run-ptest b/meta/recipes-support/gnutls/gnutls/run-ptest
new file mode 100644
index 0000000000..17e26eae70
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/run-ptest
@@ -0,0 +1,100 @@
1#!/bin/sh
2
3rjob() {
4 local job=$1
5 local log=$2
6
7 # TODO: Output will be garbled
8 ./${job} >> ${log} 2>&1
9
10 ret=$?
11 case $ret in
12 0)
13 echo "PASS: $t" >> ${log}
14 echo "PASS: $t"
15 ;;
16 77)
17 echo "SKIP: $t" >> ${log}
18 echo "SKIP: $t"
19 ;;
20 *)
21 echo "FAIL: $t" >> ${log}
22 echo "FAIL: $t"
23 ;;
24 esac
25}
26
27is_disallowed() {
28 local key=$1
29 $(echo ${test_disallowlist} | grep -w -q ${key})
30 return $?
31}
32
33# TODO
34# This list should probably be in a external file
35# Testcases defined here either take very long time (dtls-stress)
36# or are dependent on local files (certs, etc) in local file system
37# currently not exported to target.
38
39test_disallowlist=""
40test_disallowlist="${test_disallowlist} dtls-stress"
41test_disallowlist="${test_disallowlist} handshake-large-cert"
42test_disallowlist="${test_disallowlist} id-on-xmppAddr"
43test_disallowlist="${test_disallowlist} mini-x509-cas"
44test_disallowlist="${test_disallowlist} pkcs12_simple"
45test_disallowlist="${test_disallowlist} protocol-set-allowlist"
46test_disallowlist="${test_disallowlist} psk-file"
47test_disallowlist="${test_disallowlist} rawpk-api"
48test_disallowlist="${test_disallowlist} set_pkcs12_cred"
49test_disallowlist="${test_disallowlist} system-override-curves-allowlist"
50test_disallowlist="${test_disallowlist} system-override-hash"
51test_disallowlist="${test_disallowlist} system-override-sig"
52test_disallowlist="${test_disallowlist} system-override-sig-tls"
53test_disallowlist="${test_disallowlist} system-prio-file"
54test_disallowlist="${test_disallowlist} x509cert-tl"
55
56LOG=${PWD}/tests.log
57cd tests
58max_njobs=$(grep -c ^processor /proc/cpuinfo)
59njobs=0
60
61set +e
62
63for t in *; do
64 [ -x $t ] || continue
65 [ -f $t ] || continue
66
67 is_disallowed ${t}
68 [ $? -eq 0 ] && continue
69
70 rjob ${t} ${LOG} &
71 one=1
72 njobs=$(expr ${njobs} + ${one})
73 if [ ${njobs} -eq ${max_njobs} ]; then
74 wait
75 njobs=0
76 fi
77done
78wait
79
80skipped=$(grep -c SKIP ${LOG})
81passed=$(grep -c PASS ${LOG})
82failed=$(grep -c FAIL ${LOG})
83total=$(expr ${passed} + ${failed} + ${skipped})
84
85if [ ${failed} -ne 0 ]; then
86 echo
87 echo "Tests failed for gnutls, log is:"
88 echo "--------------------"
89 cat ${LOG}
90 echo
91fi
92
93echo
94echo "gnutls test summary:"
95echo "--------------------"
96echo "total: ${total}"
97echo "pass : ${passed}"
98echo "fail : ${failed}"
99echo "skip : ${skipped}"
100echo