Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,27 @@
From 21a8295bac3805e4490ba2b5f136e7f4c121061b Mon Sep 17 00:00:00 2001
From: Lei Maohui <leimaohui@fujitsu.com>
Date: Mon, 23 May 2022 10:44:43 +0900
Subject: [PATCH] Creating .hmac file should be excuted in target environment,
so deleted it from build process.
Upstream-Status: Inappropriate [https://gitlab.com/gnutls/gnutls/-/issues/1373]
Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
---
lib/Makefile.am | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6d4e8d2..24ef108 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -206,8 +206,7 @@ hmac_file = .libs/.$(gnutls_so).hmac
all-local: $(hmac_file)
-$(hmac_file): libgnutls.la fipshmac
- $(AM_V_GEN) $(builddir)/fipshmac > $@-t && mv $@-t $@
+.libs/.$(gnutls_so).hmac:
CLEANFILES = $(hmac_file)
endif
@@ -0,0 +1,58 @@
From 81861f7ba690956c064ebe8dce6c313951fa2a9f Mon Sep 17 00:00:00 2001
From: Ravineet Singh <ravineet.a.singh@est.tech>
Date: Tue, 10 Jan 2023 16:11:10 +0100
Subject: [PATCH] gnutls: add ptest support
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Ravineet Singh <ravineet.a.singh@est.tech>
---
Makefile.am | 3 +++
configure.ac | 2 ++
tests/Makefile.am | 6 ++++++
3 files changed, 11 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 843193f..816b09f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -191,6 +191,9 @@ dist-hook:
mv ChangeLog $(distdir)
touch -c $(distdir)/doc/*.html $(distdir)/doc/*.pdf $(distdir)/doc/*.info
+install-ptest:
+ $(MAKE) -C tests DESTDIR=$(DESTDIR)/tests $@
+
.PHONY: abi-check abi-dump-versioned abi-dump-latest pic-check symbol-check local-code-coverage-output files-update AUTHORS
include $(top_srcdir)/cligen/cligen.mk
diff --git a/configure.ac b/configure.ac
index b25ba14..860ddef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1150,6 +1150,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS)
AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
+AM_EXTRA_RECURSIVE_TARGETS([buildtest-TESTS])
+
AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
hw_features=
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d530ad0..71c592f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -648,6 +648,12 @@ SH_LOG_COMPILER = $(SHELL)
AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind
LOG_COMPILER = $(LOG_VALGRIND)
+install-ptest: $(check_PROGRAMS)
+ @$(INSTALL) -d $(DESTDIR)
+ @for file in $^; do \
+ $(INSTALL_PROGRAM) $$file $(DESTDIR) ; \
+ done
+
distclean-local:
rm -rf softhsm-*.db softhsm-*.config *.tmp tmp-* x509-crt-list-import-url.config.db port.lock.d
@@ -0,0 +1,30 @@
From 911213d9f72ddce468322d22d223127b93964409 Mon Sep 17 00:00:00 2001
From: Joe Slater <jslater@windriver.com>
Date: Wed, 25 Jan 2017 13:52:59 -0800
Subject: [PATCH] gnutls: account for ARM_EABI
Certain syscall's are not availabe for arm-eabi, so we eliminate
reference to them.
Upstream-Status: Pending
Signed-off-by: Joe Slater <jslater@windriver.com>
---
tests/seccomp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/seccomp.c b/tests/seccomp.c
index a3148fe..443bc5f 100644
--- a/tests/seccomp.c
+++ b/tests/seccomp.c
@@ -52,7 +52,9 @@ int disable_system_calls(void)
ADD_SYSCALL(nanosleep, 0);
ADD_SYSCALL(clock_nanosleep, 0);
+#if ! defined(__ARM_EABI__)
ADD_SYSCALL(time, 0);
+#endif
ADD_SYSCALL(getpid, 0);
ADD_SYSCALL(gettimeofday, 0);
# if defined(HAVE_CLOCK_GETTIME)
@@ -0,0 +1,90 @@
#!/bin/sh
rjob() {
local job=$1
local log=$2
# TODO: Output will be garbled
./${job} >> ${log} 2>&1
ret=$?
case $ret in
0)
echo "PASS: $t" >> ${log}
echo "PASS: $t"
;;
77)
echo "SKIP: $t" >> ${log}
echo "SKIP: $t"
;;
*)
echo "FAIL: $t" >> ${log}
echo "FAIL: $t"
;;
esac
}
is_disallowed() {
local key=$1
$(echo ${test_disallowlist} | grep -w -q ${key})
return $?
}
# TODO
# This list should probably be in a external file
# Testcases defined here either take very long time (dtls-stress)
# or are dependent on local files (certs, etc) in local file system
# currently not exported to target.
test_disallowlist=""
test_disallowlist="${test_disallowlist} dtls-stress"
test_disallowlist="${test_disallowlist} handshake-large-cert"
test_disallowlist="${test_disallowlist} id-on-xmppAddr"
test_disallowlist="${test_disallowlist} mini-x509-cas"
test_disallowlist="${test_disallowlist} pkcs12_simple"
test_disallowlist="${test_disallowlist} protocol-set-allowlist"
test_disallowlist="${test_disallowlist} psk-file"
test_disallowlist="${test_disallowlist} rawpk-api"
test_disallowlist="${test_disallowlist} set_pkcs12_cred"
test_disallowlist="${test_disallowlist} system-override-curves-allowlist"
test_disallowlist="${test_disallowlist} system-override-hash"
test_disallowlist="${test_disallowlist} system-override-sig"
test_disallowlist="${test_disallowlist} system-override-sig-tls"
test_disallowlist="${test_disallowlist} system-prio-file"
test_disallowlist="${test_disallowlist} x509cert-tl"
LOG=${PWD}/tests.log
cd tests
max_njobs=$(grep -c ^processor /proc/cpuinfo)
njobs=0
for t in *; do
[ -x $t ] || continue
[ -f $t ] || continue
is_disallowed ${t}
[ $? -eq 0 ] && continue
rjob ${t} ${LOG} &
one=1
njobs=$(expr ${njobs} + ${one})
if [ ${njobs} -eq ${max_njobs} ]; then
wait
njobs=0
fi
done
wait
skipped=$(grep -c SKIP ${LOG})
passed=$(grep -c PASS ${LOG})
failed=$(grep -c FAIL ${LOG})
total=$(expr ${passed} + ${failed} + ${skipped})
echo
echo "gnutls test summary:"
echo "--------------------"
echo "total: ${total}"
echo "pass : ${passed}"
echo "fail : ${failed}"
echo "skip : ${skipped}"
echo
@@ -0,0 +1,100 @@
SUMMARY = "GNU Transport Layer Security Library"
DESCRIPTION = "a secure communications library implementing the SSL, \
TLS and DTLS protocols and technologies around them."
HOMEPAGE = "https://gnutls.org/"
BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
LICENSE = "GPL-3.0-or-later & LGPL-2.1-or-later"
LICENSE:${PN} = "LGPL-2.1-or-later"
LICENSE:${PN}-xx = "LGPL-2.1-or-later"
LICENSE:${PN}-bin = "GPL-3.0-or-later"
LICENSE:${PN}-openssl = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://LICENSE;md5=71391c8e0c1cfe68077e7fce3b586283 \
file://doc/COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \
file://doc/COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c"
DEPENDS = "nettle gmp virtual/libiconv libunistring"
SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \
file://arm_eabi.patch \
file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \
file://run-ptest \
file://Add-ptest-support.patch \
"
SRC_URI[sha256sum] = "0ea0d11a1660a1e63f960f157b197abe6d0c8cb3255be24e1fb3815930b9bdc5"
inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest
PACKAGECONFIG ??= "libidn libtasn1 ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)}"
# You must also have CONFIG_SECCOMP enabled in the kernel for
# seccomp to work.
PACKAGECONFIG[seccomp] = "--with-libseccomp-prefix=${STAGING_EXECPREFIXDIR},ac_cv_libseccomp=no,libseccomp"
PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn2"
PACKAGECONFIG[libtasn1] = "--without-included-libtasn1,--with-included-libtasn1,libtasn1"
PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit"
PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers"
PACKAGECONFIG[fips] = "--enable-fips140-mode --with-libdl-prefix=${STAGING_BASELIBDIR}"
PACKAGECONFIG[dane] = "--enable-libdane,--disable-libdane,unbound"
# Certificate compression
PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli"
PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
EXTRA_OECONF = " \
--enable-doc \
--disable-rpath \
--enable-openssl-compatibility \
--with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \
--with-librt-prefix=${STAGING_DIR_HOST}${prefix} \
--with-default-trust-store-file=${sysconfdir}/ssl/certs/ca-certificates.crt \
"
# Otherwise the tools try and use HOSTTOOLS_DIR/bash as a shell.
export POSIX_SHELL="${base_bindir}/sh"
do_configure:prepend() {
for dir in . lib; do
rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4
done
}
do_compile_ptest() {
oe_runmake -C tests buildtest-TESTS
}
do_install:append:class-target() {
if ${@bb.utils.contains('PACKAGECONFIG', 'fips', 'true', 'false', d)}; then
install -d ${D}${bindir}/bin
install -m 0755 ${B}/lib/.libs/fipshmac ${D}/${bindir}/
fi
}
PACKAGES =+ "${PN}-dane ${PN}-openssl ${PN}-xx ${PN}-fips"
FILES:${PN}-dev += "${bindir}/gnutls-cli-debug"
FILES:${PN}-dane = "${libdir}/libgnutls-dane.so.*"
FILES:${PN}-openssl = "${libdir}/libgnutls-openssl.so.*"
FILES:${PN}-xx = "${libdir}/libgnutlsxx.so.*"
FILES:${PN}-fips = "${bindir}/fipshmac"
RDEPENDS:${PN}-ptest += "python3"
BBCLASSEXTEND = "native nativesdk"
pkg_postinst_ontarget:${PN}-fips () {
if test -x ${bindir}/fipshmac
then
mkdir ${sysconfdir}/gnutls
touch ${sysconfdir}/gnutls/config
${bindir}/fipshmac ${libdir}/libgnutls.so.30.*.* > ${libdir}/.libgnutls.so.30.hmac
${bindir}/fipshmac ${libdir}/libnettle.so.8.* > ${libdir}/.libnettle.so.8.hmac
${bindir}/fipshmac ${libdir}/libgmp.so.10.*.* > ${libdir}/.libgmp.so.10.hmac
${bindir}/fipshmac ${libdir}/libhogweed.so.6.* > ${libdir}/.libhogweed.so.6.hmac
fi
}
@@ -0,0 +1,26 @@
From 629fc6427710e48b78f8b1f300dd698fe898cfd4 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Mon, 7 Jan 2013 01:49:40 +0200
Subject: [PATCH] libtasn1: remove help2man dependency
Upstream-Status: Inappropriate
Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
doc/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index a0171a5..8aa4d3d 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -28,7 +28,7 @@ libtasn1_TEXINFOS += asn1Coding-help.texi asn1Decoding-help.texi asn1Parser-help
AM_MAKEINFOHTMLFLAGS = --no-split $(AM_MAKEINFOFLAGS)
-dist_man_MANS = $(gdoc_MANS) asn1Parser.1 asn1Coding.1 asn1Decoding.1
+dist_man_MANS = $(gdoc_MANS)
HELP2MAN_OPTS = --info-page libtasn1
@@ -0,0 +1,23 @@
SUMMARY = "Library for ASN.1 and DER manipulation"
DESCRIPTION = "A highly portable C library that encodes and decodes \
DER/BER data following an ASN.1 schema. "
HOMEPAGE = "http://www.gnu.org/software/libtasn1/"
LICENSE = "GPL-3.0-or-later & LGPL-2.1-or-later"
LICENSE:${PN}-bin = "GPL-3.0-or-later"
LICENSE:${PN} = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://doc/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://doc/COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c \
file://COPYING;md5=75ac100ec923f959898182307970c360"
SRC_URI = "${GNU_MIRROR}/libtasn1/libtasn1-${PV}.tar.gz \
file://dont-depend-on-help2man.patch \
"
DEPENDS = "bison-native"
SRC_URI[sha256sum] = "1613f0ac1cf484d6ec0ce3b8c06d56263cc7242f1c23b30d82d23de345a63f7a"
inherit autotools texinfo lib_package gtk-doc
BBCLASSEXTEND = "native nativesdk"