]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
2 years agonettle: avoid normalization of mpz_t in deterministic ECDSA
Daiki Ueno [Fri, 12 Jan 2024 08:56:58 +0000 (17:56 +0900)] 
nettle: avoid normalization of mpz_t in deterministic ECDSA

This removes function calls that potentially leak bit-length of a
private key used to calculate a nonce in deterministic ECDSA.  Namely:

- _gnutls_dsa_compute_k has been rewritten to work on always
  zero-padded mp_limb_t arrays instead of mpz_t
- rnd_mpz_func has been replaced with rnd_datum_func, which is backed
  by a byte array instead of an mpz_t value

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agognutls_x509_trust_list_verify_crt2: remove length limit of input
Daiki Ueno [Mon, 29 Jan 2024 04:52:46 +0000 (13:52 +0900)] 
gnutls_x509_trust_list_verify_crt2: remove length limit of input

Previously, if cert_list_size exceeded DEFAULT_MAX_VERIFY_DEPTH, the
chain verification logic crashed with assertion failure.  This patch
removes the restriction while keeping the maximum number of
retrieved certificates being DEFAULT_MAX_VERIFY_DEPTH.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'codespell' into 'master'
Daiki Ueno [Sat, 16 Mar 2024 22:53:19 +0000 (22:53 +0000)] 
Merge branch 'codespell' into 'master'

Fix a few typos found by codespell

See merge request gnutls/gnutls!1821

2 years agoFix a few typos found by codespell
Dimitri Papadopoulos [Sat, 16 Mar 2024 12:48:01 +0000 (13:48 +0100)] 
Fix a few typos found by codespell

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2 years agoTLS interoperability: updated tests
Stanislav Zidek [Thu, 14 Mar 2024 11:57:25 +0000 (12:57 +0100)] 
TLS interoperability: updated tests

Signed-off-by: Stanislav Zidek <szidek@redhat.com>
2 years agoTLS interoperability: test actual compiled master
Stanislav Zidek [Wed, 6 Mar 2024 13:06:05 +0000 (14:06 +0100)] 
TLS interoperability: test actual compiled master

Previously, system (fedora) version of GnuTLS was used in TLS
interoperability tests.

fedora-ktls/build was repurposed for native (as similar as possible)
fedora build and both unit- and interop- tests are running with
this build.

Signed-off-by: Stanislav Zidek <szidek@redhat.com>
2 years agoMerge branch 'wip/dueno/news-update' into 'master'
Daiki Ueno [Thu, 14 Mar 2024 05:15:45 +0000 (05:15 +0000)] 
Merge branch 'wip/dueno/news-update' into 'master'

NEWS: Mention RSA-OAEP support [ci skip]

See merge request gnutls/gnutls!1820

2 years agoNEWS: Mention RSA-OAEP support [ci skip]
Daiki Ueno [Thu, 14 Mar 2024 00:01:52 +0000 (09:01 +0900)] 
NEWS: Mention RSA-OAEP support [ci skip]

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/rsa-oaep-followup' into 'master'
Daiki Ueno [Mon, 11 Mar 2024 10:58:51 +0000 (10:58 +0000)] 
Merge branch 'wip/dueno/rsa-oaep-followup' into 'master'

x509: fix reading of MGF-1 OID

See merge request gnutls/gnutls!1819

2 years agox509: fix reading of MGF-1 OID
Daiki Ueno [Sat, 9 Mar 2024 21:58:46 +0000 (06:58 +0900)] 
x509: fix reading of MGF-1 OID

asn1_read_value may return error code in a positive integer thus the
previous code could lead to an access to uninitialized value.  This is
a regression in the RSA-OAEP support.  Spotted by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=67300

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/rsa-oaep' into 'master'
Daiki Ueno [Sat, 9 Mar 2024 01:14:45 +0000 (01:14 +0000)] 
Merge branch 'wip/dueno/rsa-oaep' into 'master'

Support RSA-OAEP

See merge request gnutls/gnutls!1805

2 years agotests: add test for RSA-OAEP cert generation with certtool
Daiki Ueno [Fri, 8 Mar 2024 03:48:09 +0000 (12:48 +0900)] 
tests: add test for RSA-OAEP cert generation with certtool

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'zfridric_devel2' into 'master'
Zoltán Fridrich [Tue, 5 Mar 2024 08:30:36 +0000 (08:30 +0000)] 
Merge branch 'zfridric_devel2' into 'master'

Fix mingw build on fedora

See merge request gnutls/gnutls!1818

2 years agoFix mingw build on fedora
Zoltan Fridrich [Mon, 4 Mar 2024 12:41:22 +0000 (13:41 +0100)] 
Fix mingw build on fedora

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2 years agoMerge branch 'macro-fix' into 'master'
Daiki Ueno [Mon, 4 Mar 2024 01:48:06 +0000 (01:48 +0000)] 
Merge branch 'macro-fix' into 'master'

#1530 Fix macro naming in errors.h Signed-off-by: Ramesh <adhikari.resume@gmail.com>

See merge request gnutls/gnutls!1815

2 years agoFix typo in fallback _gnutls_no_log macro alias in errors.h
Ramesh Adhikari [Mon, 4 Mar 2024 01:48:06 +0000 (01:48 +0000)] 
Fix typo in fallback _gnutls_no_log macro alias in errors.h

Previously, when C99_MACROS is not defined, _gnutls_no_log was
expanded to _gnutle_null_log and thus caused a compilation error.

Reported by Andrew Lilley Brinker in:
https://gitlab.com/gnutls/gnutls/-/issues/1530

Signed-off-by: Ramesh <adhikari.resume@gmail.com>
2 years agoMerge branch 'test_single_process' into 'master'
Daiki Ueno [Mon, 4 Mar 2024 00:02:27 +0000 (00:02 +0000)] 
Merge branch 'test_single_process' into 'master'

tests: rewrite 'hello_retry_request' as single process

See merge request gnutls/gnutls!1817

2 years agoRemove duplicate line in eagain-common.h
Sahil Siddiq [Sun, 3 Mar 2024 20:33:09 +0000 (02:03 +0530)] 
Remove duplicate line in eagain-common.h

HANDSHAKE(c, s) has already been defined on line
64. Hence, the macro on line 96 can be removed.

Signed-off-by: Sahil Siddiq <icegambit91@gmail.com>
2 years agotests: rewrite 'hello_retry_request' as single process
Sahil Siddiq [Sun, 3 Mar 2024 20:16:37 +0000 (01:46 +0530)] 
tests: rewrite 'hello_retry_request' as single process

Part of issue #1472.
https://gitlab.com/gnutls/gnutls/-/issues/1472

Signed-off-by: Sahil Siddiq <icegambit91@gmail.com>
2 years agocrypto-selftests-pk: add test case for RSA-OAEP
Daiki Ueno [Sat, 17 Feb 2024 22:10:53 +0000 (07:10 +0900)] 
crypto-selftests-pk: add test case for RSA-OAEP

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agotests: add basic test for RSA-OAEP encryption
Daiki Ueno [Thu, 8 Feb 2024 11:32:53 +0000 (20:32 +0900)] 
tests: add basic test for RSA-OAEP encryption

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agocerttool: support generating RSA-OAEP private key
Daiki Ueno [Thu, 8 Feb 2024 09:40:00 +0000 (18:40 +0900)] 
certtool: support generating RSA-OAEP private key

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoabstract: plumb RSA-OAEP in the abstract key types API
Daiki Ueno [Thu, 8 Feb 2024 09:39:41 +0000 (18:39 +0900)] 
abstract: plumb RSA-OAEP in the abstract key types API

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agox509: plumb RSA-OAEP in X.509 interface
Daiki Ueno [Thu, 8 Feb 2024 09:39:23 +0000 (18:39 +0900)] 
x509: plumb RSA-OAEP in X.509 interface

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years ago_gnutls_x509_decode_string: tolerate empty strings
Daiki Ueno [Fri, 16 Feb 2024 08:03:33 +0000 (17:03 +0900)] 
_gnutls_x509_decode_string: tolerate empty strings

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agonettle: plumb RSA-OAEP in the Nettle crypto backend
Daiki Ueno [Thu, 8 Feb 2024 09:38:44 +0000 (18:38 +0900)] 
nettle: plumb RSA-OAEP in the Nettle crypto backend

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/ecdh-compute-tests' into 'master'
Daiki Ueno [Tue, 27 Feb 2024 11:28:11 +0000 (11:28 +0000)] 
Merge branch 'wip/dueno/ecdh-compute-tests' into 'master'

tests: support KAT in (EC)DH tests

See merge request gnutls/gnutls!1813

2 years agotests: support KAT in (EC)DH tests
Daiki Ueno [Fri, 23 Feb 2024 00:03:46 +0000 (09:03 +0900)] 
tests: support KAT in (EC)DH tests

While the logic existed, known answer tests were omitted in
tests/dh-compute, tests/dh-compute2, tests/ecdh-compute, and
tests/ecdh-compute2.  This enables the support for it as well as fixes
a couple of issues in the logic: avoid using `success` variable as it
shadows the helper function with the same name defined in
tests/utils.h, invert the memcmp condition, and properly use peer_x
and peer_y in place of x and y in ecdh-compute2.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agospki: support RSA-OAEP parameters
Daiki Ueno [Thu, 8 Feb 2024 06:32:37 +0000 (15:32 +0900)] 
spki: support RSA-OAEP parameters

This adds a new API gnutls_x509_spki_{get,set}_rsa_oaep_params to
retrieve and store RSA-OAEP parameters embedded in
SubjectPublicKeyInfo.

As RSA-OAEP labels are allocated, this also adds copy and clear method
on the gnutls_x509_spki_st struct and use them extensively instead of
memcpy and memset.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoalgorithms: register RSA-OAEP
Daiki Ueno [Thu, 8 Feb 2024 08:07:39 +0000 (17:07 +0900)] 
algorithms: register RSA-OAEP

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agonettle: vendor-in RSA-OAEP implementation
Daiki Ueno [Thu, 8 Feb 2024 11:38:33 +0000 (20:38 +0900)] 
nettle: vendor-in RSA-OAEP implementation

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'fips-skip-pkcs11-tool' into 'master'
Daiki Ueno [Thu, 15 Feb 2024 15:01:16 +0000 (15:01 +0000)] 
Merge branch 'fips-skip-pkcs11-tool' into 'master'

tests: skip pkcs11-tool.sh in FIPS mode

See merge request gnutls/gnutls!1811

2 years agoMerge branch 'wip/dueno/gmp-static' into 'master'
Daiki Ueno [Thu, 15 Feb 2024 13:55:40 +0000 (13:55 +0000)] 
Merge branch 'wip/dueno/gmp-static' into 'master'

build: allow GMP to be statically linked

See merge request gnutls/gnutls!1635

2 years agobuild: allow GMP to be statically linked
Daiki Ueno [Fri, 19 Aug 2022 03:32:27 +0000 (12:32 +0900)] 
build: allow GMP to be statically linked

Even though we set the custom allocator[1] to zeroize sensitive data,
it can be easily invalidated if the application sets its own custom
allocator.  An approach to prevent that is to link against a static
library of GMP, so the use of GMP is privatized and the custom
allocator configuration is not shared with other applications.

This patch allows libgnutls to be linked with the static library of
GMP.  Note that, to this work libgmp.a needs to be compiled with -fPIC
and libhogweed in Nettle is also linked to the static library of GMP.

1. https://gitlab.com/gnutls/gnutls/-/merge_requests/1554

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agotests: rename testdir of pkcs11-tool.sh
Alexander Sosedkin [Thu, 15 Feb 2024 12:29:46 +0000 (13:29 +0100)] 
tests: rename testdir of pkcs11-tool.sh

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
2 years agoMerge branch 'flags' into 'master'
Daiki Ueno [Thu, 15 Feb 2024 09:27:58 +0000 (09:27 +0000)] 
Merge branch 'flags' into 'master'

lib/mpi.c: extract flag correctly

See merge request gnutls/gnutls!1809

2 years agoMerge branch 'parm' into 'master'
Daiki Ueno [Thu, 15 Feb 2024 08:28:08 +0000 (08:28 +0000)] 
Merge branch 'parm' into 'master'

lib/x509/x509.c: add missing argument to macro invokation

See merge request gnutls/gnutls!1810

2 years agotests: skip pkcs11-tool.sh in FIPS mode
Alexander Sosedkin [Wed, 14 Feb 2024 11:25:25 +0000 (12:25 +0100)] 
tests: skip pkcs11-tool.sh in FIPS mode

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
2 years agoMerge branch 'master' into 'master'
Daiki Ueno [Wed, 14 Feb 2024 09:48:51 +0000 (09:48 +0000)] 
Merge branch 'master' into 'master'

lib: fix two segfault issues caused by freeing uninitialized buf

See merge request gnutls/gnutls!1807

2 years agolib: fix a potential segfault in _gnutls13_recv_finished
Xin Long [Thu, 1 Feb 2024 22:21:05 +0000 (17:21 -0500)] 
lib: fix a potential segfault in _gnutls13_recv_finished

In _gnutls13_recv_finished(), 'buf' is not initialized or set when
_gnutls13_compute_finished() returns an err, and goto cleanup may
cause a segfault crash as it frees the uninitialized buf.allocd in
_gnutls_buffer_clear().

So fix it by return if _gnutls13_compute_finished() returns an err
in _gnutls13_recv_finished().

Signed-off-by: Xin Long <lucien.xin@gmail.com>
2 years agolib: fix a segfault in _gnutls13_recv_end_of_early_data
Xin Long [Thu, 1 Feb 2024 21:50:22 +0000 (16:50 -0500)] 
lib: fix a segfault in _gnutls13_recv_end_of_early_data

A crash occur in my app that uses gnutls13 early data, stack trace:

  #0  free (libc.so.6 + 0x97bf0)
  #1  _gnutls_buffer_clear (libgnutls.so.30 + 0x77c8c)
  #2  _gnutls13_recv_end_of_early_data (libgnutls.so.30 + 0xaf308)
  #3  _gnutls13_handshake_server (libgnutls.so.30 + 0x42d6c)
  #4  handshake_server (libgnutls.so.30 + 0x4ff6c)

The root cause is that _gnutls_buffer_clear() was trying to free
'buf' that is not initialized or set if GNUTLS_NO_END_OF_EARLY_DATA
flag is set on server side.

This patch fixes it by simply initializing buf at the begginning of
_gnutls13_recv_end_of_early_data().

Signed-off-by: Xin Long <lucien.xin@gmail.com>
2 years agolib/x509/x509.c: add missing argument to macro invokation
Avinash Sonawane [Tue, 13 Feb 2024 17:09:49 +0000 (22:39 +0530)] 
lib/x509/x509.c: add missing argument to macro invokation

Signed-off-by: Avinash Sonawane <rootkea@gmail.com>
2 years agolib/mpi.c: extract flag correctly
Avinash Sonawane [Tue, 13 Feb 2024 09:37:32 +0000 (15:07 +0530)] 
lib/mpi.c: extract flag correctly

Signed-off-by: Avinash Sonawane <rootkea@gmail.com>
2 years agoMerge branch 'wip/dueno/serv-memleak' into 'master'
Daiki Ueno [Mon, 29 Jan 2024 22:30:22 +0000 (22:30 +0000)] 
Merge branch 'wip/dueno/serv-memleak' into 'master'

serv: fix memleak when a connected client disappears

See merge request gnutls/gnutls!1803

2 years agoserv: fix memleak when a connected client disappears
Daiki Ueno [Sat, 27 Jan 2024 02:09:18 +0000 (11:09 +0900)] 
serv: fix memleak when a connected client disappears

Reported by Hubert Kario.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/utsname-followup' into 'master'
Zoltán Fridrich [Tue, 23 Jan 2024 13:05:36 +0000 (13:05 +0000)] 
Merge branch 'wip/dueno/utsname-followup' into 'master'

ktls: fix kernel version checking using utsname

See merge request gnutls/gnutls!1801

2 years agoktls: fix kernel version checking using utsname
Daiki Ueno [Tue, 23 Jan 2024 02:54:32 +0000 (11:54 +0900)] 
ktls: fix kernel version checking using utsname

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'zfridric_devel' into 'master'
Zoltán Fridrich [Mon, 22 Jan 2024 12:12:06 +0000 (12:12 +0000)] 
Merge branch 'zfridric_devel' into 'master'

Make compression libraries dynamically loadable

Closes #1424

See merge request gnutls/gnutls!1800

2 years agoMake compression libraries dynamically loadable
Zoltan Fridrich [Fri, 19 Jan 2024 13:22:35 +0000 (14:22 +0100)] 
Make compression libraries dynamically loadable

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2 years agoMerge branch 'wip/dueno/release-3.8.3' into 'master' 3.8.3
Daiki Ueno [Tue, 16 Jan 2024 09:10:08 +0000 (09:10 +0000)] 
Merge branch 'wip/dueno/release-3.8.3' into 'master'

Release 3.8.3

See merge request gnutls/gnutls!1799

2 years agoRelease 3.8.3
Daiki Ueno [Tue, 16 Jan 2024 05:51:36 +0000 (14:51 +0900)] 
Release 3.8.3

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agorsa-psk: minimize branching after decryption
Daiki Ueno [Wed, 10 Jan 2024 10:13:17 +0000 (19:13 +0900)] 
rsa-psk: minimize branching after decryption

This moves any non-trivial code between gnutls_privkey_decrypt_data2
and the function return in _gnutls_proc_rsa_psk_client_kx up until the
decryption.  This also avoids an extra memcpy to session->key.key.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agox509: detect loop in certificate chain
Daiki Ueno [Thu, 11 Jan 2024 06:45:11 +0000 (15:45 +0900)] 
x509: detect loop in certificate chain

There can be a loop in a certificate chain, when multiple CA
certificates are cross-signed with each other, such as A → B, B → C,
and C → A.  Previously, the verification logic was not capable of
handling this scenario while sorting the certificates in the chain in
_gnutls_sort_clist, resulting in an assertion failure.  This patch
properly detects such loop and aborts further processing in a graceful
manner.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'cllang-fips-zeroization' into 'master'
Daiki Ueno [Mon, 15 Jan 2024 11:08:08 +0000 (11:08 +0000)] 
Merge branch 'cllang-fips-zeroization' into 'master'

fips: Zeroize temporary values

See merge request gnutls/gnutls!1797

2 years agofips: Zeroize temporary values
Clemens Lang [Fri, 12 Jan 2024 10:12:14 +0000 (11:12 +0100)] 
fips: Zeroize temporary values

The standard says "temporary value(s) generated during the integrity
test of the module's software […] shall be zeroised from the module upon
completion of the integrity test".

That includes the computed HMAC value, which is currently not zeroized
after the test. Add explicit calls to gnutls_memset() to fix that.

Signed-off-by: Clemens Lang <cllang@redhat.com>
2 years agoMerge branch 'wip/dueno/ci-fixes3' into 'master'
Daiki Ueno [Mon, 15 Jan 2024 04:42:10 +0000 (04:42 +0000)] 
Merge branch 'wip/dueno/ci-fixes3' into 'master'

Assorted CI fixes

See merge request gnutls/gnutls!1798

2 years ago.gitlab-ci.yml: bump cache version
Daiki Ueno [Mon, 15 Jan 2024 01:42:26 +0000 (10:42 +0900)] 
.gitlab-ci.yml: bump cache version

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years ago.gitlab-ci.yml: Adjust to Alpine Linux' clang-format path change
Clemens Lang [Fri, 12 Jan 2024 10:32:22 +0000 (11:32 +0100)] 
.gitlab-ci.yml: Adjust to Alpine Linux' clang-format path change

According to Alpine Linux' package database search functionality, the
clang16-extra-tools package now installs clang-format in
/usr/lib/llvm16/bin/clang-format.

/usr/bin/clang-format is provided by clang17-extra-tools instead, but
requires changes in formatting. Add /usr/lib/llvm16/bin to PATH for the
formatting script to continue using the previous version.

Signed-off-by: Clemens Lang <cllang@redhat.com>
2 years agotests: suppress leaks in libsofthsm2
Daiki Ueno [Sun, 14 Jan 2024 07:53:15 +0000 (16:53 +0900)] 
tests: suppress leaks in libsofthsm2

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agotests/pkcs11-tool.sh: skip if neither p11tool nor certool is built
Daiki Ueno [Mon, 1 Jan 2024 05:26:08 +0000 (14:26 +0900)] 
tests/pkcs11-tool.sh: skip if neither p11tool nor certool is built

When compiled with --disable-tools, we can't assume p11tool and
certool are available.  This also switches to using create_testdir and
locate any intermediate files under a temporary directory which is
cleaned up at exit.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoUpdate year of copyright notices in doc/gnutls.texi
Daiki Ueno [Mon, 1 Jan 2024 03:51:16 +0000 (12:51 +0900)] 
Update year of copyright notices in doc/gnutls.texi

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/ktls-utsname' into 'master'
Daiki Ueno [Tue, 12 Dec 2023 15:33:16 +0000 (15:33 +0000)] 
Merge branch 'wip/dueno/ktls-utsname' into 'master'

ktls: check Linux kernel version at run time

See merge request gnutls/gnutls!1793

2 years agoMerge branch 'wip/dueno/cli-aia-fixes' into 'master'
Daiki Ueno [Tue, 12 Dec 2023 14:29:11 +0000 (14:29 +0000)] 
Merge branch 'wip/dueno/cli-aia-fixes' into 'master'

cli: fix --ca-auto-retrieve crash when no caIssuer is present in AIA

See merge request gnutls/gnutls!1792

2 years agoMerge branch 'eddsa-fix' into 'master'
Daiki Ueno [Fri, 1 Dec 2023 22:07:36 +0000 (22:07 +0000)] 
Merge branch 'eddsa-fix' into 'master'

pkcs11: Unbreak importing EdDSA keys with curve name in parameters

Closes #1515

See merge request gnutls/gnutls!1795

2 years agotests: Reproducer for regression in parent (requires opensc installed)
Jakub Jelen [Fri, 1 Dec 2023 17:16:05 +0000 (18:16 +0100)] 
tests: Reproducer for regression in parent (requires opensc installed)

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
2 years agopkcs11: Unbreak importing EdDSA keys with curve name in parameters
Jakub Jelen [Thu, 30 Nov 2023 10:30:30 +0000 (11:30 +0100)] 
pkcs11: Unbreak importing EdDSA keys with curve name in parameters

Fixes: #1515
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
2 years agoMerge branch 'markharfouche-master-patch-88279' into 'master'
Daiki Ueno [Tue, 28 Nov 2023 13:37:59 +0000 (13:37 +0000)] 
Merge branch 'markharfouche-master-patch-88279' into 'master'

specify osstatus_error takes in an OSStatus as its first argument

See merge request gnutls/gnutls!1794

2 years agospecify osstatus_error takes in an OSStatus as its first argument
Mark Harfouche [Mon, 27 Nov 2023 12:20:23 +0000 (12:20 +0000)] 
specify osstatus_error takes in an OSStatus as its first argument

Signed-off-by: Mark Harfouche <mark.harfouche@gmail.com>
2 years agoMerge branch 'zfridric_devel' into 'master' 3.8.2
Zoltán Fridrich [Wed, 15 Nov 2023 08:24:45 +0000 (08:24 +0000)] 
Merge branch 'zfridric_devel' into 'master'

Release 3.8.2

Closes #1511

See merge request gnutls/gnutls!1787

2 years agoRelease 3.8.2
Zoltan Fridrich [Fri, 20 Oct 2023 11:43:46 +0000 (13:43 +0200)] 
Release 3.8.2

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2 years agoauth/rsa_psk: side-step potential side-channel
Daiki Ueno [Mon, 23 Oct 2023 00:26:57 +0000 (09:26 +0900)] 
auth/rsa_psk: side-step potential side-channel

This removes branching that depends on secret data, porting changes
for regular RSA key exchange from
4804febddc2ed958e5ae774de2a8f85edeeff538 and
80a6ce8ddb02477cd724cd5b2944791aaddb702a.  This also removes the
allow_wrong_pms as it was used sorely to control debug output
depending on the branching.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agotests: ktls.sh: skip if kernel version is older than 5.11
Daiki Ueno [Fri, 10 Nov 2023 06:54:01 +0000 (15:54 +0900)] 
tests: ktls.sh: skip if kernel version is older than 5.11

The test assumes that CHACHA20-POLY1305 ciphersuites are available,
though they were added in 5.11.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoktls: check Linux kernel version at run time
Daiki Ueno [Fri, 10 Nov 2023 06:49:53 +0000 (15:49 +0900)] 
ktls: check Linux kernel version at run time

When a GnuTLS application runs in a container guest and the host
kernel is older than expected, it fails at initializing KTLS.  This
adds a check at run time, using uname.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agox509: clarify the calling convention of AIA callbacks
Daiki Ueno [Thu, 9 Nov 2023 08:17:36 +0000 (17:17 +0900)] 
x509: clarify the calling convention of AIA callbacks

This updates the documentation of
gnutls_x509_trust_list_set_getissuer_function to explicitly mention
that the callback shall initialize the output arguments upon
successful call, even if the result is empty.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agocli: fix --ca-auto-retrieve crash when no caIssuer is present in AIA
Daiki Ueno [Thu, 9 Nov 2023 04:33:13 +0000 (13:33 +0900)] 
cli: fix --ca-auto-retrieve crash when no caIssuer is present in AIA

Previously, when caIssuer URI is not present in the certificate's AIA
extension, the callback successfully returned 0, but didn't initialize
the output arguments, resulting in a segmentation fault in the caller.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'fix123' into 'master'
Daiki Ueno [Mon, 6 Nov 2023 13:49:35 +0000 (13:49 +0000)] 
Merge branch 'fix123' into 'master'

handshake.c: Fixed a missing goto statement

See merge request gnutls/gnutls!1791

2 years agoMerge branch 'fix_errno' into 'master'
Daiki Ueno [Mon, 6 Nov 2023 13:49:21 +0000 (13:49 +0000)] 
Merge branch 'fix_errno' into 'master'

lib: Use correct transport getting error number

See merge request gnutls/gnutls!1790

2 years agohandshake.c: Fixed a missing goto statement
Ajit Singh [Mon, 6 Nov 2023 10:15:10 +0000 (15:45 +0530)] 
handshake.c: Fixed a missing goto statement

Signed-off-by: Ajit Singh <ajeetsinghchahar2@gmail.com>
2 years agolib: Use correct transport getting error number
Frediano Ziglio [Sun, 5 Nov 2023 17:47:44 +0000 (17:47 +0000)] 
lib: Use correct transport getting error number

For write we need to use transport_send_ptr, not transport_recv_ptr.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2 years agoMerge branch 'lgtm' into 'master'
Daiki Ueno [Thu, 26 Oct 2023 00:05:19 +0000 (00:05 +0000)] 
Merge branch 'lgtm' into 'master'

.lgtm.yml: remove LGTM.com configuration file

See merge request gnutls/gnutls!1788

2 years ago.lgtm.yml: remove LGTM.com configuration file
Dimitri Papadopoulos [Wed, 25 Oct 2023 22:17:33 +0000 (00:17 +0200)] 
.lgtm.yml: remove LGTM.com configuration file

LGTM.com has been deprecated and replaced by GitHub code analysis:
https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2 years agoMerge branch 'wip/dueno/srptool-fixes' into 'master'
Daiki Ueno [Thu, 19 Oct 2023 11:57:10 +0000 (11:57 +0000)] 
Merge branch 'wip/dueno/srptool-fixes' into 'master'

srptool: rework entry parsing without indexing

See merge request gnutls/gnutls!1782

2 years agoMerge branch 'wip/dueno/release-3.8.2' into 'master'
Zoltán Fridrich [Thu, 19 Oct 2023 11:12:34 +0000 (11:12 +0000)] 
Merge branch 'wip/dueno/release-3.8.2' into 'master'

NEWS: mention KTLS support in FreeBSD [ci skip]

See merge request gnutls/gnutls!1785

2 years agoNEWS: mention KTLS support in FreeBSD [ci skip]
Daiki Ueno [Tue, 17 Oct 2023 23:21:05 +0000 (08:21 +0900)] 
NEWS: mention KTLS support in FreeBSD [ci skip]

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'cal-doc-typo' into 'master'
Daiki Ueno [Wed, 18 Oct 2023 20:51:14 +0000 (20:51 +0000)] 
Merge branch 'cal-doc-typo' into 'master'

CONTRIBUTING.md: Fix file name in reviewer checklist

See merge request gnutls/gnutls!1784

2 years agoCONTRIBUTING.md: Fix file name in reviewer checklist
Clemens Lang [Wed, 18 Oct 2023 08:50:08 +0000 (10:50 +0200)] 
CONTRIBUTING.md: Fix file name in reviewer checklist

The coding guidelines are in CONTRIBUTING.md, not CONTRIBUTION.md (which
does not exist).

Signed-off-by: Clemens Lang <cllang@redhat.com>
2 years agosrptool: rework entry parsing without indexing
xuraoqing [Wed, 23 Aug 2023 03:56:03 +0000 (11:56 +0800)] 
srptool: rework entry parsing without indexing

This simplifies the loop matching and parsing an SRP entry,
considering the buffer read with fgets is always NUL-terminated.

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
Modified-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/starttls-name' into 'master'
Daiki Ueno [Wed, 18 Oct 2023 09:35:08 +0000 (09:35 +0000)] 
Merge branch 'wip/dueno/starttls-name' into 'master'

cli: add --starttls-name option

Closes #1507

See merge request gnutls/gnutls!1781

2 years agoMerge branch 'fix-dtls-handshake-1-byte-first-fragment' into 'master'
Daiki Ueno [Wed, 18 Oct 2023 01:56:03 +0000 (01:56 +0000)] 
Merge branch 'fix-dtls-handshake-1-byte-first-fragment' into 'master'

Fix DTLS handshake when first fragment is 1 byte

See merge request gnutls/gnutls!1753

2 years ago.gitlab-ci.yml: disable p11-kit for MinGW builds
Daiki Ueno [Tue, 17 Oct 2023 20:24:33 +0000 (05:24 +0900)] 
.gitlab-ci.yml: disable p11-kit for MinGW builds

Currently, tests are failing with page fault in MinGW64 builds if
p11-kit is enabled.  This temporarily disables it.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agocli: add --starttls-name option
Daiki Ueno [Fri, 13 Oct 2023 08:36:57 +0000 (17:36 +0900)] 
cli: add --starttls-name option

Some deployment of application protocols, such as XMPP, require a
different hostname than the host being connected.  This adds a new
option, --starttls-name, to gnutls-cli to specify it separately.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/check-headers' into 'master'
Daiki Ueno [Tue, 10 Oct 2023 22:35:00 +0000 (22:35 +0000)] 
Merge branch 'wip/dueno/check-headers' into 'master'

devel: add script to fix header inclusion

Closes #459

See merge request gnutls/gnutls!1780

2 years ago.gitlab-ci.yml: hook devel/check-headers.sh in .pre target
Daiki Ueno [Sat, 7 Oct 2023 08:25:45 +0000 (17:25 +0900)] 
.gitlab-ci.yml: hook devel/check-headers.sh in .pre target

This adds devel/check-headers.sh in the .pre target phase so any
inconsistent header inclusion would be detected early in the CI.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agodevel: make local header inclusion consistent
Daiki Ueno [Sat, 7 Oct 2023 08:24:02 +0000 (17:24 +0900)] 
devel: make local header inclusion consistent

This is the result of running devel/check-headers.sh --format on all
.c and .h files under lib.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agodevel: add script to fix header inclusion
Daiki Ueno [Sat, 7 Oct 2023 08:17:39 +0000 (17:17 +0900)] 
devel: add script to fix header inclusion

This adds check-headers.sh script which scans .c files and checks that
local header files under lib/ are consistently included with #include
"foo.h" instead of #include <foo.h>.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/pkcs11-ed448' into 'master'
Daiki Ueno [Thu, 5 Oct 2023 22:13:36 +0000 (22:13 +0000)] 
Merge branch 'wip/dueno/pkcs11-ed448' into 'master'

pkcs11: support Ed448 keys

Closes #1502

See merge request gnutls/gnutls!1779

2 years agoMerge branch 'ktls-freebsd'
Daiki Ueno [Wed, 4 Oct 2023 09:26:14 +0000 (09:26 +0000)] 
Merge branch 'ktls-freebsd'

See merge request gnutls/gnutls!1768

2 years agoktls: add support for FreeBSD
Yongye Zhu [Wed, 4 Oct 2023 09:26:14 +0000 (09:26 +0000)] 
ktls: add support for FreeBSD

This extend the KTLS support to FreeBSD, with the AES-GCM-128, AES-GCM-256, and ChaCha20-Poly1305 ciphersuites.

Signed-off-by: Yongye Zhu <zyy1102000@gmail.com>
Reviewed-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
2 years agopkcs11: support Ed448 keys
Daiki Ueno [Thu, 28 Sep 2023 02:38:36 +0000 (11:38 +0900)] 
pkcs11: support Ed448 keys

This adds support for Ed448 keys backed by PKCS#11.  To differentiate
Ed448 keys from Ed25519 keys, this requires an extra logic to check
CKA_EC_PARAMS when reading public keys.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agotests: refactor pkcs11-privkey-generate
Daiki Ueno [Thu, 28 Sep 2023 02:37:15 +0000 (11:37 +0900)] 
tests: refactor pkcs11-privkey-generate

This factors out key generation logic into a separate function so we
can easily extend the test to cover more key types.

Signed-off-by: Daiki Ueno <ueno@gnu.org>