]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
3 years agofix get credential type with key exchange algorithm fail
xuraoqing [Mon, 12 Dec 2022 07:05:20 +0000 (15:05 +0800)] 
fix get credential type with key exchange algorithm fail

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
3 years agoUse soname instead of file name in fipshmac sections
Zoltan Fridrich [Fri, 2 Dec 2022 12:12:30 +0000 (13:12 +0100)] 
Use soname instead of file name in fipshmac sections

Using fipshmac program with an argument, for example:
fipshmac /usr/lib64/libgnutls.so.30.28.1
would create a section [libgnutls.so.30.28.1]
and the internal comparison with soname would fail.

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoMerge branch 'wip/dueno/memleak-fixes' into 'master'
Daiki Ueno [Wed, 7 Dec 2022 10:13:52 +0000 (10:13 +0000)] 
Merge branch 'wip/dueno/memleak-fixes' into 'master'

Fix memory leaks in tools and tests

Closes #1433 and #1430

See merge request gnutls/gnutls!1672

3 years agoMerge branch 'fix/ktls_fallback' into 'master'
František Krenželok [Tue, 6 Dec 2022 14:26:17 +0000 (14:26 +0000)] 
Merge branch 'fix/ktls_fallback' into 'master'

KTLS: Invalidate session on ktls error

See merge request gnutls/gnutls!1664

3 years agoKTLS: Invalidate session on ktls error
Frantisek Krenzelok [Mon, 31 Oct 2022 11:17:43 +0000 (12:17 +0100)] 
KTLS: Invalidate session on ktls error

We invalidate the session if an KTLS related error occurs after it was
initialized i.e. keys were set on the interfaces.

As of now this only affects key_update() which should be fixed via a
kernel patch. Thus future fallback mechanism implementation is not likely
as that would require yet another kernel patch.

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoMerge branch 'ktls_ciphersuites' into 'master'
František Krenželok [Sat, 3 Dec 2022 18:10:55 +0000 (18:10 +0000)] 
Merge branch 'ktls_ciphersuites' into 'master'

KTLS: additional ciphersuites

See merge request gnutls/gnutls!1676

3 years agoKTLS: add ciphersuites (tests)
Frantisek Krenzelok [Fri, 2 Dec 2022 10:07:48 +0000 (11:07 +0100)] 
KTLS: add ciphersuites (tests)

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoKTLS: add ciphersuites
Frantisek Krenzelok [Thu, 1 Dec 2022 14:37:33 +0000 (15:37 +0100)] 
KTLS: add ciphersuites

* TLS_AES_128_CCM_SHA256
* TLS_CHACHA20_POLY1305_SHA256

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoMerge branch 'wip/dueno/fipshmac-followup2' into 'master'
Daiki Ueno [Wed, 30 Nov 2022 15:16:49 +0000 (15:16 +0000)] 
Merge branch 'wip/dueno/fipshmac-followup2' into 'master'

fips: rename .gnutls.hmac back to .libgnutls.so.*.hmac

Closes #1435

See merge request gnutls/gnutls!1674

3 years agofips: rename .gnutls.hmac back to .libgnutls.so.*.hmac
Daiki Ueno [Tue, 29 Nov 2022 02:15:34 +0000 (11:15 +0900)] 
fips: rename .gnutls.hmac back to .libgnutls.so.*.hmac

Using a GnuTLS specific construction of .hmac file name causes a
problem with dracut, which expects that .hmac files are installed
alongside the corresponding shared libraries.

To preserve backward compatibility, this renames the file name back to
.libgnutls.so.*.hmac, while the content remains the same covering all
the dependent libraries (libgnutls, libhogweed, libnettle, and
libgmp).

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/ktls-fixes2' into 'master'
Daiki Ueno [Wed, 30 Nov 2022 10:44:50 +0000 (10:44 +0000)] 
Merge branch 'wip/dueno/ktls-fixes2' into 'master'

Minor fixes on KTLS

Closes #1382

See merge request gnutls/gnutls!1673

3 years agoMerge branch 'wip/dueno/gnulib' into 'master'
Daiki Ueno [Mon, 28 Nov 2022 14:48:40 +0000 (14:48 +0000)] 
Merge branch 'wip/dueno/gnulib' into 'master'

gnulib: update git submodule

See merge request gnutls/gnutls!1509

3 years agopriority: accept "ktls = false" in configuration file
Daiki Ueno [Mon, 28 Nov 2022 03:15:26 +0000 (12:15 +0900)] 
priority: accept "ktls = false" in configuration file

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agosrc: print KTLS enablement status in gnutls-serv/gnutls-cli
Daiki Ueno [Mon, 28 Nov 2022 03:13:31 +0000 (12:13 +0900)] 
src: print KTLS enablement status in gnutls-serv/gnutls-cli

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoincludes: move KTLS function definition out of <gnutls/socket.h>
Daiki Ueno [Mon, 28 Nov 2022 03:17:12 +0000 (12:17 +0900)] 
includes: move KTLS function definition out of <gnutls/socket.h>

<gnutls/socket.h> is meant for the functions that depend on
<sys/socket.h>, which is not available on Windows platforms.

As the KTLS API doesn't rely on <sys/socket.h>, move the function and
enum to <gnutls/gnutls.h>.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotests: fix memory leak in resume-with-previous-stek
Daiki Ueno [Mon, 28 Nov 2022 02:14:53 +0000 (11:14 +0900)] 
tests: fix memory leak in resume-with-previous-stek

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agosrc: fix memory leak in print_rawpk_info
Daiki Ueno [Mon, 28 Nov 2022 02:10:58 +0000 (11:10 +0900)] 
src: fix memory leak in print_rawpk_info

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years ago.gitlab-ci.yml: disable full test suite in fedora-nettle jobs
Daiki Ueno [Wed, 23 Nov 2022 06:38:25 +0000 (15:38 +0900)] 
.gitlab-ci.yml: disable full test suite in fedora-nettle jobs

This adds --disable-full-test-suite to fedora-nettle jobs, assuming
other tests have enough coverage of what Nettle provides.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agobuild: pacify sc_unportable_grep_q check
Daiki Ueno [Tue, 22 Nov 2022 04:01:58 +0000 (13:01 +0900)] 
build: pacify sc_unportable_grep_q check

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years ago.gitlab-ci.yml: disable GCC analyzer in sanitizer jobs
Daiki Ueno [Tue, 22 Nov 2022 03:20:58 +0000 (12:20 +0900)] 
.gitlab-ci.yml: disable GCC analyzer in sanitizer jobs

It turned out that -fanalyzer combined with -fsanitize=undefined takes
excessive time when compiling certain files, e.g., lib/priority.c.
Removing -fanalyzer should be safe as it is enabled in other
Fedora-based jobs.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agobuild: suppress GCC analyzer warnings
Daiki Ueno [Thu, 6 Oct 2022 09:44:48 +0000 (18:44 +0900)] 
build: suppress GCC analyzer warnings

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotests: skip tpm2.sh test for now if OpenSSL version 3 is detected
Daiki Ueno [Wed, 5 Oct 2022 08:44:01 +0000 (17:44 +0900)] 
tests: skip tpm2.sh test for now if OpenSSL version 3 is detected

tpm2-tss-engine does not work well with OpenSSL 3 yet.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years ago.gitlab-ci.yml: bump cache version
Daiki Ueno [Fri, 30 Sep 2022 06:52:41 +0000 (15:52 +0900)] 
.gitlab-ci.yml: bump cache version

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years ago.gitlab-ci.yml: update fedora image to Fedora 36
Daiki Ueno [Tue, 27 Sep 2022 04:13:21 +0000 (13:13 +0900)] 
.gitlab-ci.yml: update fedora image to Fedora 36

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotests: move <assert.h> out of extern "C"
Daiki Ueno [Mon, 26 Sep 2022 07:48:24 +0000 (16:48 +0900)] 
tests: move <assert.h> out of extern "C"

This fixes the issue with <assert.h> provided by Gnulib:

 ../gl/assert.h:209:1: error: template with C linkage
   209 | template <int w>
       | ^~~~~~~~

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agobuild: use AM_DISTCHECK_CONFIGURE_FLAGS
Daiki Ueno [Mon, 26 Sep 2022 07:46:47 +0000 (16:46 +0900)] 
build: use AM_DISTCHECK_CONFIGURE_FLAGS

Also remove AUTOGEN=false setting, which is no longer necessary.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years ago.gitlab-ci.yml: update mingw image to Fedora 36
Daiki Ueno [Sat, 24 Sep 2022 20:36:49 +0000 (05:36 +0900)] 
.gitlab-ci.yml: update mingw image to Fedora 36

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agogl: add workaround for mingw32 build
Daiki Ueno [Mon, 26 Sep 2022 06:40:55 +0000 (15:40 +0900)] 
gl: add workaround for mingw32 build

This reverts __MINGW_USE_VC2005_COMPAT setting that causes undesired
effects, as mentioned in:
https://lists.gnu.org/archive/html/bug-gnulib/2022-09/msg00150.html

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agognulib: update git submodule
Daiki Ueno [Sat, 8 Jan 2022 17:14:16 +0000 (18:14 +0100)] 
gnulib: update git submodule

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/rsa-pss-saltlen' into 'master'
Daiki Ueno [Mon, 21 Nov 2022 23:58:21 +0000 (23:58 +0000)] 
Merge branch 'wip/dueno/rsa-pss-saltlen' into 'master'

nettle: mark non-compliant RSA-PSS salt length to be not-approved

See merge request gnutls/gnutls!1669

3 years agonettle: mark non-compliant RSA-PSS salt length to be not-approved
Daiki Ueno [Wed, 16 Nov 2022 14:02:13 +0000 (23:02 +0900)] 
nettle: mark non-compliant RSA-PSS salt length to be not-approved

According to FIPS 186-5 5.4, the salt length must be in the range
between 0 and the hash length inclusive.  While the use of those salt
lengths is still allowed for compatibility, it is reported as
non-approved operation through FIPS service indicator.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'SIGPIPE' into 'master'
Daiki Ueno [Wed, 16 Nov 2022 18:01:34 +0000 (18:01 +0000)] 
Merge branch 'SIGPIPE' into 'master'

tests: More SIGPIPE treatment as error

See merge request gnutls/gnutls!1668

3 years agotests: More SIGPIPE treatment as error
Samuel Thibault [Wed, 16 Nov 2022 00:38:54 +0000 (00:38 +0000)] 
tests: More SIGPIPE treatment as error

81f8d97b3486 ("tests: treat all signals as error") turned some SIGPIPE signals
to EPIPE, but missed tests/mini-dtls-mtu.c.

During

gnutls_bye(session, GNUTLS_SHUT_WR),

on Linux we get

client|<11>| WRITE: enqueued 39 bytes for 0x3. Total 39 bytes.
client|<11>| WRITE FLUSH: 39 bytes in buffer.
client|<2>| WRITE: -1 returned from 0x3, errno: 111
(ECONNREFUSED)

but on GNU/Hurd a SIGPIPE is sent instead of returning of ECONNREFUSED.
We thus need to turn it into an error to correctly interpret the test
result.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
3 years agoMerge branch 'zfridric_devel' into 'master'
Zoltán Fridrich [Tue, 15 Nov 2022 16:06:15 +0000 (16:06 +0000)] 
Merge branch 'zfridric_devel' into 'master'

Adjust FIPS integrity check

Closes #1426

See merge request gnutls/gnutls!1666

3 years agoRemove library path checking from FIPS integrity check
Zoltan Fridrich [Tue, 15 Nov 2022 13:35:24 +0000 (14:35 +0100)] 
Remove library path checking from FIPS integrity check

The library path check is being dropped as checking the HMAC of
libraries should be sufficient. Checking the exact path where the
library resides showed to be failure prone. The sonames of libraries are
internally indirectly compared.

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoFipshmac: always use realpaths
Zoltan Fridrich [Wed, 9 Nov 2022 15:10:58 +0000 (16:10 +0100)] 
Fipshmac: always use realpaths

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoMerge branch 'wip/dueno/rehandshake-tickets' into 'master'
Zoltán Fridrich [Tue, 15 Nov 2022 12:01:19 +0000 (12:01 +0000)] 
Merge branch 'wip/dueno/rehandshake-tickets' into 'master'

handshake: clear server's session ticket indication at rehandshake

Closes #1421

See merge request gnutls/gnutls!1663

3 years agohandshake: clear server's session ticket indication at rehandshake
Daiki Ueno [Mon, 31 Oct 2022 11:15:48 +0000 (20:15 +0900)] 
handshake: clear server's session ticket indication at rehandshake

While OpenSSL server doesn't indicate a session ticket in the second
handshake of TLS 1.2 rehandshake, GnuTLS client previously waited for
it as it didn't clear the internal flag (session_ticket_renew) thus
the effect remained.  This patch clears the flag properly at the end
of each handshake.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'master' into 'master'
Daiki Ueno [Thu, 3 Nov 2022 08:37:02 +0000 (08:37 +0000)] 
Merge branch 'master' into 'master'

gnutls_init: Always initialize *session

See merge request gnutls/gnutls!1652

3 years agopriority: fix typos in documentation
Eric Blake [Thu, 13 Oct 2022 22:21:21 +0000 (17:21 -0500)] 
priority: fix typos in documentation

Fixes: ac2751d8049bf97cf486469d3c3407b83dd1fb3c
Signed-off-by: Eric Blake <eblake@redhat.com>
3 years agopriority: Use gnutls_free consistently
Eric Blake [Fri, 14 Oct 2022 19:02:14 +0000 (14:02 -0500)] 
priority: Use gnutls_free consistently

The whole point of gnutls_calloc() is to allow an alternative to
malloc() where that alternative takes over all aspects of heap
management; as such, it is never safe to pair bare free() with memory
managed by gnutls.  Not to mention that it looks bad to mix calls to
gnutls_free() and free() to the same variable within the same
function.

Signed-off-by: Eric Blake <eblake@redhat.com>
3 years agoprivkey: Allow deinit after failed export
Eric Blake [Wed, 2 Nov 2022 13:48:19 +0000 (08:48 -0500)] 
privkey: Allow deinit after failed export

The documentation for gnutls_privkey_export_* states that the caller
must use gnutls_*_deinit on key, without mentioning whether this
requirement is still present when the function fails.  But the
implementation has a code path where key is left uninitialized.
Similar to the recent fix for *_init, guarantee that *key is set to a
sane value on all exit paths.

Signed-off-by: Eric Blake <eblake@redhat.com>
3 years agolib: Consistenly return sane results for all *_init()
Eric Blake [Fri, 14 Oct 2022 18:40:50 +0000 (13:40 -0500)] 
lib: Consistenly return sane results for all *_init()

After looking at gnutls_init(), I went and audited all other
*_init(gnutls_*_t) functions, to see if Bug #1414 applies in more
situations.  We had an inconsistent mix: some functions that went out
of their way to leave the parameter uninitialized on failure (such as
gnutls_x509_crt_init()); many that always left the parameter
initialized on failure (such as gnutls_x509_ext_ct_scts_init()), often
by relying on the gnutls_free() macro that assigns the pointer to NULL
after using the gnutls_free_function() callback pointer (such as
gnutls_pkcs11_obj_init()); but a few others that left stale pointers
on certain failures (such as gnutls_priority_init2()) or even which
used the wrong deallocation function (such as
gnutls_pkcs11_privkey_init()).

As with gnutls_init(), portable programs should either pre-initialize
memory to zero before calling _init() if they plan to unconditionally
call _deinit() (safe for all but gnutls_pkcs11_privkey_init()), or
they should avoid calling _deinit() if _init() failed.  But since we
can't force all existing clients to change, it is safest if we
unconditionally and consistently initialize the client's memory before
ALL failure paths.

Rather than try to adjust documentation of each *_init() function
(including those not needing a change), I instead generalized
documentation into the manual.

Signed-off-by: Eric Blake <eblake@redhat.com>
3 years agognutls_init: Always initialize *session
Eric Blake [Thu, 13 Oct 2022 19:07:29 +0000 (14:07 -0500)] 
gnutls_init: Always initialize *session

We provide gnutls_session_t as an opaque type, therefore, unless we
document otherwise, client code should not assume that there is a safe
initialization value to assign to such storage, leaving the only way
to properly initialize the type as a call to gnutls_init().  Likewise,
the documentation was clear that gnutls_deinit(session) must be used
after success, but ambiguous as to whether that was necessary after
failure.

Our implementation has always been such that the opaque types are
pointers under the hood, where gnutls_deinit(NULL) is a no-op, and
that (for gnutls_init at least) it is safe to omit a call to
gnutls_deinit(session) on failure.  But without documentation, clients
cannot rely on either of those facts; and our code base was
inconsistent on whether all other *_init/*_deinit function pairs
behave in the same manner (see the next commit).

A search of existing code in the wild shows that some clients
pre-initialize the memory to 0 (which happens to be safe although
currently undocumented), often by passing in a pointer to a
gnutls_session_t residing in a larger struct that was reserved with
calloc(), cleared with memset(), or similar; but this is not
universal, and there are other clients in the wild that pass in
uninitialized memory.  It's too late to change the documentation to
mandate that users should pre-initialize their memory to 0 prior to
gnutls_init(), although it doesn't hurt to recommend it for
portability when building for older versions of gnutls.

In most cases, using gnutls_deinit(session) after failure was a no-op
- most of our error exit paths use the gnutls_free() macro which has
the side effect of forcing the caller's pointer to NULL on failure
(since gnutls is built with GNUTLS_INTERNAL_BUILD defined).  We also
happen to be lucky for a user that pre-initializes their memory to 0
before calling gnutls_init() - any error exit path where we did not
touch the user's pointer leaves the client with gnutls_deinit(session)
being a no-op.  But if the client passes in an uninitialized pointer,
and FAIL_IF_LIB_ERROR triggers, then we fail the function while
leaving the pointer uninitialized, at which point the caller using
gnutls_deinit(session) attempts to free uninitialized memory, which
has potential security implications - yet we did not warn the client
to avoid gnutls_deinit() in that scenario.

The most robust fix is thus along two fronts: improving the
documentation to inform the user what they can expect, but also
tweaking our code to avoid undefined behavior with existing client
code bases by guaranteeing that whether or not the client
pre-initializes memory to 0 and/or calls gnutls_deinit() on failure,
they can't mess up.

Fixes: bug #1414.
Signed-off-by: Eric Blake <eblake@redhat.com>
3 years agobuild: Silence cppcheck false positive
Eric Blake [Wed, 2 Nov 2022 13:40:08 +0000 (08:40 -0500)] 
build: Silence cppcheck false positive

An upcoming patch will touch gnutls_pkcs11_privkey_init(), which is
sufficient to make the cppcheck portion of CI choke on a false
positive in the unrelated gnutls_pkcs11_privkey_import_url() because
the file becomes interesting again.  cppcheck is not smart enough to
realize that an out-of-scope memory reference stored in a[1] is not
going to be utilized by the later pkcs11_get_attribute_value(..., a,
1) outside the if block; but the solution is as simple as expanding
the scope of tval.

Signed-off-by: Eric Blake <eblake@redhat.com>
3 years agoMerge branch 'jas/drop-announcetxt' into 'master'
Simon Josefsson [Wed, 2 Nov 2022 08:31:00 +0000 (08:31 +0000)] 
Merge branch 'jas/drop-announcetxt' into 'master'

Drop stale doc/announce.txt.

See merge request gnutls/gnutls!1665

3 years agoMerge branch 'wip/dek-info' into 'master'
Daiki Ueno [Wed, 2 Nov 2022 06:55:59 +0000 (06:55 +0000)] 
Merge branch 'wip/dek-info' into 'master'

Handle private keys with lowercase hex digits in DEK-Info

Closes #1415

See merge request gnutls/gnutls!1655

3 years agoHandle private keys with lowercase hex digits in DEK-Info
Tim Kosse [Fri, 14 Oct 2022 13:51:28 +0000 (15:51 +0200)] 
Handle private keys with lowercase hex digits in DEK-Info

Some tools, for example win-acme, create encrypted private keys in OpenSSL's
traditional format containing lowercase hex digits in the IV part of the
DEK-Info PEM header. These key files are accepted by OpenSSL. Prior to this
patch, GnuTLS did reject these keys with GNUTLS_E_INVALID_REQUEST.

Signed-off-by: Tim Kosse <tim.kosse@filezilla-project.org>
Co-authored-by: Daiki Ueno <ueno@gnu.org>
3 years agoDrop stale doc/announce.txt.
Simon Josefsson [Mon, 31 Oct 2022 20:24:01 +0000 (21:24 +0100)] 
Drop stale doc/announce.txt.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
3 years agoMerge branch 'jas/drop-guile' into 'master'
Simon Josefsson [Mon, 31 Oct 2022 20:20:46 +0000 (20:20 +0000)] 
Merge branch 'jas/drop-guile' into 'master'

Drop guile bindings.  See <https://gitlab.com/gnutls/guile/>.

See merge request gnutls/gnutls!1651

3 years agoMerge branch 'zfridric_devel3' into 'master'
Zoltán Fridrich [Mon, 31 Oct 2022 10:38:07 +0000 (10:38 +0000)] 
Merge branch 'zfridric_devel3' into 'master'

Fix removal of duplicate certs during verification

Closes #1335

See merge request gnutls/gnutls!1653

3 years agoFix removal of duplicate certs during verification
Zoltan Fridrich [Mon, 17 Oct 2022 13:27:37 +0000 (15:27 +0200)] 
Fix removal of duplicate certs during verification

Co-authored-by: Daiki Ueno <ueno@gnu.org>
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoDrop guile bindings. See <https://gitlab.com/gnutls/guile/>.
Simon Josefsson [Wed, 12 Oct 2022 13:02:35 +0000 (15:02 +0200)] 
Drop guile bindings.  See <https://gitlab.com/gnutls/guile/>.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
3 years agoMerge branch 'zfridric_devel' into 'master'
Zoltán Fridrich [Wed, 26 Oct 2022 10:06:28 +0000 (10:06 +0000)] 
Merge branch 'zfridric_devel' into 'master'

Fix handshake segfault if no privkey is supplied

Closes #1412

See merge request gnutls/gnutls!1657

3 years agoMerge branch 'zfridric_devel2' into 'master'
Zoltán Fridrich [Wed, 26 Oct 2022 07:53:26 +0000 (07:53 +0000)] 
Merge branch 'zfridric_devel2' into 'master'

Ignore unknown algorithms received in compress_certificate extension

Closes #1416

See merge request gnutls/gnutls!1660

3 years agoMerge branch 'jas/update-libtasn1' into 'master'
Daiki Ueno [Wed, 26 Oct 2022 02:44:12 +0000 (02:44 +0000)] 
Merge branch 'jas/update-libtasn1' into 'master'

Update libtasn1 to 4.19.0.

See merge request gnutls/gnutls!1661

3 years agodoc: Add NEWS entry.
Simon Josefsson [Tue, 25 Oct 2022 12:46:30 +0000 (14:46 +0200)] 
doc: Add NEWS entry.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
3 years agoUpdate libtasn1 to 4.19.0.
Simon Josefsson [Tue, 25 Oct 2022 12:45:29 +0000 (14:45 +0200)] 
Update libtasn1 to 4.19.0.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
3 years agoMerge branch 'wip/dueno/ccm-tlen' into 'master'
Daiki Ueno [Tue, 25 Oct 2022 10:07:03 +0000 (10:07 +0000)] 
Merge branch 'wip/dueno/ccm-tlen' into 'master'

cipher: add restriction on CCM tag length under FIPS mode

See merge request gnutls/gnutls!1658

3 years agocipher: add restriction on CCM tag length under FIPS mode
Daiki Ueno [Fri, 21 Oct 2022 06:48:39 +0000 (15:48 +0900)] 
cipher: add restriction on CCM tag length under FIPS mode

This change prohibits any use of tag length other than 4, 6, 8, 10,
12, 14, and 16 bytes in CCM used under FIPS mode, in accordance with
SP800-38C A.1.  While use of tag lengths smaller than 8 bytes is not
recommended, we simply allow 4 and 6 bytes tags for now.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agocompress_certificate: fix err code on invalid length
Zoltan Fridrich [Mon, 24 Oct 2022 09:01:44 +0000 (11:01 +0200)] 
compress_certificate: fix err code on invalid length

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoIgnore unknown algorithms received in compress_certificate extension
Zoltan Fridrich [Fri, 21 Oct 2022 09:19:56 +0000 (11:19 +0200)] 
Ignore unknown algorithms received in compress_certificate extension

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoMerge branch 'wip/dueno/git-authors' into 'master'
Daiki Ueno [Fri, 21 Oct 2022 22:40:53 +0000 (22:40 +0000)] 
Merge branch 'wip/dueno/git-authors' into 'master'

build: fix AUTHORS generation

Closes #1409

See merge request gnutls/gnutls!1659

3 years agobuild: fix AUTHORS generation
Daiki Ueno [Fri, 21 Oct 2022 09:12:33 +0000 (18:12 +0900)] 
build: fix AUTHORS generation

Without revision supplied, git shortlog expects to read commits from
stdin and produces the following error:

    GEN      AUTHORS
  fatal: using multiple --group options with stdin is not supported

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoFix handshake segfault if no privkey is supplied
Zoltan Fridrich [Thu, 20 Oct 2022 10:38:39 +0000 (12:38 +0200)] 
Fix handshake segfault if no privkey is supplied

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoMerge branch 'zfridric_devel2' into 'master'
Zoltán Fridrich [Wed, 19 Oct 2022 16:06:34 +0000 (16:06 +0000)] 
Merge branch 'zfridric_devel2' into 'master'

gnutls_rnd manage memory per-thread

Closes #1401

See merge request gnutls/gnutls!1647

3 years agognutls_rnd manage memory per-thread
Zoltan Fridrich [Fri, 23 Sep 2022 10:59:52 +0000 (12:59 +0200)] 
gnutls_rnd manage memory per-thread

Co-authored-by: Pedro Marzo <marzo.pedro@gmail.com>
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoMerge branch 'zfridric_devel' into 'master'
Zoltán Fridrich [Tue, 18 Oct 2022 12:30:14 +0000 (12:30 +0000)] 
Merge branch 'zfridric_devel' into 'master'

Add NO_STATUS_REQUEST priority string modifier

Closes #1378

See merge request gnutls/gnutls!1650

3 years agoAdd GNUTLS_NO_STATUS_REQUEST flag and NO_STATUS_REQUEST priority string modifier
Zoltan Fridrich [Tue, 4 Oct 2022 14:37:29 +0000 (16:37 +0200)] 
Add GNUTLS_NO_STATUS_REQUEST flag and NO_STATUS_REQUEST priority string modifier

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoMerge branch 'wip/dueno/symkey-limit' into 'master'
Daiki Ueno [Mon, 17 Oct 2022 12:29:17 +0000 (12:29 +0000)] 
Merge branch 'wip/dueno/symkey-limit' into 'master'

fips: mark symmetric key crypto operations with short key and output sizes non-approved

See merge request gnutls/gnutls!1643

3 years agofips: only mark HMAC as approved in PBKDF2
Daiki Ueno [Thu, 29 Sep 2022 12:19:26 +0000 (21:19 +0900)] 
fips: only mark HMAC as approved in PBKDF2

As ACVP only allows HMAC used with PBKDF2[1], this change marks other
hash algorithms not-approved.

1. https://pages.nist.gov/ACVP/draft-celi-acvp-pbkdf.html

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agofips: mark gnutls_key_generate with short key sizes non-approved
Daiki Ueno [Mon, 19 Sep 2022 16:25:51 +0000 (01:25 +0900)] 
fips: mark gnutls_key_generate with short key sizes non-approved

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agofips: mark PBKDF2 with short key and output sizes non-approved
Daiki Ueno [Mon, 19 Sep 2022 05:49:23 +0000 (14:49 +0900)] 
fips: mark PBKDF2 with short key and output sizes non-approved

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years ago.gitignore: follow tests/fips-rsa-sizes naming change
Daiki Ueno [Thu, 6 Oct 2022 10:30:57 +0000 (19:30 +0900)] 
.gitignore: follow tests/fips-rsa-sizes naming change

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotests: move FIPS service indicator functions to common file
Daiki Ueno [Mon, 17 Oct 2022 02:11:43 +0000 (11:11 +0900)] 
tests: move FIPS service indicator functions to common file

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/ecdsa-hash-check' into 'master'
Daiki Ueno [Wed, 5 Oct 2022 22:34:01 +0000 (22:34 +0000)] 
Merge branch 'wip/dueno/ecdsa-hash-check' into 'master'

fips: fix checking on hash algorithm used in ECDSA

See merge request gnutls/gnutls!1644

3 years agoMerge branch 'wip/ktls_keyupdate' into 'master'
Daiki Ueno [Wed, 5 Oct 2022 21:56:35 +0000 (21:56 +0000)] 
Merge branch 'wip/ktls_keyupdate' into 'master'

KTLS key update support

See merge request gnutls/gnutls!1625

3 years agoKTLS: fallback to default
Frantisek Krenzelok [Mon, 5 Sep 2022 11:05:17 +0000 (13:05 +0200)] 
KTLS: fallback to default

If an error occurs during setting of keys either initial or key update
then fallback to default mode of operation (disable ktls) and let the
user know

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoKTLS: rekey test
Frantisek Krenzelok [Tue, 9 Aug 2022 10:11:16 +0000 (12:11 +0200)] 
KTLS: rekey test

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoKTLS: set write alert callback
Frantisek Krenzelok [Fri, 5 Aug 2022 14:38:02 +0000 (16:38 +0200)] 
KTLS: set write alert callback

Use callback for sending alerts.

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoKTLS: receive key update
Frantisek Krenzelok [Mon, 22 Aug 2022 08:50:37 +0000 (10:50 +0200)] 
KTLS: receive key update

handle received GNUTLS_HANDSHAKE_KEY_UPDATE set keys accordingly

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoKTLS: send update key request
Frantisek Krenzelok [Wed, 3 Aug 2022 12:20:35 +0000 (14:20 +0200)] 
KTLS: send update key request

Set hanshake send function after interface initialization
TODO: handel setting function differently

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoKTLS: set new keys for keyupdate
Frantisek Krenzelok [Tue, 2 Aug 2022 11:35:39 +0000 (13:35 +0200)] 
KTLS: set new keys for keyupdate

set new keys durring gnutls_session_key_update()
setting keys

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoKTLS: set key on specific interfaces
Frantisek Krenzelok [Tue, 2 Aug 2022 13:00:50 +0000 (15:00 +0200)] 
KTLS: set key on specific interfaces

It is now possible to set key on specific interface.
If interface given is not ktls enabled then it will be ignored.

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
3 years agoMerge branch 'zfridric_devel' into 'master'
Zoltán Fridrich [Mon, 3 Oct 2022 10:16:45 +0000 (10:16 +0000)] 
Merge branch 'zfridric_devel' into 'master'

Make XTS key check failure not fatal

Closes #1408

See merge request gnutls/gnutls!1648

3 years agoMake XTS key check failure not fatal
Zoltan Fridrich [Thu, 29 Sep 2022 13:31:28 +0000 (15:31 +0200)] 
Make XTS key check failure not fatal

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoMerge branch 'interop-nss' into 'master'
Daiki Ueno [Sat, 1 Oct 2022 09:44:26 +0000 (09:44 +0000)] 
Merge branch 'interop-nss' into 'master'

NSS interoperability test - 2way TLSv1.3

See merge request gnutls/gnutls!1649

3 years agoNSS interoperability test - 2way TLSv1.3
Stanislav Zidek [Fri, 30 Sep 2022 13:36:17 +0000 (15:36 +0200)] 
NSS interoperability test - 2way TLSv1.3

Signed-off-by: Stanislav Zidek <szidek@redhat.com>
3 years agoMerge branch 'zfridric_devel' into 'master'
Zoltán Fridrich [Thu, 29 Sep 2022 09:42:05 +0000 (09:42 +0000)] 
Merge branch 'zfridric_devel' into 'master'

Reduce sensitive language

See merge request gnutls/gnutls!1640

3 years agofips: mark composite signature API not-approved
Daiki Ueno [Thu, 29 Sep 2022 08:13:00 +0000 (17:13 +0900)] 
fips: mark composite signature API not-approved

This makes the FIPS service indicator to transit to not-approved when
gnutls_privkey_sign_hash* is used.  In FIPS, single-shot
API (gnutls_privkey_sign_data*) is preferred over composite API.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agofips: fix checking on hash algorithm used in ECDSA
Daiki Ueno [Tue, 20 Sep 2022 07:06:13 +0000 (16:06 +0900)] 
fips: fix checking on hash algorithm used in ECDSA

Previously we checked against the "preferred" hash algorithm based on
the curve, instead of the one actually used.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch '3.7.8' into 'master' 3.7.8
Zoltán Fridrich [Tue, 27 Sep 2022 12:39:17 +0000 (12:39 +0000)] 
Merge branch '3.7.8' into 'master'

Release 3.7.8

See merge request gnutls/gnutls!1646

3 years agoRelease 3.7.8
Alexander Sosedkin [Wed, 21 Sep 2022 12:56:49 +0000 (14:56 +0200)] 
Release 3.7.8

Not bumping LT_CURRENT / LT_AGE since abi-check reports no changes.

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
3 years agoNEWS: add an entry for allowlisting-relaxing functions restriction
Alexander Sosedkin [Wed, 21 Sep 2022 12:26:55 +0000 (14:26 +0200)] 
NEWS: add an entry for allowlisting-relaxing functions restriction

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
3 years agoMerge branch 'wip/dueno/cpuid-symbol-rename' into 'master'
Zoltán Fridrich [Tue, 27 Sep 2022 10:40:30 +0000 (10:40 +0000)] 
Merge branch 'wip/dueno/cpuid-symbol-rename' into 'master'

accelerated: avoid symbol export mismatch with _gnutls_x86_cpuid_s

Closes #1370

See merge request gnutls/gnutls!1642

3 years agoReduce sensitive language
Zoltan Fridrich [Tue, 13 Sep 2022 15:07:37 +0000 (17:07 +0200)] 
Reduce sensitive language

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
3 years agoaccelerated: avoid symbol export mismatch with _gnutls_x86_cpuid_s
Daiki Ueno [Sun, 18 Sep 2022 22:40:01 +0000 (07:40 +0900)] 
accelerated: avoid symbol export mismatch with _gnutls_x86_cpuid_s

If the LD doesn't have support for version scripts,
_gnutls_x86_cpuid_s is exported through libtool's
--export-symbols-regex and that causes link error with clang:

  libtool: link: nmedit -s .libs/libgnutls-symbols.expsym .libs/libgnutls.30.dylib
  /Library/Developer/CommandLineTools/usr/bin/nmedit: error: symbols names listed in: .libs/libgnutls-symbols.expsym not in: /opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_devel_gnutls/gnutls-devel/work/gnutls-3.7.5/lib/.libs/libgnutls.30.dylib
  __gnutls_x86_cpuid_s
  make[4]: *** [libgnutls.la] Error 1

This patch renames _gnutls_x86_cpuid_s to GNUTLS_x86_cpuid_s to avoid
the issue.

Problem investigated and fix suggested by Clemens Lang in:
https://gitlab.com/gnutls/gnutls/-/issues/1370#note_967832583

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/cert-compression-followup' into 'master'
Daiki Ueno [Mon, 19 Sep 2022 21:52:35 +0000 (21:52 +0000)] 
Merge branch 'wip/dueno/cert-compression-followup' into 'master'

compress-cert: support compression of client certificates

Closes #1397

See merge request gnutls/gnutls!1641

3 years agocompress-cert: support compression of client certificates
Daiki Ueno [Sun, 18 Sep 2022 08:38:46 +0000 (17:38 +0900)] 
compress-cert: support compression of client certificates

Previously the compress_certificate extension was sent by the server
as part of ServerHello, which violates RFC 8879.  This patch instead
send it as an extension of CertificateRequest.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'zfridric_devel' into 'master'
Zoltán Fridrich [Tue, 13 Sep 2022 07:35:33 +0000 (07:35 +0000)] 
Merge branch 'zfridric_devel' into 'master'

Report system config file location via gnutls-cli

Closes #1399

See merge request gnutls/gnutls!1639