Compare commits

...
Sign in to create a new pull request.

71 commits

Author SHA1 Message Date
Yaakov Selkowitz
cbe66ee3a7 Restore gmp tarball to sources 2025-11-25 09:54:16 -05:00
Yaakov Selkowitz
33160d08cb Drop RHEL10-specific patch
The test was fixed to be FIPS-compliant:

https://gitlab.com/gnutls/gnutls/-/merge_requests/1932
2025-11-25 14:42:39 +00:00
Alexander Sosedkin
98206a06fe Disable native assembly to work around bz2416812 2025-11-25 10:30:27 +01:00
Daniel P. Berrangé
c5fcada2f3 Add missing Provides: bundled(..) for gmp & leancrypto
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-21 16:14:40 +09:00
Daiki Ueno
9f95ff6e69 Remove unnecessary PKG_CONFIG_PATH setting
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-11-21 16:12:20 +09:00
Daiki Ueno
3078b09e41 Enable crypto-auditing probes
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-11-21 11:48:31 +09:00
Daiki Ueno
7441432f8c Minor fixes to spec file and packit configuration
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-11-21 11:48:21 +09:00
Daiki Ueno
000d285047 Update to 3.8.11 upstream release
- Resolves: rhbz#2416041

Upstream tag: 3.8.11
Upstream commit: b841c70e

Commit authored by Packit automation (https://packit.dev/)
2025-11-20 19:40:16 +09:00
Krenzelok Frantisek
92cc61b531 Revert "Enable kTLS by default"
This reverts commit 330d52f8da.
2025-08-26 17:33:12 +02:00
Krenzelok Frantisek
330d52f8da Enable kTLS by default
Resolves: rhbz#2130000

- https://fedoraproject.org/wiki/Changes/KTLSSupportForGnuTLS.
- kTLS is now enabled by default if all requirements are met.
- Modify the docs to reflect the change of defaults.
- Picked-up a patch that fixes state transition in the KTLS code path.
2025-08-25 17:39:12 +02:00
Zoltan Fridrich
7be798d940 Rebuild
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2025-07-29 15:04:46 +02:00
Fedora Release Engineering
b690a96329 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 22:53:49 +00:00
Daiki Ueno
e45aaed8ab Update to 3.8.10 upstream release
Also update the bundled leancrypto to 1.5.0.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-07-10 05:48:08 +09:00
Yaakov Selkowitz
25f7cc5fad Fix build on kernel 6.14+
kTLS KeyUpdate is supported as of this version, leading to the
ktls_keyupdate.sh being able to pass thereon, and therefore
the builder's kernel must now be checked here too.

https://gitlab.com/gnutls/gnutls/-/merge_requests/1934
2025-07-06 18:20:47 -04:00
Daiki Ueno
5bef1c86aa Update leancrypto to 1.3.0
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-04-02 17:34:52 +09:00
Peter Robinson
c3aaff5c62 Bump for gmp build 2025-03-30 11:46:20 +01:00
Zoltan Fridrich
63494651c6 Rebuild GnuTLS
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2025-03-03 11:17:54 +01:00
Daiki Ueno
6ea0d5328d Bump nettle dependency to 3.10.1
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-02-17 10:32:20 +09:00
Daiki Ueno
b5e51ef2d2 Rebuild against nettle 3.10.1
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-02-14 14:58:10 +09:00
Daiki Ueno
9c5597be5c Switch from liboqs to leancrypto
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-02-10 18:17:05 +09:00
Daiki Ueno
6c3a0c118e Update to gnutls 3.8.9 release
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-02-10 11:04:35 +09:00
Yaakov Selkowitz
e026bdad11 Fix ELN build
The bundled gmp (for RHEL builds) needs a C23 fix for a configure test:

https://src.fedoraproject.org/rpms/gmp/pull-request/8

Also, one test needs to be modified as the DEFAULT crypto policy rejects
TLS ciphers with RSA key exchange in RHEL 10:

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10-beta/html/considerations_in_adopting_rhel_10/security#security
2025-02-05 11:30:38 -05:00
Daiki Ueno
c25fdb6fa9 Disable GOST in RHEL-9 or later
Resolves: RHEL-56919
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-01-22 23:17:41 -05:00
Fedora Release Engineering
8d60243b00 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 23:06:20 +00:00
Daiki Ueno
abb8fe2e0b Update to 3.8.8 upstream release
- Resolves: rhbz#2323786

Upstream tag: 3.8.8
Upstream commit: 40267b5e

Commit authored by Packit automation (https://packit.dev/)
2024-11-05 16:44:35 +09:00
Daiki Ueno
db84cc7c55 Fix build with latest mingw-gcc
mingw{32,64}-cpp are not installed by default, and
--enable-local-libopts should be unnecessary, as we have switched away
from autogen.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-11-05 16:40:46 +09:00
Daiki Ueno
a9b00cffcc Update downstream patches for 3.8.8
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-11-05 14:51:06 +09:00
Daiki Ueno
f89c924634 Remove distribution suffix before updating to 3.8.8
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-11-05 14:20:20 +09:00
Richard W.M. Jones
760d4e32b2 Remove mingw p11tool.exe
Without mingw-p11-kit we don't build this.
2024-09-13 08:34:18 +01:00
Richard W.M. Jones
9ca47ed49e Remove mingw-p11-kit dependency (RHBZ#2312031) 2024-09-12 22:12:02 +01:00
Daiki Ueno
7d85f31654 Stop pulling in compression libraries through gnutls.pc
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-08-16 10:59:05 +09:00
Daiki Ueno
e9fcd31237 Update to 3.8.7 upstream release
- Resolves: rhbz#2305086

Upstream tag: 3.8.7
Upstream commit: 994d9392

Commit authored by Packit automation (https://packit.dev/)
2024-08-15 21:03:31 +09:00
Daiki Ueno
39c1bd20e2 Remove upstreamed patches before updating to 3.8.7
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-08-15 16:56:19 +09:00
Daiki Ueno
e8ce92f749 liboqs: check whether Kyber768 is compiled in
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-07-29 09:03:27 +09:00
Daiki Ueno
37c03f7739 Fix configure check on nettle_rsa_oaep_* functions
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-07-26 15:49:32 +09:00
Daiki Ueno
b07c9547ba Enable X25519Kyber768Draft00 key exchange in TLS
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-07-24 18:06:03 +09:00
Daiki Ueno
ee639ed085 Switch to using dlwrap for loading compression libraries
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-07-22 20:42:21 +09:00
Yaakov Selkowitz
7e61bcbcbd Fix FIPS build with RPM 4.20
The FIPS build runs *_install_post commands early during %install so that
the binaries will not be modified after running fipshmac, since those
commands are supposed to be no-op if re-run.  However, __debug_install_post
is only run if __debug_package is defined, which is triggered by the
automatic creation of the debuginfo subpackage where appropriate.

Previously, a hack in redhat-rpm-config caused this to be enabled by
%install, but with RPM 4.20 this is no longer needed, and the hack was
removed from redhat-rpm-config for F41.  On Fedora builds,
%mingw_debug_package triggers this and therefore it still builds, but ELN
is build without mingw and therefore there now is nothing to trigger the
debuginfo generation during %install.  As a result, the binaries would just
be stripped without any debuginfo generation during the first run, leaving
nothing to detect in the second run, and the build would fail for lack of
debug symbols/sources.

https://github.com/rpm-software-management/rpm/issues/2204
https://src.fedoraproject.org/rpms/redhat-rpm-config/c/7a1571ee808ba13b129eab7a7ed3869e77740c3e
2024-07-19 15:55:26 -04:00
Fedora Release Engineering
1dcd42a32e Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 03:21:01 +00:00
Daiki Ueno
e1613e89be Bump nettle dependency to 3.10
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-07-09 01:35:31 +09:00
Zoltan Fridrich
d44882c396 Update to 3.8.6 upstream release
Upstream tag: 3.8.6
Upstream commit: cd953cfa

Commit authored by Packit automation (https://packit.dev/)
2024-07-03 15:57:21 +02:00
Zoltan Fridrich
113f492765 Build with certificate compression enabled
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2024-06-17 11:55:48 +02:00
Daiki Ueno
87c3926250 Bump release to build against newer nettle
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-06-17 12:43:43 +09:00
Alexander Sosedkin
595be10e4d Add gmp tarball to sources file, add gmp patch 2024-05-16 13:32:15 +02:00
Daiki Ueno
bee7049a8a Add bcond to statically link to GMP
In CentOS Stream 9 and RHEL 9, we link to libgmp statically to ensure
zeroization of internally allocated memory areas according to FIPS
140-3. This ports the ability to Fedora, in a way it is configured
with a `--with bundled_gmp` build conditional.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-05-14 15:02:19 +09:00
Daiki Ueno
42b10964b0 Add virtual package to pull in nettle/gmp dependencies for FIPS
This adds a new subpackage `gnutls-fips` with strict version
requirements to nettle and gmp under FIPS, as gnutls now calculates
library integrity (HMAC) over those libraries.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-04-24 15:23:17 +09:00
Zoltan Fridrich
ab660a5e4e [packit] 3.8.5 upstream release
Upstream tag: 3.8.5
Upstream commit: 49f4ae21
2024-04-04 15:30:28 +02:00
Zoltan Fridrich
510f2c8050 [packit] 3.8.4 upstream release
- Resolves rhbz#2270320

Upstream tag: 3.8.4
Upstream commit: 4a4cefef
2024-03-20 13:21:37 +01:00
Zoltan Fridrich
25900e352d Fix mingw build failure
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2024-02-22 18:15:37 +01:00
Zoltan Fridrich
c5694f3e42 Update keyring
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2024-01-24 10:10:45 +01:00
Zoltan Fridrich
da7f0db0fe [packit] 3.8.3 upstream release
Upstream tag: 3.8.3
Upstream commit: 2f04c14d
2024-01-23 10:28:06 +01:00
Fedora Release Engineering
c42ee03de2 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 23:15:46 +00:00
Simon de Vlieger
be817c2d2d
Bump Nettle dependency.
GnuTLS depends on symbols from a newer version of Nettle (3.9).

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
2023-12-12 10:58:20 +01:00
Daiki Ueno
23ac5676a4 Tentatively revert newly added Ed448 keys support in PKCS#11
To fix regression with Ed25519 reported in:
https://gitlab.com/gnutls/gnutls/-/issues/1515

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2023-12-01 17:44:03 +09:00
Daiki Ueno
7543c5d148 [packit] 3.8.2 upstream release
Upstream tag: 3.8.2
Upstream commit: e840a07f
2023-11-22 15:23:57 +09:00
Daiki Ueno
5e97cebf83 Remove patches no longer needed in 3.8.2
Also use XFAIL_TESTS envvar to skip ktls_keyupdate.sh, instead of
patching the source code.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2023-11-22 14:41:15 +09:00
Daiki Ueno
d7d09eb023 Skip KTLS test if the host kernel is older than 5.11
The ktls.sh test currently only supports kernel 5.11+.  This needs to
be checked at run time, as the koji builder might be using a different
version of kernel on the host than the one indicated by the
kernel-devel package.

Resolves: #2247135
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2023-11-10 05:39:53 +09:00
Stephen Gallagher
a4ef955090 Don't build with SRP on RHEL
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2023-08-29 09:39:14 -04:00
Zoltan Fridrich
a0ef9addb1 [packit] 3.8.1 upstream release
Upstream tag: 3.8.1
Upstream commit: 513570a5
2023-08-25 14:06:59 +02:00
Daiki Ueno
44afab5191 Migrate License field to SPDX license identifier
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2023-08-24 10:19:38 +09:00
Fedora Release Engineering
e4e388800c Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 23:57:26 +00:00
Peter Leitmann
2f8c73c631 Add TMT interop tests 2023-05-23 14:27:14 +00:00
Daiki Ueno
6a9f55ef66 Fix leftover of the previous %bcond change
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2023-04-13 20:09:49 +09:00
Daiki Ueno
82e473e933 Use %bcond instead of %global for srp and mingw support
This makes it possible to build the package with/without those
features, through rpmbuild --with/--without.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2023-04-11 19:38:39 +09:00
Richard W.M. Jones
e99bcaff78 Fix desychronisation with kTLS:
https://gitlab.com/gnutls/gnutls/-/issues/1470
2023-03-11 07:32:46 +00:00
Daniel P. Berrangé
e361bb292d Disable GNULIB's year2038 support for 64-bit time_t
GNUTLS exposes time_t in its public API and thus the size of time_t
is ABI relevant. It can't be changed in size without breaking
ABI compatibility with applications built against GNUTLS that use
the default time_t size.

https://gitlab.com/gnutls/gnutls/-/issues/1466
https://bugzilla.redhat.com/show_bug.cgi?id=2174758
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-03-02 11:53:34 +00:00
Zoltan Fridrich
b08c1d3cb5 [packit] 3.8.0 upstream release
Upstream tag: 3.8.0
Upstream commit: 516e466b

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2023-02-16 11:14:30 +01:00
Zoltan Fridrich
9df43c9df7 Prepare for release
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2023-02-14 15:01:58 +01:00
Frantisek Krenzelok
a9d1c50f1a
KTLS: disable ktls_keyupdate & tls1.2 chachapoly tests
There seems to be a kernel specific issues with CHACHA20-POLY1305 for
TLS 1.2 [1]

The test fails without a needed kernel patch

[1] https://gitlab.com/gnutls/gnutls/-/issues/1443

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
2023-01-20 21:55:56 +01:00
Frantisek Krenzelok
c1f8e66db2
KTLS additional ciphersuites
Key update supported for patched kernels [1]

Configuration option `ktls = false` [2]

following ciphersuites are now supported: [3]
* TLS_AES_128_CCM_SHA256
* TLS_CHACHA20_POLY1305_SHA256

Ivalidate session on KTLS error as there is no way to recover and new
sockets as well as session have to be created. [4]

[1] https://gitlab.com/gnutls/gnutls/-/merge_requests/1625
[2] https://gitlab.com/gnutls/gnutls/-/merge_requests/1673/diffs?commit_id=aefd7319c0b7b2410d06238246b7755b289e4837
[3] https://gitlab.com/gnutls/gnutls/-/merge_requests/1676
[4] https://gitlab.com/gnutls/gnutls/-/merge_requests/1664

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
2023-01-20 19:17:15 +01:00
Fedora Release Engineering
d401f95817 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 05:48:39 +00:00
29 changed files with 10709 additions and 236 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

32
.gitignore vendored
View file

@ -141,3 +141,35 @@ gnutls-2.10.1-nosrp.tar.bz2
/gnutls-3.7.6.tar.xz
/gnutls-3.7.7.tar.xz
/gnutls-3.7.8.tar.xz
/gnutls-3.8.0.tar.xz
/gnutls-3.8.0.tar.xz.sig
/gnutls-release-keyring.gpg
/gnutls-3.8.1.tar.xz
/gnutls-3.8.1.tar.xz.sig
/gnutls-3.8.2.tar.xz
/gnutls-3.8.2.tar.xz.sig
/gnutls-3.8.3.tar.xz
/gnutls-3.8.3.tar.xz.sig
/gnutls-3.8.4.tar.xz
/gnutls-3.8.4.tar.xz.sig
/gnutls-3.8.5.tar.xz
/gnutls-3.8.5.tar.xz.sig
/gnutls-3.8.6.tar.xz
/gnutls-3.8.6.tar.xz.sig
/gmp-6.2.1.tar.xz
/gnutls-3.8.7.tar.xz
/gnutls-3.8.7.tar.xz.sig
/gnutls-3.8.7.1.tar.xz
/gnutls-3.8.7.1.tar.xz.sig
/gnutls-3.8.8.tar.xz
/gnutls-3.8.8.tar.xz.sig
/gnutls-3.8.9.tar.xz
/gnutls-3.8.9.tar.xz.sig
/leancrypto-1.2.0.tar.gz
/leancrypto-1.3.0.tar.gz
/gnutls-3.8.10.tar.xz
/gnutls-3.8.10.tar.xz.sig
/leancrypto-1.5.0.tar.gz
/gnutls-3.8.11.tar.xz
/gnutls-3.8.11.tar.xz.sig
/leancrypto-1.6.0.tar.gz

View file

@ -15,7 +15,6 @@ actions:
post-upstream-clone:
- "wget https://src.fedoraproject.org/rpms/gnutls/raw/main/f/gnutls.spec"
- "wget https://src.fedoraproject.org/rpms/gnutls/raw/main/f/gnutls-3.2.7-rpath.patch"
- "wget https://src.fedoraproject.org/rpms/gnutls/raw/main/f/gnutls-3.6.7-no-now-guile.patch"
get-current-version:
- "git describe --abbrev=0"
create-archive:
@ -29,5 +28,4 @@ actions:
jobs:
- job: propose_downstream
trigger: release
metadata:
dist_git_branches: fedora-all
dist_git_branches: fedora-all

View file

@ -1,3 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 0.60.0.
The file was generated using packit 1.12.0.

1
ci.fmf Normal file
View file

@ -0,0 +1 @@
resultsdb-testcase: separate

13
gmp-6.2.1-c23.patch Normal file
View file

@ -0,0 +1,13 @@
diff --git a/acinclude.m4 b/acinclude.m4
index 906071c..a466b7c 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -609,7 +609,7 @@ GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1],
#if defined (__GNUC__) && ! defined (__cplusplus)
typedef unsigned long long t1;typedef t1*t2;
-void g(){}
+void g(int, t2, t1, t2, t2, int){}
void h(){}
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}

3515
gmp-6.2.1-intel-cet.patch Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,11 +0,0 @@
--- a/guile/src/Makefile.in 2019-03-27 11:51:55.984398001 +0100
+++ b/guile/src/Makefile.in 2019-03-27 11:52:27.259626076 +0100
@@ -1472,7 +1472,7 @@
# Use '-module' to build a "dlopenable module", in Libtool terms.
# Use '-undefined' to placate Libtool on Windows; see
# <https://lists.gnutls.org/pipermail/gnutls-devel/2014-December/007294.html>.
-guile_gnutls_v_2_la_LDFLAGS = -module -no-undefined
+guile_gnutls_v_2_la_LDFLAGS = -module -no-undefined -Wl,-z,lazy
# Linking against GnuTLS.
GNUTLS_CORE_LIBS = $(top_builddir)/lib/libgnutls.la

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,132 +0,0 @@
From 7fa942e08e64b761b19753ae74503de43cc1ff91 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Thu, 6 Oct 2022 18:44:48 +0900
Subject: build: suppress GCC analyzer warnings
Signed-off-by: Daiki Ueno <ueno@gnu.org>
diff --git a/lib/auth/cert.c b/lib/auth/cert.c
index 228d98468..f122049e1 100644
--- a/lib/auth/cert.c
+++ b/lib/auth/cert.c
@@ -1636,6 +1636,10 @@ _gnutls_select_server_cert(gnutls_session_t session, const gnutls_cipher_suite_e
if (session->internals.selected_cert_list_length == 0)
return gnutls_assert_val(GNUTLS_E_INSUFFICIENT_CREDENTIALS);
+ if (unlikely(session->internals.selected_cert_list == NULL)) {
+ return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
+ }
+
_gnutls_debug_log("Selected (%s) cert\n",
gnutls_pk_get_name(session->internals.selected_cert_list[0].pubkey->params.algo));
}
diff --git a/lib/nettle/int/provable-prime.c b/lib/nettle/int/provable-prime.c
index 585cd031e..3a626a2c8 100644
--- a/lib/nettle/int/provable-prime.c
+++ b/lib/nettle/int/provable-prime.c
@@ -1173,7 +1173,7 @@ st_provable_prime(mpz_t p,
if (iterations > 0) {
storage_length = iterations * DIGEST_SIZE;
- storage = malloc(storage_length);
+ storage = gnutls_malloc(storage_length);
if (storage == NULL)
goto fail;
@@ -1307,7 +1307,7 @@ st_provable_prime(mpz_t p,
mpz_clear(t);
mpz_clear(tmp);
mpz_clear(c);
- free(pseed);
- free(storage);
+ gnutls_free(pseed);
+ gnutls_free(storage);
return ret;
}
diff --git a/lib/pk.c b/lib/pk.c
index c5600a32a..753cecd18 100644
--- a/lib/pk.c
+++ b/lib/pk.c
@@ -93,6 +93,7 @@ _gnutls_encode_ber_rs_raw(gnutls_datum_t * sig_value,
}
if (r->data[0] >= 0x80) {
+ assert(tmp);
tmp[0] = 0;
memcpy(&tmp[1], r->data, r->size);
result = asn1_write_value(sig, "r", tmp, 1+r->size);
@@ -108,6 +109,7 @@ _gnutls_encode_ber_rs_raw(gnutls_datum_t * sig_value,
if (s->data[0] >= 0x80) {
+ assert(tmp);
tmp[0] = 0;
memcpy(&tmp[1], s->data, s->size);
result = asn1_write_value(sig, "s", tmp, 1+s->size);
@@ -598,6 +600,10 @@ encode_ber_digest_info(const mac_entry_st * e,
uint8_t *tmp_output;
int tmp_output_size;
+ if (unlikely(e == NULL)) {
+ return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
+ }
+
/* prevent asn1_write_value() treating input as string */
if (digest->size == 0)
return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
diff --git a/lib/x509/pkcs7-crypt.c b/lib/x509/pkcs7-crypt.c
index 59eddcd2a..6f528a911 100644
--- a/lib/x509/pkcs7-crypt.c
+++ b/lib/x509/pkcs7-crypt.c
@@ -1211,6 +1211,10 @@ _gnutls_pkcs_raw_decrypt_data(schema_id schema, asn1_node pkcs8_asn,
}
ce = cipher_to_entry(enc_params->cipher);
+ if (unlikely(ce == NULL)) {
+ ret = gnutls_assert_val(GNUTLS_E_UNKNOWN_CIPHER_TYPE);
+ goto error;
+ }
block_size = _gnutls_cipher_get_block_size(ce);
if (ce->type == CIPHER_BLOCK) {
diff --git a/src/tests.c b/src/tests.c
index 85c4b6699..8526b6943 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -1613,7 +1613,9 @@ test_code_t test_chain_order(gnutls_session_t session)
gnutls_free(t.data);
}
- *pos = 0;
+ if (pos) {
+ *pos = 0;
+ }
t.size = p_size;
t.data = (void*)p;
diff --git a/src/tpmtool.c b/src/tpmtool.c
index 171b7fd41..1b230c2ff 100644
--- a/src/tpmtool.c
+++ b/src/tpmtool.c
@@ -263,15 +263,15 @@ static void tpm_generate(FILE * out, unsigned int key_type,
gnutls_datum_t privkey, pubkey;
if (!srk_well_known) {
- srk_pass = getpass("Enter SRK password: ");
- if (srk_pass != NULL)
- srk_pass = strdup(srk_pass);
+ char *pass = getpass("Enter SRK password: ");
+ if (pass != NULL)
+ srk_pass = strdup(pass);
}
if (!(flags & GNUTLS_TPM_REGISTER_KEY)) {
- key_pass = getpass("Enter key password: ");
- if (key_pass != NULL)
- key_pass = strdup(key_pass);
+ char *pass = getpass("Enter key password: ");
+ if (pass != NULL)
+ key_pass = strdup(pass);
}
ret =

Binary file not shown.

View file

@ -0,0 +1,114 @@
From e0eb2bbb212a5c9d72311c59e7235832a0075dcc Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Wed, 9 Jul 2025 18:54:48 +0900
Subject: [PATCH] add tests/ktls_utils.h
Signed-off-by: rpm-build <rpm-build>
---
tests/ktls_utils.h | 94 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 tests/ktls_utils.h
diff --git a/tests/ktls_utils.h b/tests/ktls_utils.h
new file mode 100644
index 0000000..231618d
--- /dev/null
+++ b/tests/ktls_utils.h
@@ -0,0 +1,94 @@
+#ifndef GNUTLS_TESTS_KTLS_UTILS_H
+#define GNUTLS_TESTS_KTLS_UTILS_H
+
+#include <fcntl.h>
+#include <signal.h>
+
+#include <netinet/in.h>
+
+#include <sys/socket.h>
+#include <sys/wait.h>
+
+/* Sets the NONBLOCK flag on the socket(fd) */
+inline static int set_nonblocking(int fd)
+{
+ int flags = fcntl(fd, F_GETFL, 0);
+ if (flags == -1) {
+ return 1;
+ }
+
+ if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
+ return 2;
+ }
+
+ return 0;
+}
+
+/* Creates a pair of TCP connected sockets */
+static int create_socket_pair(int *client_fd, int *server_fd)
+{
+ int ret;
+ struct sockaddr_in saddr;
+ socklen_t addrlen;
+ int listener;
+
+ listener = socket(AF_INET, SOCK_STREAM, 0);
+ if (listener == -1) {
+ fail("error in listener(): %s\n", strerror(errno));
+ return 1;
+ }
+
+ int opt = 0;
+ setsockopt(listener, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
+
+ memset(&saddr, 0, sizeof(saddr));
+ saddr.sin_family = AF_INET;
+ saddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ saddr.sin_port = 0;
+
+ ret = bind(listener, (struct sockaddr *)&saddr, sizeof(saddr));
+ if (ret == -1) {
+ fail("error in bind(): %s\n", strerror(errno));
+ return 1;
+ }
+
+ addrlen = sizeof(saddr);
+ ret = getsockname(listener, (struct sockaddr *)&saddr, &addrlen);
+ if (ret == -1) {
+ fail("error in getsockname(): %s\n", strerror(errno));
+ return 1;
+ }
+
+ ret = listen(listener, 1);
+ if (ret == -1) {
+ fail("error in listen(): %s\n", strerror(errno));
+ close(listener);
+ return 1;
+ }
+
+ *client_fd = socket(AF_INET, SOCK_STREAM, 0);
+ if (*client_fd < 0) {
+ fail("error in socket(): %s\n", strerror(errno));
+ return 1;
+ }
+
+ ret = connect(*client_fd, (struct sockaddr *)&saddr, addrlen);
+ if (ret < 0) {
+ fail("error in connect(): %s\n", strerror(errno));
+ close(listener);
+ close(*client_fd);
+ return 1;
+ }
+
+ *server_fd = accept(listener, NULL, NULL);
+ if (*server_fd < 0) {
+ fail("error in accept(): %s\n", strerror(errno));
+ close(listener);
+ close(*client_fd);
+ return 1;
+ }
+
+ return 0;
+}
+
+#endif //GNUTLS_TESTS_KTLS_UTILS_H
--
2.49.0

View file

@ -0,0 +1,58 @@
From 15fb5ad536c375a74cc0d87859c9fc919d924c9d Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 10 Jul 2025 05:45:06 +0900
Subject: [PATCH] support VPATH build for mldsa tests
Signed-off-by: rpm-build <rpm-build>
---
tests/cert-tests/mldsa.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/cert-tests/mldsa.sh b/tests/cert-tests/mldsa.sh
index 7e31e11..55e31ce 100644
--- a/tests/cert-tests/mldsa.sh
+++ b/tests/cert-tests/mldsa.sh
@@ -130,7 +130,7 @@ for variant in 44 65 87; do
# Check default
TMPKEYDEFAULT=$testdir/key-$algo-$format-default
TMPKEY=$testdir/key-$algo-$format
- ${VALGRIND} "${CERTTOOL}" -k --no-text --infile "data/key-$algo-$format.pem" >"$TMPKEYDEFAULT"
+ ${VALGRIND} "${CERTTOOL}" -k --no-text --infile "$srcdir/data/key-$algo-$format.pem" >"$TMPKEYDEFAULT"
if [ $? != 0 ]; then
cat "$TMPKEYDEFAULT"
exit 1
@@ -138,19 +138,19 @@ for variant in 44 65 87; do
# The "expandedKey" format doesn't have public key part
if [ "$format" = seed ] || [ "$format" = both ]; then
- if ! "${DIFF}" "$TMPKEYDEFAULT" "data/key-$algo-both.pem"; then
+ if ! "${DIFF}" "$TMPKEYDEFAULT" "$srcdir/data/key-$algo-both.pem"; then
exit 1
fi
fi
# Check roundtrip with --key-format
- ${VALGRIND} "${CERTTOOL}" -k --no-text --key-format "$format" --infile "data/key-$algo-$format.pem" >"$TMPKEY"
+ ${VALGRIND} "${CERTTOOL}" -k --no-text --key-format "$format" --infile "$srcdir/data/key-$algo-$format.pem" >"$TMPKEY"
if [ $? != 0 ]; then
cat "$TMPKEY"
exit 1
fi
- if ! "${DIFF}" "$TMPKEY" "data/key-$algo-$format.pem"; then
+ if ! "${DIFF}" "$TMPKEY" "$srcdir/data/key-$algo-$format.pem"; then
exit 1
fi
done
@@ -164,7 +164,7 @@ for n in 1; do
fi
echo "Testing inconsistent ML-DSA key ($n)"
- if "${CERTTOOL}" -k --infile "data/key-mldsa-inconsistent$n.pem"; then
+ if "${CERTTOOL}" -k --infile "$srcdir/data/key-mldsa-inconsistent$n.pem"; then
exit 1
fi
done
--
2.49.0

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
From a9800309197fe5aef913944b2fc77164946f0689 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Tue, 23 Jul 2024 16:04:56 +0900
Subject: [PATCH] build: link against libhogweed when checking
nettle_rsa_oaep_*
Signed-off-by: Daiki Ueno <ueno@gnu.org>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index fb0aefe1f4..8b55808bd7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -795,7 +795,7 @@ AM_CONDITIONAL([NEED_SIV_GCM], [test "$ac_cv_func_nettle_siv_gcm_encrypt_message
# Check for RSA-OAEP
save_LIBS=$LIBS
-LIBS="$LIBS $NETTLE_LIBS"
+LIBS="$LIBS $HOGWEED_LIBS $NETTLE_LIBS $GMP_LIBS"
AC_CHECK_FUNCS(nettle_rsa_oaep_sha256_encrypt)
LIBS=$save_LIBS
AM_CONDITIONAL([NEED_RSA_OAEP], [test "$ac_cv_func_nettle_rsa_oaep_sha256_encrypt" != yes])
--
2.45.2

View file

@ -0,0 +1,29 @@
From a36b73a21e4b5b6e051b23192a645dea34c9d6af Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Tue, 5 Nov 2024 14:45:46 +0900
Subject: [PATCH] tests: skip CHACHA20-POLY1305 in TLS 1.2 when KTLS is enabled
Signed-off-by: Daiki Ueno <ueno@gnu.org>
---
tests/gnutls_ktls.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/gnutls_ktls.c b/tests/gnutls_ktls.c
index 90d3e9af91..d5ac4efecc 100644
--- a/tests/gnutls_ktls.c
+++ b/tests/gnutls_ktls.c
@@ -347,9 +347,11 @@ void doit(void)
{
run("NORMAL:-VERS-ALL:+VERS-TLS1.2:-CIPHER-ALL:+AES-128-GCM");
run("NORMAL:-VERS-ALL:+VERS-TLS1.2:-CIPHER-ALL:+AES-256-GCM");
+#if 0
if (!gnutls_fips140_mode_enabled()) {
run("NORMAL:-VERS-ALL:+VERS-TLS1.2:-CIPHER-ALL:+CHACHA20-POLY1305");
}
+#endif
run("NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-128-GCM");
run("NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-256-GCM");
if (!gnutls_fips140_mode_enabled()) {
--
2.47.0

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -12,36 +12,58 @@ sha256sum:close()
print(string.sub(hash, 0, 16))
}
%global with_mingw 0
%if 0%{?fedora}
%global with_mingw 0%{!?_without_mingw:1}
%endif
Version: 3.7.8
Version: 3.8.11
Release: %{?autorelease}%{!?autorelease:1%{?dist}}
Patch: gnutls-3.7.8-gcc_analyzer-suppress_warnings.patch
Patch: gnutls-3.6.7-no-now-guile.patch
Patch: gnutls-3.2.7-rpath.patch
# follow https://gitlab.com/gnutls/gnutls/-/issues/1443
Patch: gnutls-3.8.8-tests-ktls-skip-tls12-chachapoly.patch
%bcond_without bootstrap
%bcond_without dane
%if 0%{?rhel}
%bcond_with guile
%bcond_without fips
%else
%bcond_without guile
%bcond_without fips
%endif
%bcond_with tpm12
%bcond_without tpm2
%if 0%{?rhel} >= 9
%bcond_with gost
%else
%bcond_without gost
%bcond_with certificate_compression
%endif
%bcond_without certificate_compression
%bcond_without leancrypto
%bcond_without crypto_auditing
%bcond_without tests
%if 0%{?fedora} && 0%{?fedora} < 38
%bcond_without srp
%else
%bcond_with srp
%endif
%if 0%{?fedora}
%bcond_without mingw
%else
%bcond_with mingw
%endif
%if 0%{?rhel} >= 9 && %{with fips}
%bcond_without bundled_gmp
%else
%bcond_with bundled_gmp
%endif
%define fips_requires() %{lua:
local f = assert(io.popen("rpm -q --queryformat '%{EVR}' --whatprovides "..rpm.expand("'%1%{?_isa}'")))
local v = f:read("*all")
f:close()
print("Requires: "..rpm.expand("%1%{?_isa}").." = "..v.."\\n")
}
Summary: A TLS protocol implementation
Name: gnutls
# The libraries are LGPLv2.1+, utilities are GPLv3+
License: GPLv3+ and LGPLv2+
License: GPL-3.0-or-later AND LGPL-2.1-or-later
BuildRequires: p11-kit-devel >= 0.21.3, gettext-devel
BuildRequires: readline-devel, libtasn1-devel >= 4.3
%if %{with certificate_compression}
@ -50,7 +72,10 @@ BuildRequires: zlib-devel, brotli-devel, libzstd-devel
%if %{with bootstrap}
BuildRequires: automake, autoconf, gperf, libtool, texinfo
%endif
BuildRequires: nettle-devel >= 3.5.1
BuildRequires: nettle-devel >= 3.10.1
%if %{with leancrypto}
BuildRequires: meson
%endif
%if %{with tpm12}
BuildRequires: trousers-devel >= 0.3.11.2
%endif
@ -59,16 +84,20 @@ BuildRequires: tpm2-tss-devel >= 3.0.3
%endif
BuildRequires: libidn2-devel
BuildRequires: libunistring-devel
BuildRequires: net-tools, datefudge, softhsm, gcc, gcc-c++
BuildRequires: net-tools, softhsm, gcc, gcc-c++
BuildRequires: gnupg2
BuildRequires: git-core
%if %{with crypto_auditing}
BuildRequires: systemtap-sdt-devel
%endif
# for a sanity check on cert loading
BuildRequires: p11-kit-trust, ca-certificates
Requires: crypto-policies
Requires: p11-kit-trust
Requires: libtasn1 >= 4.3
Requires: nettle >= 3.4.1
# always bump when a nettle release is packaged
Requires: nettle >= 3.10.1
%if %{with tpm12}
Recommends: trousers >= 0.3.11.2
%endif
@ -76,27 +105,24 @@ Recommends: trousers >= 0.3.11.2
%if %{with dane}
BuildRequires: unbound-devel unbound-libs
%endif
%if %{with guile}
BuildRequires: guile22-devel
%endif
BuildRequires: make gtk-doc
%if %{with_mingw}
%if %{with mingw}
BuildRequires: mingw32-cpp
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw32-libtasn1 >= 4.3
BuildRequires: mingw32-readline
BuildRequires: mingw32-zlib
BuildRequires: mingw32-p11-kit >= 0.23.1
BuildRequires: mingw32-nettle >= 3.6
BuildRequires: mingw64-cpp
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc
BuildRequires: mingw64-gcc-c++
BuildRequires: mingw64-libtasn1 >= 4.3
BuildRequires: mingw64-readline
BuildRequires: mingw64-zlib
BuildRequires: mingw64-p11-kit >= 0.23.1
BuildRequires: mingw64-nettle >= 3.6
%endif
@ -104,7 +130,20 @@ URL: http://www.gnutls.org/
%define short_version %(echo %{version} | grep -m1 -o "[0-9]*\.[0-9]*" | head -1)
Source0: https://www.gnupg.org/ftp/gcrypt/gnutls/v%{short_version}/%{name}-%{version}.tar.xz
Source1: https://www.gnupg.org/ftp/gcrypt/gnutls/v%{short_version}/%{name}-%{version}.tar.xz.sig
Source2: gnutls-release-keyring.gpg
Source2: https://gnutls.org/gnutls-release-keyring.gpg
%if %{with bundled_gmp}
Provides: bundled(gmp) = 6.2.1
Source100: gmp-6.2.1.tar.xz
# Taken from the main gmp package
Source101: gmp-6.2.1-intel-cet.patch
Source102: gmp-6.2.1-c23.patch
%endif
%if %{with leancrypto}
Provides: bundled(leancrypto) = 1.6.0
Source300: leancrypto-1.6.0.tar.gz
%endif
# Wildcard bundling exception https://fedorahosted.org/fpc/ticket/174
Provides: bundled(gnulib) = 20130424
@ -123,7 +162,7 @@ Requires: %{name}-dane%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%package utils
License: GPLv3+
License: GPL-3.0-or-later
Summary: Command line tools for TLS protocol
Requires: %{name}%{?_isa} = %{version}-%{release}
%if %{with dane}
@ -136,11 +175,14 @@ Summary: A DANE protocol implementation for GnuTLS
Requires: %{name}%{?_isa} = %{version}-%{release}
%endif
%if %{with guile}
%package guile
Summary: Guile bindings for the GNUTLS library
%if %{with fips}
%package fips
Summary: Virtual package to install packages required to use %{name} under FIPS mode
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: guile22
%{fips_requires nettle}
%if !%{with bundled_gmp}
%{fips_requires gmp}
%endif
%endif
%description
@ -186,17 +228,18 @@ This package contains library that implements the DANE protocol for verifying
TLS certificates through DNSSEC.
%endif
%if %{with guile}
%description guile
%if %{with fips}
%description fips
GnuTLS is a secure communications library implementing the SSL, TLS and DTLS
protocols and technologies around them. It provides a simple C language
application programming interface (API) to access the secure communications
protocols as well as APIs to parse and write X.509, PKCS #12, OpenPGP and
other required structures.
This package contains Guile bindings for the library.
other required structures.
This package does not contain any file, but installs required packages
to use GnuTLS under FIPS mode.
%endif
%if %{with_mingw}
%if %{with mingw}
%package -n mingw32-%{name}
Summary: MinGW GnuTLS TLS/SSL encryption library
Requires: pkgconfig
@ -225,9 +268,73 @@ for MinGW.
%autosetup -p1 -S git
%if %{with bundled_gmp}
mkdir -p bundled_gmp
pushd bundled_gmp
tar --strip-components=1 -xf %{SOURCE100}
patch -p1 < %{SOURCE101}
patch -p1 < %{SOURCE102}
popd
%endif
%build
%define _lto_cflags %{nil}
%if %{with leancrypto}
mkdir -p bundled_leancrypto
pushd bundled_leancrypto
tar --strip-components=1 -xf %{SOURCE300}
popd
%endif
%if %{with bundled_gmp}
pushd bundled_gmp
autoreconf -ifv
%configure --disable-cxx --disable-shared --enable-fat --with-pic
%make_build
popd
export GMP_CFLAGS="-I$PWD/bundled_gmp"
export GMP_LIBS="$PWD/bundled_gmp/.libs/libgmp.a"
%endif
%if %{with leancrypto}
pushd bundled_leancrypto
%set_build_flags
meson setup -Dprefix="$PWD/install" -Dlibdir="$PWD/install/lib" \
-Ddefault_library=static \
-Dascon=disabled -Dascon_keccak=disabled \
-Dbike_5=disabled -Dbike_3=disabled -Dbike_1=disabled \
-Dkyber_x25519=disabled -Ddilithium_ed25519=disabled \
-Dx509_parser=disabled -Dx509_generator=disabled \
-Dpkcs7_parser=disabled -Dpkcs7_generator=disabled \
-Dsha2-256=disabled \
-Daes_gcm=disabled -Daes_cbc=disabled -Daes_ctr=disabled -Daes_xts=disabled \
-Dchacha20=disabled -Dchacha20poly1305=disabled -Dchacha20_drng=disabled \
-Ddrbg_hash=disabled -Ddrbg_hmac=disabled \
-Dhash_crypt=disabled \
-Dhmac=disabled -Dhkdf=disabled \
-Dkdf_ctr=disabled -Dkdf_fb=disabled -Dkdf_dpi=disabled \
-Dpbkdf2=disabled \
-Dkmac_drng=disabled -Dcshake_drng=disabled \
-Dhotp=disabled -Dtotp=disabled \
-Daes_block=disabled -Daes_cbc=disabled -Daes_ctr=disabled \
-Daes_kw=disabled -Dapps=disabled \
-Ddisable-asm=true \
_build
# the reason for -Ddisable-asm=true being bz2416812
# revert once the root cause is fixed
meson compile -C _build
meson install -C _build
popd
export LEANCRYPTO_DIR="$PWD/bundled_leancrypto/install"
export LEANCRYPTO_CFLAGS="-I$LEANCRYPTO_DIR/include"
export LEANCRYPTO_LIBS="$LEANCRYPTO_DIR/lib/libleancrypto.a"
%endif
%if %{with bootstrap}
autoreconf -fi
%endif
@ -240,15 +347,6 @@ echo "SYSTEM=NORMAL" >> tests/system.prio
CCASFLAGS="$CCASFLAGS -Wa,--generate-missing-build-notes=yes"
export CCASFLAGS
%if %{with guile}
# These should be checked by m4/guile.m4 instead of configure.ac
# taking into account of _guile_suffix
guile_snarf=%{_bindir}/guile-snarf2.2
export guile_snarf
GUILD=%{_bindir}/guild2.2
export GUILD
%endif
%if %{with fips}
eval $(sed -n 's/^\(\(NAME\|VERSION_ID\)=.*\)/OS_\1/p' /etc/os-release)
export FIPS_MODULE_NAME="$OS_NAME ${OS_VERSION_ID%%.*} %name"
@ -256,6 +354,7 @@ export FIPS_MODULE_NAME="$OS_NAME ${OS_VERSION_ID%%.*} %name"
mkdir native_build
pushd native_build
%global _configure ../configure
%configure \
%if %{with fips}
@ -267,6 +366,12 @@ pushd native_build
--enable-gost \
%else
--disable-gost \
%endif
%if %{with srp}
--enable-srp-authentication \
%endif
%ifarch %{ix86}
--disable-year2038 \
%endif
--enable-sha1-support \
--disable-static \
@ -286,12 +391,6 @@ pushd native_build
%endif
--enable-ktls \
--htmldir=%{_docdir}/manual \
%if %{with guile}
--enable-guile \
--with-guile-extension-dir=%{_libdir}/guile/2.2 \
%else
--disable-guile \
%endif
%if %{with dane}
--with-unbound-root-key-file=/var/lib/unbound/root.key \
--enable-libdane \
@ -302,32 +401,47 @@ pushd native_build
--with-zlib --with-brotli --with-zstd \
%else
--without-zlib --without-brotli --without-zstd \
%endif
%if %{with leancrypto}
--with-leancrypto \
%else
--without-leancrypto \
%endif
%if %{with crypto_auditing}
--enable-crypto-auditing \
%else
--disable-crypto-auditing \
%endif
--disable-rpath \
--with-default-priority-string="@SYSTEM"
%make_build
%if %{with leancrypto}
sed -i '/^Requires.private:/s/leancrypto[ ,]*//g' lib/gnutls.pc
%endif
popd
%if %{with_mingw}
%if %{with mingw}
# MinGW does not support CCASFLAGS
export CCASFLAGS=""
%mingw_configure \
%if %{with srp}
--enable-srp-authentication \
%endif
--enable-sha1-support \
--disable-static \
--disable-openssl-compatibility \
--disable-non-suiteb-curves \
--disable-guile \
--disable-libdane \
--disable-rpath \
--disable-nls \
--disable-cxx \
--enable-local-libopts \
--enable-shared \
--without-tpm \
--with-included-unistring \
--disable-doc \
--with-default-priority-string="@SYSTEM"
--with-default-priority-string="@SYSTEM" \
--without-p11-kit
%mingw_make %{?_smp_mflags}
%endif
@ -337,8 +451,6 @@ pushd native_build
make -C doc install-html DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/guile/2.2/guile-gnutls*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/guile/2.2/guile-gnutls*.la
%if %{without dane}
rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/gnutls-dane.pc
%endif
@ -346,9 +458,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/gnutls-dane.pc
%if %{with fips}
# doing it twice should be a no-op the second time,
# and this way we avoid redefining it and missing a future change
%global __debug_package 1
%{__spec_install_post}
./lib/fipshmac "$RPM_BUILD_ROOT%{_libdir}/libgnutls.so.30" > $RPM_BUILD_ROOT%{_libdir}/.gnutls.hmac
sed -i "s^$RPM_BUILD_ROOT/usr^^" $RPM_BUILD_ROOT%{_libdir}/.gnutls.hmac
fname=`basename $RPM_BUILD_ROOT%{_libdir}/libgnutls.so.30.*.*`
./lib/fipshmac "$RPM_BUILD_ROOT%{_libdir}/libgnutls.so.30" > "$RPM_BUILD_ROOT%{_libdir}/.$fname.hmac"
sed -i "s^$RPM_BUILD_ROOT/usr^^" "$RPM_BUILD_ROOT%{_libdir}/.$fname.hmac"
ln -s ".$fname.hmac" "$RPM_BUILD_ROOT%{_libdir}/.libgnutls.so.30.hmac"
%endif
%if %{with fips}
@ -362,7 +477,7 @@ sed -i "s^$RPM_BUILD_ROOT/usr^^" $RPM_BUILD_ROOT%{_libdir}/.gnutls.hmac
%find_lang gnutls
popd
%if %{with_mingw}
%if %{with mingw}
%mingw_make_install
# Remove .la files
@ -394,17 +509,17 @@ rm -f $RPM_BUILD_ROOT%{mingw64_libdir}/ncrypt.dll*
%check
%if %{with tests}
pushd native_build
make check %{?_smp_mflags} GNUTLS_SYSTEM_PRIORITY_FILE=/dev/null
make check %{?_smp_mflags} GNUTLS_SYSTEM_PRIORITY_FILE=/dev/null || { cat tests/test-suite.log tests/cert-tests/test-suite.log tests/slow/test-suite.log src/gl/tests/test-suite.log; exit 1; }
popd
%endif
%files -f native_build/gnutls.lang
%{_libdir}/libgnutls.so.30*
%if %{with fips}
%{_libdir}/.gnutls.hmac
%{_libdir}/.libgnutls.so.30*.hmac
%endif
%doc README.md AUTHORS NEWS THANKS
%license LICENSE doc/COPYING doc/COPYING.LESSER
%license COPYING COPYING.LESSERv2
%files c++
%{_libdir}/libgnutlsxx.so.*
@ -427,7 +542,9 @@ popd
%{_bindir}/ocsptool
%{_bindir}/psktool
%{_bindir}/p11tool
%if %{with srp}
%{_bindir}/srptool
%endif
%if %{with dane}
%{_bindir}/danetool
%endif
@ -440,43 +557,42 @@ popd
%{_libdir}/libgnutls-dane.so.*
%endif
%if %{with guile}
%files guile
%{_libdir}/guile/2.2/guile-gnutls*.so*
%{_libdir}/guile/2.2/site-ccache/gnutls.go
%{_libdir}/guile/2.2/site-ccache/gnutls/extra.go
%{_datadir}/guile/site/2.2/gnutls.scm
%{_datadir}/guile/site/2.2/gnutls/extra.scm
%if %{with fips}
%files fips
%endif
%if %{with_mingw}
%if %{with mingw}
%files -n mingw32-%{name}
%license LICENSE doc/COPYING doc/COPYING.LESSER
%license COPYING COPYING.LESSERv2
%{mingw32_bindir}/certtool.exe
%{mingw32_bindir}/gnutls-cli-debug.exe
%{mingw32_bindir}/gnutls-cli.exe
%{mingw32_bindir}/gnutls-serv.exe
%{mingw32_bindir}/libgnutls-30.dll
%{mingw32_bindir}/ocsptool.exe
%{mingw32_bindir}/p11tool.exe
#%%{mingw32_bindir}/p11tool.exe
%{mingw32_bindir}/psktool.exe
%if %{with srp}
%{mingw32_bindir}/srptool.exe
%endif
%{mingw32_libdir}/libgnutls.dll.a
%{mingw32_libdir}/libgnutls-30.def
%{mingw32_libdir}/pkgconfig/gnutls.pc
%{mingw32_includedir}/gnutls/
%files -n mingw64-%{name}
%license LICENSE doc/COPYING doc/COPYING.LESSER
%license COPYING COPYING.LESSERv2
%{mingw64_bindir}/certtool.exe
%{mingw64_bindir}/gnutls-cli-debug.exe
%{mingw64_bindir}/gnutls-cli.exe
%{mingw64_bindir}/gnutls-serv.exe
%{mingw64_bindir}/libgnutls-30.dll
%{mingw64_bindir}/ocsptool.exe
%{mingw64_bindir}/p11tool.exe
#%%{mingw64_bindir}/p11tool.exe
%{mingw64_bindir}/psktool.exe
%if %{with srp}
%{mingw64_bindir}/srptool.exe
%endif
%{mingw64_libdir}/libgnutls.dll.a
%{mingw64_libdir}/libgnutls-30.def
%{mingw64_libdir}/pkgconfig/gnutls.pc

4
plans/fips-smoke.fmf Normal file
View file

@ -0,0 +1,4 @@
summary: Runs FIPS library integrity checks.
name: fips-smoke
execute:
script: if [[ $(GNUTLS_DEBUG_LEVEL=99 GNUTLS_FORCE_FIPS_MODE=1 certtool 2>&1 | grep "Error") ]]; then exit 1; else exit 0; fi;

10
plans/nss-2way.fmf Normal file
View file

@ -0,0 +1,10 @@
summary: Upstreamed gnutls-openssl interop-2way tests
contact: Stanislav Zidek <szidek@redhat.com>
discover:
# upstreamed tests (public)
- name: interop-nss-2way
how: fmf
url: https://gitlab.com/redhat-crypto/tests/interop.git
filter: 'tag: interop-gnutls & tag: interop-nss & tag: interop-2way'
execute:
how: tmt

10
plans/openssl-2way.fmf Normal file
View file

@ -0,0 +1,10 @@
summary: Upstreamed gnutls-openssl interop-2way tests
contact: Stanislav Zidek <szidek@redhat.com>
discover:
# upstreamed tests (public)
- name: interop-openssl-2way
how: fmf
url: https://gitlab.com/redhat-crypto/tests/interop.git
filter: 'tag: interop-gnutls & tag: interop-openssl & tag: interop-2way'
execute:
how: tmt

View file

@ -0,0 +1,10 @@
summary: Upstreamed gnutls interop tests - short tests which do not need to run in parallel
contact: Stanislav Zidek <szidek@redhat.com>
discover:
# upstreamed tests (public)
- name: interop-gnutls-short
how: fmf
url: https://gitlab.com/redhat-crypto/tests/interop.git
filter: 'tag: interop-gnutls & tag: -interop-slow'
execute:
how: tmt

View file

@ -1 +1,5 @@
SHA512 (gnutls-3.7.8.tar.xz) = 4199bcf7c9e3aab2f52266aadceefc563dfe2d938d0ea1f3ec3be95d66f4a8c8e5494d3a800c03dd02ad386dec1738bd63e1fe0d8b394a2ccfc7d6c6a0cc9359
SHA512 (gnutls-3.8.11.tar.xz) = 68f9e5bec3aa6686fd3319cc9c88a5cc44e2a75144049fc9de5fb55fef2241b4e16996af4be5dd48308abbee8cfaed6c862903f6bb89aff5dfa5410075bd7386
SHA512 (gnutls-3.8.11.tar.xz.sig) = 90883e5736299b103844ca42b85d371969ef66b50b60cb185e814ad9978598796e9ed07a590245ff28ac6ac084b1dee93fae0845576464583a5941835990957d
SHA512 (gnutls-release-keyring.gpg) = 8c2b39239d1d8c5319757fcf669f28a11de7f8ec4a726f9904c57ba8105bea80240083c0de71b747115907bab46569f10cf58004137cc7884ac5c20f8319ae0a
SHA512 (gmp-6.2.1.tar.xz) = c99be0950a1d05a0297d65641dd35b75b74466f7bf03c9e8a99895a3b2f9a0856cd17887738fa51cf7499781b65c049769271cbcb77d057d2e9f1ec52e07dd84
SHA512 (leancrypto-1.6.0.tar.gz) = cb6ace4a1642208dd7656b62a48e99d6261f471aa7967b738057745a4534abfa11d380dd5de98a737c0c13b1e1cb37ce780e02297eefc1cf839581629d34e100

View file

@ -1,13 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- smoke-fips:
dir: .
run: if [[ $(GNUTLS_DEBUG_LEVEL=99 GNUTLS_FORCE_FIPS_MODE=1 certtool 2>&1 | grep "Error") ]]; then exit 1; else exit 0; fi;
required_packages:
- gnutls
- gnutls-utils