From a4ac49a50a093400461826276851317962f6ef1e7b957d54584a4235ae767119 Mon Sep 17 00:00:00 2001
From: Pedro Monreal Gonzalez
Date: Wed, 27 Mar 2024 18:58:32 +0000
Subject: [PATCH] Accepting request 1161324 from
home:pmonrealgonzalez:branches:security:tls
- jitterentropy: Release the memory of the entropy collector when
using jitterentropy with phtreads as there is also a
pre-intitization done in the main thread. [bsc#1221242]
* Add gnutls-FIPS-jitterentropy-deinit-threads.patch
- Update to 3.8.4:
* libgnutls: RSA-OAEP encryption scheme is now supported
To use it with an unrestricted RSA private key, one would need to
initialize a gnutls_x509_spki_t object with necessary parameters
for RSA-OAEP and attach it to the private key. It is also possible
to import restricted private keys if they are stored in PKCS#8
format.
* libgnutls: Fix side-channel in the deterministic ECDSA.
Reported by George Pantelakis (#1516).
[GNUTLS-SA-2023-12-04, CVSS: medium] [bsc#1221746, CVE-2024-28834]
* libgnutls: Fixed a bug where certtool crashed when verifying a
certificate chain with more than 16 certificates. Reported by
William Woodruff (#1525) and yixiangzhike (#1527).
[GNUTLS-SA-2024-01-23, CVSS: medium] [bsc#1221747, CVE-2024-28835]
* libgnutls: Compression libraries are now loaded dynamically as needed
instead of all being loaded during gnutls library initialization.
As a result, the library initialization should be faster.
* build: The gnutls library can now be linked with the static library
of GMP. Note that in order for this to work libgmp.a needs to be
compiled with -fPIC and libhogweed in Nettle also has to be linked
to the static library of GMP. This can be used to prevent custom
memory allocators from being overriden by other applications.
* API and ABI modifications:
- gnutls_x509_spki_get_rsa_oaep_params: New function.
- gnutls_x509_spki_set_rsa_oaep_params: New function.
OBS-URL: https://build.opensuse.org/request/show/1161324
OBS-URL: https://build.opensuse.org/package/show/security:tls/gnutls?expand=0&rev=107
---
gnutls-3.8.3.tar.xz | 3 -
gnutls-3.8.3.tar.xz.sig | Bin 580 -> 0 bytes
gnutls-3.8.4.tar.xz | 3 +
gnutls-3.8.4.tar.xz.sig | Bin 0 -> 119 bytes
gnutls-FIPS-140-3-references.patch | 337 +++++++++---------
gnutls-FIPS-HMAC-nettle-hogweed-gmp.patch | 75 ++--
...ls-FIPS-jitterentropy-deinit-threads.patch | 34 ++
gnutls.changes | 41 +++
gnutls.spec | 4 +-
9 files changed, 296 insertions(+), 201 deletions(-)
delete mode 100644 gnutls-3.8.3.tar.xz
delete mode 100644 gnutls-3.8.3.tar.xz.sig
create mode 100644 gnutls-3.8.4.tar.xz
create mode 100644 gnutls-3.8.4.tar.xz.sig
create mode 100644 gnutls-FIPS-jitterentropy-deinit-threads.patch
diff --git a/gnutls-3.8.3.tar.xz b/gnutls-3.8.3.tar.xz
deleted file mode 100644
index e8cb6d8..0000000
--- a/gnutls-3.8.3.tar.xz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f74fc5954b27d4ec6dfbb11dea987888b5b124289a3703afcada0ee520f4173e
-size 6463720
diff --git a/gnutls-3.8.3.tar.xz.sig b/gnutls-3.8.3.tar.xz.sig
deleted file mode 100644
index 0531c45239d4089f12a61f514bbaf7de0dc943fc38f910e6c30f1f168abbecf9..0000000000000000000000000000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 580
zcmV-K0=xZ*0zm`-0SEvq79j*iA|=DLZ#0LW$VqJ01%!^*=9qB>0%fLFNDUlyWo~ak
zXKr;aZ*pe<3JDO_1%!^*=9qCZG!Oumhk1iC7LA9{Iy<5g(#DGjXTXi_n&%5^3HaA`nq+>Nkf;N5tpu}3YC4?iru^_7ZGMvgvWVfam#c7Dj
z?900PdDUORn8+DK?;i@j+CG0BB^;i7P8+L^Lgx!iS__Q}
zt8HQH|D6_=WxS(Olj6~m8;}k@w(r#e}Ee#4>&TA
zu*)T@vjrezg1%t}EehHXa#s+*h5RNb{TarM1*Oys~TvRKZ{9iCO*
zI5e^Cv6j(dWjcBK2+FZUhyf;5XpWJFnYT!ZN+MRatxOAwv2ax7=3)_-@^#W9Ws!~X
z^)o5VLqLJxe?Jn@v)@CXZOmLA;N4PfFcf*A_vhY1Dzfe{YyW#5lMgd7_LerpN|GsN
ztBKtacj#9%-(a?+WbD@`U+XTStM-6_`-vX=$T&WrO-5IIm@-~*5vzYPu+XGp1tnBk
zMz5s*0Eyw!7^8f{r{zWT
S*dtV_4{}u3XmHM}7d8#R5fjY-
diff --git a/gnutls-3.8.4.tar.xz b/gnutls-3.8.4.tar.xz
new file mode 100644
index 0000000..4194b4e
--- /dev/null
+++ b/gnutls-3.8.4.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2bea4e154794f3f00180fa2a5c51fe8b005ac7a31cd58bd44cdfa7f36ebc3a9b
+size 6487520
diff --git a/gnutls-3.8.4.tar.xz.sig b/gnutls-3.8.4.tar.xz.sig
new file mode 100644
index 0000000000000000000000000000000000000000000000000000000000000000..203aae422e8325243c282c862f3414c5f493bb5e98f8702dd7831673ee804100
GIT binary patch
literal 119
zcmeAuWnmEGVvrS6WQlb<&0l81x}4QC>`PVYGLOwam3Ua0Qh#o2X5iu!fQj_iFf#no
zb#R->|NCmBfz+y=2SW8ZJNg@6bKKhSrCmeqq;oSH!(WM5nQo8J=5M__ZcIC6^wHXL
UqT~1epP~zYh|RmDm_Cso06lCmjQ{`u
literal 0
HcmV?d00001
diff --git a/gnutls-FIPS-140-3-references.patch b/gnutls-FIPS-140-3-references.patch
index 526e342..c32f32e 100644
--- a/gnutls-FIPS-140-3-references.patch
+++ b/gnutls-FIPS-140-3-references.patch
@@ -1,7 +1,7 @@
-Index: gnutls-3.8.3/configure.ac
+Index: gnutls-3.8.4/configure.ac
===================================================================
---- gnutls-3.8.3.orig/configure.ac
-+++ gnutls-3.8.3/configure.ac
+--- gnutls-3.8.4.orig/configure.ac
++++ gnutls-3.8.4/configure.ac
@@ -623,19 +623,19 @@ LT_INIT([disable-static,win32-dll,shared
AC_LIB_HAVE_LINKFLAGS(dl,, [#include ], [dladdr (0, 0);])
@@ -25,10 +25,10 @@ Index: gnutls-3.8.3/configure.ac
AC_ARG_WITH(fips140-module-name, AS_HELP_STRING([--with-fips140-module-name],
[specify the FIPS140 module name]),
-Index: gnutls-3.8.3/doc/cha-gtls-app.texi
+Index: gnutls-3.8.4/doc/cha-gtls-app.texi
===================================================================
---- gnutls-3.8.3.orig/doc/cha-gtls-app.texi
-+++ gnutls-3.8.3/doc/cha-gtls-app.texi
+--- gnutls-3.8.4.orig/doc/cha-gtls-app.texi
++++ gnutls-3.8.4/doc/cha-gtls-app.texi
@@ -222,7 +222,7 @@ CPU. The currently available options are
@end itemize
@@ -38,10 +38,10 @@ Index: gnutls-3.8.3/doc/cha-gtls-app.texi
if set to one it will force the FIPS mode enablement.
@end multitable
-Index: gnutls-3.8.3/doc/cha-internals.texi
+Index: gnutls-3.8.4/doc/cha-internals.texi
===================================================================
---- gnutls-3.8.3.orig/doc/cha-internals.texi
-+++ gnutls-3.8.3/doc/cha-internals.texi
+--- gnutls-3.8.4.orig/doc/cha-internals.texi
++++ gnutls-3.8.4/doc/cha-internals.texi
@@ -14,7 +14,7 @@ happens inside the black box.
* TLS Hello Extension Handling::
* Cryptographic Backend::
@@ -162,11 +162,11 @@ Index: gnutls-3.8.3/doc/cha-internals.texi
operation. It can be attached to the current execution thread with
@funcref{gnutls_fips140_push_context} and its internal state will be
updated until it is detached with
-Index: gnutls-3.8.3/doc/enums.texi
+Index: gnutls-3.8.4/doc/enums.texi
===================================================================
---- gnutls-3.8.3.orig/doc/enums.texi
-+++ gnutls-3.8.3/doc/enums.texi
-@@ -1188,7 +1188,7 @@ application traffic secret is installed
+--- gnutls-3.8.4.orig/doc/enums.texi
++++ gnutls-3.8.4/doc/enums.texi
+@@ -1190,7 +1190,7 @@ application traffic secret is installed
@c gnutls_fips_mode_t
@table @code
@item GNUTLS_@-FIPS140_@-DISABLED
@@ -175,7 +175,7 @@ Index: gnutls-3.8.3/doc/enums.texi
@item GNUTLS_@-FIPS140_@-STRICT
The default mode; all forbidden operations will cause an
operation failure via error code.
-@@ -1196,8 +1196,8 @@ operation failure via error code.
+@@ -1198,8 +1198,8 @@ operation failure via error code.
A transient state during library initialization. That state
cannot be set or seen by applications.
@item GNUTLS_@-FIPS140_@-LAX
@@ -186,10 +186,10 @@ Index: gnutls-3.8.3/doc/enums.texi
application is aware of the followed security policy, and needs
to utilize disallowed operations for other reasons (e.g., compatibility).
@item GNUTLS_@-FIPS140_@-LOG
-Index: gnutls-3.8.3/doc/functions/gnutls_fips140_set_mode
+Index: gnutls-3.8.4/doc/functions/gnutls_fips140_set_mode
===================================================================
---- gnutls-3.8.3.orig/doc/functions/gnutls_fips140_set_mode
-+++ gnutls-3.8.3/doc/functions/gnutls_fips140_set_mode
+--- gnutls-3.8.4.orig/doc/functions/gnutls_fips140_set_mode
++++ gnutls-3.8.4/doc/functions/gnutls_fips140_set_mode
@@ -3,7 +3,7 @@
@@ -215,10 +215,10 @@ Index: gnutls-3.8.3/doc/functions/gnutls_fips140_set_mode
values for @code{mode} or to @code{GNUTLS_FIPS140_SELFTESTS} mode, the library
switches to @code{GNUTLS_FIPS140_STRICT} mode.
-Index: gnutls-3.8.3/doc/gnutls.html
+Index: gnutls-3.8.4/doc/gnutls.html
===================================================================
---- gnutls-3.8.3.orig/doc/gnutls.html
-+++ gnutls-3.8.3/doc/gnutls.html
+--- gnutls-3.8.4.orig/doc/gnutls.html
++++ gnutls-3.8.4/doc/gnutls.html
@@ -484,7 +484,7 @@ Documentation License”.
11.4 TLS Extension Handling
11.5 Cryptographic Backend
@@ -228,7 +228,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
Appendix A Upgrading from previous versions
Appendix B Support
-@@ -9035,7 +9035,7 @@ CPU. The currently available options are
+@@ -9041,7 +9041,7 @@ CPU. The currently available options are
0x200000: Enable VIA PHE
0x400000: Enable VIA PHE SHA512
@@ -237,7 +237,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
if set to one it will force the FIPS mode enablement.
-@@ -18446,7 +18446,7 @@ None:
+@@ -18452,7 +18452,7 @@ None:
--inline-commands-prefix=str Change the default delimiter for inline commands
--provider=file Specify the PKCS #11 provider library
- file must pre-exist
@@ -246,7 +246,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
--list-config Reports the configuration of the library
--logfile=str Redirect informational messages to a specific file
--keymatexport=str Label used for exporting keying material
-@@ -19468,7 +19468,7 @@ happens inside the black box.
+@@ -19474,7 +19474,7 @@ happens inside the black box.
TLS Extension Handling
Cryptographic Backend
Random Number Generators
@@ -255,7 +255,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
@@ -302,7 +302,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
as follows.
-@@ -20166,12 +20166,12 @@ as follows.
+@@ -20172,12 +20172,12 @@ as follows.
- Algorithm self-tests are run on library load
@@ -318,7 +318,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
Any cryptographic operation will be refused if any of the self-tests failed
-@@ -20180,7 +20180,7 @@ modified as follows.
+@@ -20186,7 +20186,7 @@ modified as follows.
environment variable GNUTLS_SKIP_FIPS_INTEGRITY_CHECKS
will disable
the library integrity tests on startup, and the variable
GNUTLS_FORCE_FIPS_MODE
can be set to force a value from
@@ -327,7 +327,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
mode, while ’0’ will disable it.
The integrity checks for the dependent libraries and GnuTLS are performed
-@@ -20188,13 +20188,13 @@ using ’.hmac’ files which ar
+@@ -20194,13 +20194,13 @@ using ’.hmac’ files which ar
key for the operations can be provided on compile-time with the configure
option ’–with-fips140-key’. The MAC algorithm used is HMAC-SHA256.
@@ -344,7 +344,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
the application can relax these requirements via gnutls_fips140_set_mode
which can switch to alternative modes as in Figure 11.5.
-@@ -20203,7 +20203,7 @@ which can switch to alternative modes as
+@@ -20209,7 +20209,7 @@ which can switch to alternative modes as
GNUTLS_FIPS140_DISABLED
@@ -353,7 +353,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
GNUTLS_FIPS140_STRICT
The default mode; all forbidden operations will cause an
-@@ -20214,8 +20214,8 @@ operation failure via error code.
+@@ -20220,8 +20220,8 @@ operation failure via error code.
cannot be set or seen by applications.
GNUTLS_FIPS140_LAX
@@ -364,7 +364,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
application is aware of the followed security policy, and needs
to utilize disallowed operations for other reasons (e.g., compatibility).
-@@ -20227,7 +20227,7 @@ to a message to the audit callback funct
+@@ -20233,7 +20233,7 @@ to a message to the audit callback funct
Figure 11.5: The gnutls_fips_mode_t
enumeration.
The intention of this API is to be used by applications which may run in
@@ -373,7 +373,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
e.g., for non-security related purposes. In these cases applications should
wrap the non-compliant code within blocks like the following.
-@@ -20256,9 +20256,9 @@ if (gnutls_fips140_mode_enabled())
+@@ -20262,9 +20262,9 @@ if (gnutls_fips140_mode_enabled())
The reason of the GNUTLS_FIPS140_SET_MODE_THREAD
flag in the
previous calls is to localize the change in the mode. Note also, that
such a block has no effect when the library is not operating
@@ -385,7 +385,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
gnutls_fips140_set_mode(GNUTLS_FIPS140_LAX, 0);
-@@ -20281,7 +20281,7 @@ performed within a given context.
+@@ -20287,7 +20287,7 @@ performed within a given context.
int gnutls_fips140_pop_context ( void)
@@ -394,7 +394,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
operation. It can be attached to the current execution thread with
gnutls_fips140_push_context and its internal state will be
updated until it is detached with
-@@ -20654,8 +20654,8 @@ Previous:
@@ -405,7 +405,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
-@@ -24569,7 +24569,7 @@ unusable. This function is not thread-s
+@@ -24576,7 +24576,7 @@ unusable. This function is not thread-s
gnutls_fips140_set_mode
- Function:
void
gnutls_fips140_set_mode (gnutls_fips_mode_t mode, unsigned flags)
¶
@@ -414,7 +414,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
flags: should be zero or GNUTLS_FIPS140_SET_MODE_THREAD
-@@ -24578,13 +24578,13 @@ unusable. This function is not thread-s
+@@ -24585,13 +24585,13 @@ unusable. This function is not thread-s
behavior with no flags after threads are created is undefined.
When the flag GNUTLS_FIPS140_SET_MODE_THREAD
is specified
@@ -430,7 +430,7 @@ Index: gnutls-3.8.3/doc/gnutls.html
values for mode
or to GNUTLS_FIPS140_SELFTESTS
mode, the library
switches to GNUTLS_FIPS140_STRICT
mode.
-@@ -46927,7 +46927,7 @@ Next: | gnutls_fingerprint : | | Core TLS API |
| gnutls_fips140_context_deinit : | | Core TLS API |
| gnutls_fips140_context_init : | | Core TLS API |
@@ -439,10 +439,10 @@ Index: gnutls-3.8.3/doc/gnutls.html
| gnutls_fips140_get_operation_state : | | Core TLS API |
| gnutls_fips140_mode_enabled : | | Core TLS API |
| gnutls_fips140_pop_context : | | Core TLS API |
-Index: gnutls-3.8.3/doc/gnutls.info-3
+Index: gnutls-3.8.4/doc/gnutls.info-3
===================================================================
---- gnutls-3.8.3.orig/doc/gnutls.info-3
-+++ gnutls-3.8.3/doc/gnutls.info-3
+--- gnutls-3.8.4.orig/doc/gnutls.info-3
++++ gnutls-3.8.4/doc/gnutls.info-3
@@ -2247,7 +2247,7 @@ to ‘more’. Both will exit with a st
--inline-commands-prefix=str Change the default delimiter for inline commands
--provider=file Specify the PKCS #11 provider library
@@ -512,7 +512,7 @@ Index: gnutls-3.8.3/doc/gnutls.info-3
File: gnutls.info, Node: Error codes, Next: Supported ciphersuites, Prev: Support, Up: Top
-@@ -9151,7 +9151,7 @@ gnutls_fips140_set_mode
+@@ -9152,7 +9152,7 @@ gnutls_fips140_set_mode
-- Function: void gnutls_fips140_set_mode (gnutls_fips_mode_t MODE,
unsigned FLAGS)
@@ -521,10 +521,10 @@ Index: gnutls-3.8.3/doc/gnutls.info-3
FLAGS: should be zero or ‘GNUTLS_FIPS140_SET_MODE_THREAD’
-Index: gnutls-3.8.3/doc/invoke-gnutls-cli.texi
+Index: gnutls-3.8.4/doc/invoke-gnutls-cli.texi
===================================================================
---- gnutls-3.8.3.orig/doc/invoke-gnutls-cli.texi
-+++ gnutls-3.8.3/doc/invoke-gnutls-cli.texi
+--- gnutls-3.8.4.orig/doc/invoke-gnutls-cli.texi
++++ gnutls-3.8.4/doc/invoke-gnutls-cli.texi
@@ -102,7 +102,7 @@ None:
--inline-commands-prefix=str Change the default delimiter for inline commands
--provider=file Specify the PKCS #11 provider library
@@ -534,10 +534,10 @@ Index: gnutls-3.8.3/doc/invoke-gnutls-cli.texi
--list-config Reports the configuration of the library
--logfile=str Redirect informational messages to a specific file
--keymatexport=str Label used for exporting keying material
-Index: gnutls-3.8.3/doc/manpages/gnutls-cli.1
+Index: gnutls-3.8.4/doc/manpages/gnutls-cli.1
===================================================================
---- gnutls-3.8.3.orig/doc/manpages/gnutls-cli.1
-+++ gnutls-3.8.3/doc/manpages/gnutls-cli.1
+--- gnutls-3.8.4.orig/doc/manpages/gnutls-cli.1
++++ gnutls-3.8.4/doc/manpages/gnutls-cli.1
@@ -398,7 +398,7 @@ Specify the PKCS #11 provider library.
This will override the default options in /etc/gnutls/pkcs11.conf
.TP
@@ -547,10 +547,10 @@ Index: gnutls-3.8.3/doc/manpages/gnutls-cli.1
.sp
.TP
.NOP \f\*[B-Font]\-\-list\-config\f[]
-Index: gnutls-3.8.3/doc/reference/html/gnutls-gnutls.html
+Index: gnutls-3.8.4/doc/reference/html/gnutls-gnutls.html
===================================================================
---- gnutls-3.8.3.orig/doc/reference/html/gnutls-gnutls.html
-+++ gnutls-3.8.3/doc/reference/html/gnutls-gnutls.html
+--- gnutls-3.8.4.orig/doc/reference/html/gnutls-gnutls.html
++++ gnutls-3.8.4/doc/reference/html/gnutls-gnutls.html
@@ -20866,12 +20866,12 @@ gnutls_fips140_set_mode (
-@@ -25904,7 +25904,7 @@ encryption
+@@ -25911,7 +25911,7 @@ encryption
enum gnutls_fips_mode_t
@@ -584,7 +584,7 @@ Index: gnutls-3.8.3/doc/reference/html/gnutls-gnutls.html