]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
5 years agoAdd unit test for id-on-xmppAddr decoding error
Steffen Jaeckel [Fri, 5 Mar 2021 11:31:45 +0000 (12:31 +0100)] 
Add unit test for id-on-xmppAddr decoding error

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
5 years agognutls_x509_trust_list_verify_crt2: skip duped certs for PKCS11 too
Daiki Ueno [Fri, 5 Mar 2021 11:08:25 +0000 (12:08 +0100)] 
gnutls_x509_trust_list_verify_crt2: skip duped certs for PKCS11 too

The commit 09b40be6e0e0a59ba4bd764067eb353241043a70 (part of
gnutls/gnutls!1370) didn't cover the case where the trust store is
backed by PKCS #11, because it used _gnutls_trust_list_get_issuer,
which only works with file based trust store.

This patch replaces the call with more generic
gnutls_x509_trust_list_get_issuer so it also works with other trust
store implementations.

Reported by Michal Ruprich.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agooutput UTF-8 decoded id-on-xmppAddr SAN's
Steffen Jaeckel [Thu, 4 Mar 2021 15:44:21 +0000 (16:44 +0100)] 
output UTF-8 decoded id-on-xmppAddr SAN's

tls_x509_crt_get_subject_alt_name()` makes a promise [1] "If an
otherName OID is known, the data will be decoded. ... RFC 3920
id-on-xmppAddr SAN is recognized." which it didn't hold.

Before this patch the output was still in DER format, e.g. for a
id-on-xmppAddr which is always UTF-8 (0x0c): `0x0c <len> <xmppAddr>`

This patch fixes the issue and now it returns the decoded string.

[1]
https://www.gnutls.org/manual/gnutls.html#gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fname

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
5 years agoMerge branch 'tmp-ctype-handling-improvements' into 'master'
Daiki Ueno [Sun, 28 Feb 2021 16:52:16 +0000 (16:52 +0000)] 
Merge branch 'tmp-ctype-handling-improvements' into 'master'

Certificate type handling improvements

See merge request gnutls/gnutls!1394

5 years agoChanged _gnutls_session_cert_type_supported prototype and name to follow guidelines...
Tom Vrancken [Sun, 28 Feb 2021 12:56:21 +0000 (13:56 +0100)] 
Changed _gnutls_session_cert_type_supported prototype and name to follow guidelines for boolean functions.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
5 years agoChanged certificate retrieval callback prototype parameter name to be in line with...
Tom Vrancken [Thu, 25 Feb 2021 11:06:55 +0000 (12:06 +0100)] 
Changed certificate retrieval callback prototype parameter name to be in line with the other parameters.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
5 years agoAdded documentation for rawpk use in certificate retrieval callback.
Tom Vrancken [Sat, 23 Jan 2021 18:24:46 +0000 (19:24 +0100)] 
Added documentation for rawpk use in certificate retrieval callback.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
5 years agoAdded extra logging and done some variable refactoring for server cert type extension.
Tom Vrancken [Thu, 25 Feb 2021 14:20:05 +0000 (15:20 +0100)] 
Added extra logging and done some variable refactoring for server cert type extension.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
5 years agoAdded extra logging and done some variable refactoring for client cert type extension.
Tom Vrancken [Thu, 28 Jan 2021 19:05:51 +0000 (20:05 +0100)] 
Added extra logging and done some variable refactoring for client cert type extension.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
5 years agoMerge branch 'padlock-aes-192' into 'master'
Daiki Ueno [Thu, 25 Feb 2021 11:39:34 +0000 (11:39 +0000)] 
Merge branch 'padlock-aes-192' into 'master'

padlock:add support for AES-192-CBC

Closes #1004

See merge request gnutls/gnutls!1393

5 years agopadlock:add support for AES-192-CBC
JonasZhou [Thu, 25 Feb 2021 07:48:36 +0000 (15:48 +0800)] 
padlock:add support for AES-192-CBC

Padlock code misses support for AES-192. Extend it to support AES-192.
Due to poor performance of padlock-aes-xxx-gcm, only padlock-aes-192-cbc
is added.

Signed-off-by: JonasZhou <JonasZhou@zhaoxin.com>
5 years ago.gitlab-ci.yml: run fedora-valgrind jobs only on upstream branches
Daiki Ueno [Fri, 19 Feb 2021 14:36:48 +0000 (15:36 +0100)] 
.gitlab-ci.yml: run fedora-valgrind jobs only on upstream branches

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/valgrind' into 'master'
Daiki Ueno [Fri, 19 Feb 2021 10:06:11 +0000 (10:06 +0000)] 
Merge branch 'wip/dueno/valgrind' into 'master'

tests: enable all tests to run under valgrind

Closes #1174 and #708

See merge request gnutls/gnutls!1383

5 years agotests: remove *hello_random_value tests
Daiki Ueno [Sat, 30 Jan 2021 17:35:14 +0000 (18:35 +0100)] 
tests: remove *hello_random_value tests

Those tests are meaningless and merely introduces extra flakiness, now
that the uninitialized random bytes are detected by valgrind.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: use longer handshake timeout for valgrind jobs
Daiki Ueno [Sat, 30 Jan 2021 12:34:40 +0000 (13:34 +0100)] 
.gitlab-ci.yml: use longer handshake timeout for valgrind jobs

Also limit the parallelism to $(nproc) to be less resource intensive.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/nofipshmac' into 'master'
Daiki Ueno [Thu, 18 Feb 2021 08:16:16 +0000 (08:16 +0000)] 
Merge branch 'wip/dueno/nofipshmac' into 'master'

fips: replace fipshmac usage with internal program

Closes #1101

See merge request gnutls/gnutls!1390

5 years agotests: make any ad-hoc timeout setting controllable through envvar
Daiki Ueno [Sat, 30 Jan 2021 17:22:18 +0000 (18:22 +0100)] 
tests: make any ad-hoc timeout setting controllable through envvar

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: suffix .sh for all shell-script tests
Daiki Ueno [Sat, 30 Jan 2021 09:49:07 +0000 (10:49 +0100)] 
tests: suffix .sh for all shell-script tests

Otherwise valgrind will run against /bin/sh.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: don't conditionalize valgrind with --disable-full-test-suite
Daiki Ueno [Sat, 30 Jan 2021 08:23:02 +0000 (09:23 +0100)] 
tests: don't conditionalize valgrind with --disable-full-test-suite

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: don't run shell-script tests under valgrind
Daiki Ueno [Fri, 29 Jan 2021 14:36:44 +0000 (15:36 +0100)] 
tests: don't run shell-script tests under valgrind

https://www.gnu.org/software/gnulib/manual/html_node/Valgrind-and-shell-scripts.html

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agonettle: check lib state early to cope with synthesized error
Daiki Ueno [Sat, 30 Jan 2021 08:25:06 +0000 (09:25 +0100)] 
nettle: check lib state early to cope with synthesized error

tests/x509sign-verify-error.c calls _gnutls_lib_simulate_error before
the actual private key operations.  That previously resulted in
infloop / conditional jump depending on uninitialized data, because
the random function (gnutls_rnd) was not able to feed sufficient
randomness in that case.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: fix memory leak in tests/tls13/no-auto-send-ticket
Daiki Ueno [Fri, 29 Jan 2021 13:09:17 +0000 (14:09 +0100)] 
tests: fix memory leak in tests/tls13/no-auto-send-ticket

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: remove init_fds test
Daiki Ueno [Sun, 24 Jan 2021 06:49:34 +0000 (07:49 +0100)] 
tests: remove init_fds test

This test does nothing to expose the original problem linked in the comment:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760476

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agosafe-memfuncs: rely on explicit_bzero implementation from gnulib
Daiki Ueno [Sat, 23 Jan 2021 13:36:57 +0000 (14:36 +0100)] 
safe-memfuncs: rely on explicit_bzero implementation from gnulib

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: remove scriptlet to generate HMAC files for FIPS
Daiki Ueno [Wed, 17 Feb 2021 10:31:23 +0000 (11:31 +0100)] 
.gitlab-ci.yml: remove scriptlet to generate HMAC files for FIPS

This is now generated automatically during the build.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofips: replace fipshmac usage with internal program
Ondrej Moris [Fri, 30 Oct 2020 19:43:56 +0000 (20:43 +0100)] 
fips: replace fipshmac usage with internal program

This introduces a non-installed program "fipshmac" and uses it for
generating HMAC files required in FIPS 140-2.  The generated files are
installed along with the main library.

Resolves issues #1101.

Signed-off-by: Ondrej Moris <omoris@redhat.com>
Co-authored-by: Daiki Ueno <dueno@redhat.com>
5 years agoMerge branch 'wip/dueno/typo-fixes' into 'master'
Daiki Ueno [Wed, 17 Feb 2021 07:32:48 +0000 (07:32 +0000)] 
Merge branch 'wip/dueno/typo-fixes' into 'master'

README.md, .gitlab-ci.yml: fix typos and remove misleading information

Closes #1088, #604, and #603

See merge request gnutls/gnutls!1388

5 years agobuild: don't remove distributed stamp files on "make clean"
Daiki Ueno [Wed, 17 Feb 2021 06:24:27 +0000 (07:24 +0100)] 
build: don't remove distributed stamp files on "make clean"

Those files are created by the maintainers and should remain after
"make clean" when the distribution tarball is used.

Reported by christian wagner in:
https://gitlab.com/gnutls/gnutls/-/issues/1088

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'bug/require-gmp' into 'master'
Daiki Ueno [Wed, 17 Feb 2021 05:50:25 +0000 (05:50 +0000)] 
Merge branch 'bug/require-gmp' into 'master'

configure.ac: fix "nettle_rsa_sec_decrypt" check error

See merge request gnutls/gnutls!1389

5 years agofastopen: remove call to abort()
Daiki Ueno [Tue, 16 Feb 2021 07:45:23 +0000 (08:45 +0100)] 
fastopen: remove call to abort()

Ideally, this function should have a way to return an error, but
simply not enabling TFO wouldn't hurt.

Reported by Tim Rühsen in:
https://gitlab.com/gnutls/gnutls/-/issues/603

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohex: use a table to avoid meaningless assertion
Daiki Ueno [Tue, 16 Feb 2021 07:39:17 +0000 (08:39 +0100)] 
hex: use a table to avoid meaningless assertion

Reported by Tim Rühsen in:
https://gitlab.com/gnutls/gnutls/-/issues/604

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognutlsxx: add const and explicit specifiers where possible
Daiki Ueno [Wed, 17 Feb 2021 05:38:41 +0000 (06:38 +0100)] 
gnutlsxx: add const and explicit specifiers where possible

Flagged by cppcheck.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoconfigure.ac: fix "nettle_rsa_sec_decrypt" check error
Dmitriy Tsvettsikh [Tue, 16 Feb 2021 23:28:47 +0000 (04:28 +0500)] 
configure.ac: fix "nettle_rsa_sec_decrypt" check error

When libhogweed built with external gmplib, then it required explicit
path to gmplib to pass check.

Signed-off-by: Dmitriy Tsvettsikh <dmitrycvet@gmail.com>
5 years agoMerge branch 'w32_sendmsg' into 'master'
Daiki Ueno [Tue, 16 Feb 2021 14:27:14 +0000 (14:27 +0000)] 
Merge branch 'w32_sendmsg' into 'master'

Sockets: implement sendmsg()-like function on Win32

See merge request gnutls/gnutls!1377

5 years agoSockets: implement sendmsg()-like functions on Win32
Evgeny Grin [Sun, 10 Jan 2021 18:36:18 +0000 (21:36 +0300)] 
Sockets: implement sendmsg()-like functions on Win32

Use WSASend() to send several buffer per one sys-call.
Unified send()/recv() support for POSIX/Win32.

Signed-off-by: Evgeny Grin <k2k@narod.ru>
5 years agognutlsxx: dh_params, rsa_params: actually assign values in operator=
Daiki Ueno [Tue, 16 Feb 2021 06:51:10 +0000 (07:51 +0100)] 
gnutlsxx: dh_params, rsa_params: actually assign values in operator=

The previous implementation assigned the value to a temporary variable
and then return it without assigning it to 'this'.  That is not only
contradictory to user's expectation but also cppcheck treats it as a
logic error.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/guile-fixes' into 'master'
Daiki Ueno [Mon, 15 Feb 2021 15:09:14 +0000 (15:09 +0000)] 
Merge branch 'wip/dueno/guile-fixes' into 'master'

configure.ac: include <libguile.h> when checking scm_* functions

Closes #1116

See merge request gnutls/gnutls!1360

5 years agoREADME.md: don't suggest installing lockfile-progs
Daiki Ueno [Mon, 15 Feb 2021 14:51:25 +0000 (15:51 +0100)] 
README.md: don't suggest installing lockfile-progs

The dependency has been removed in
5eff2002b0f7ac54b14326f207b5a9e509269555.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: fix typo in cppcheck -I argument
Daiki Ueno [Mon, 15 Feb 2021 13:54:14 +0000 (14:54 +0100)] 
.gitlab-ci.yml: fix typo in cppcheck -I argument

Reported by Tim Rühsen in:
https://gitlab.com/gnutls/gnutls/-/issues/705

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoREADME.md: fix typo in libev URL
Daiki Ueno [Mon, 15 Feb 2021 13:53:39 +0000 (14:53 +0100)] 
README.md: fix typo in libev URL

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/bootstrap' into 'master'
Daiki Ueno [Sat, 13 Feb 2021 20:16:41 +0000 (20:16 +0000)] 
Merge branch 'wip/dueno/bootstrap' into 'master'

bootstrap: update from Gnulib

Closes #1143

See merge request gnutls/gnutls!1384

5 years agoMerge branch 'tmp-tests-missing-nettle-cflags' into 'master'
Andreas Metzler [Sat, 13 Feb 2021 18:50:18 +0000 (18:50 +0000)] 
Merge branch 'tmp-tests-missing-nettle-cflags' into 'master'

Fix test error with nettle in non-default location

See merge request gnutls/gnutls!1386

5 years ago.gitlab-ci.yml: bump cache version
Daiki Ueno [Sat, 13 Feb 2021 14:56:22 +0000 (15:56 +0100)] 
.gitlab-ci.yml: bump cache version

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobootstrap.conf: initialize openssl submodule
Daiki Ueno [Mon, 8 Feb 2021 11:24:31 +0000 (12:24 +0100)] 
bootstrap.conf: initialize openssl submodule

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoconfigure.ac: fix misleading --help output on guile bindings
Daiki Ueno [Mon, 8 Feb 2021 07:46:13 +0000 (08:46 +0100)] 
configure.ac: fix misleading --help output on guile bindings

Reported by Tim Rühsen in:
https://gitlab.com/gnutls/gnutls/-/issues/577

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobootstrap: update from Gnulib
Daiki Ueno [Sun, 7 Feb 2021 17:54:45 +0000 (18:54 +0100)] 
bootstrap: update from Gnulib

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobootstrap.conf: refactor detection of gtk-doc and gnulib sockets
Daiki Ueno [Sun, 7 Feb 2021 16:38:31 +0000 (17:38 +0100)] 
bootstrap.conf: refactor detection of gtk-doc and gnulib sockets

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitignore: ignore more files
Daiki Ueno [Sat, 13 Feb 2021 14:57:36 +0000 (15:57 +0100)] 
.gitignore: ignore more files

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoFix test error with nettle in non-default location
Andreas Metzler [Tue, 9 Feb 2021 13:16:54 +0000 (14:16 +0100)] 
Fix test error with nettle in non-default location

Move #include <nettle/memxor.h> from gnutls_int.h to lib/cipher.c, drop
now superfluous NETTLE_CFLAGS from CPPFLAGS of multiple tests #including
gnutls_int.h.

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
5 years ago.gitlab-ci.yml: remove FreeBSD run
Daiki Ueno [Thu, 11 Feb 2021 05:45:47 +0000 (06:45 +0100)] 
.gitlab-ci.yml: remove FreeBSD run

This used to run on a dedicated FreeBSD runner, which is no longer
maintained.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/hrr-resumption' into 'master'
Daiki Ueno [Wed, 10 Feb 2021 19:17:03 +0000 (19:17 +0000)] 
Merge branch 'wip/dueno/hrr-resumption' into 'master'

handshake: TLS 1.3: don't generate session ID in resumption mode

See merge request gnutls/gnutls!1381

5 years agoMerge branch 'wip/dueno/cli-debug' into 'master'
Daiki Ueno [Wed, 10 Feb 2021 17:43:30 +0000 (17:43 +0000)] 
Merge branch 'wip/dueno/cli-debug' into 'master'

tests/gnutls-cli-debug.sh: don't unset system priority settings

See merge request gnutls/gnutls!1387

5 years agotests/gnutls-cli-debug.sh: don't unset system priority settings
Daiki Ueno [Tue, 9 Feb 2021 14:26:07 +0000 (15:26 +0100)] 
tests/gnutls-cli-debug.sh: don't unset system priority settings

When the test is exercised, GNUTLS_SYSTEM_PRIORITY_FILE is set in many
places, such as TESTS_ENVIRONMENT tests/Makefile.am or a packaging
system that runs the test in a restricted environment.  Unsetting it
after a temporary use forces the remaining part of the test to use the
default system priority, which might not be the intention of the user.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/dupes' into 'master'
Daiki Ueno [Mon, 8 Feb 2021 13:30:15 +0000 (13:30 +0000)] 
Merge branch 'wip/dueno/dupes' into 'master'

gnutls_x509_trust_list_verify_crt2: ignore duplicate certificates

Closes #1131

See merge request gnutls/gnutls!1370

5 years agoMerge branch 'master' into 'master'
Daiki Ueno [Mon, 8 Feb 2021 11:12:28 +0000 (11:12 +0000)] 
Merge branch 'master' into 'master'

Doc: Add missing algorithm keywords to priority string table

See merge request gnutls/gnutls!1385

5 years agognutls_x509_trust_list_verify_crt2: ignore duplicate certificates
Daiki Ueno [Mon, 28 Dec 2020 11:14:13 +0000 (12:14 +0100)] 
gnutls_x509_trust_list_verify_crt2: ignore duplicate certificates

The commit ebb19db9165fed30d73c83bab1b1b8740c132dfd caused a
regression, where duplicate certificates in a certificate chain are no
longer ignored but treated as a non-contiguous segment and that
results in calling the issuer callback, or a verification failure.

This adds a mechanism to record certificates already seen in the
chain, and skip them while still allow the caller to inject missing
certificates.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
Co-authored-by: Andreas Metzler <ametzler@debian.org>
5 years agodoc: Add some missing algorithm keywords to priority string table
Dosenpfand [Sun, 7 Feb 2021 22:17:28 +0000 (23:17 +0100)] 
doc: Add some missing algorithm keywords to priority string table

Signed-off-by: Markus Gasser <m@sad.bz>
5 years agoMerge branch 'wip/dueno/parallel-openssl' into 'master'
Daiki Ueno [Thu, 4 Feb 2021 14:03:25 +0000 (14:03 +0000)] 
Merge branch 'wip/dueno/parallel-openssl' into 'master'

tests: remove hand-written parallelism

Closes #1099

See merge request gnutls/gnutls!1372

5 years agotests: close unused fd opened by socketpair
Daiki Ueno [Wed, 3 Feb 2021 15:05:22 +0000 (16:05 +0100)] 
tests: close unused fd opened by socketpair

Otherwise the tests block forever, even if the child exits.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: remove redundant "make check" in build stage
Daiki Ueno [Wed, 3 Feb 2021 14:56:42 +0000 (15:56 +0100)] 
.gitlab-ci.yml: remove redundant "make check" in build stage

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: TLS 1.3: don't generate session ID in resumption mode
Daiki Ueno [Sun, 24 Jan 2021 06:34:24 +0000 (07:34 +0100)] 
handshake: TLS 1.3: don't generate session ID in resumption mode

The commit e0bb98e1f71f94691f600839ff748d3a9f469d3e revealed that the
previous code always generated session ID in the TLS 1.3 middlebox
compatibility mode even when the handshake is being resumed.

This could cause a difference in PSK binder calculation if the server
sends an HRR in the resumption handshake.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognutls_session_is_resumed: don't check session ID in TLS 1.3
Daiki Ueno [Wed, 3 Feb 2021 14:50:08 +0000 (15:50 +0100)] 
gnutls_session_is_resumed: don't check session ID in TLS 1.3

In middlebox compatibiltiy mode, TLS 1.3 client simulates the TLS 1.2
resumption handshake, so checking session ID for resumption is
pointless.  This worked previously because the client always generated
new random value even in a true resumption handshake, but didn't
update the session parameters properly.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_openpgp_send_fingerprint: remove unused declaration
Daiki Ueno [Thu, 4 Feb 2021 07:39:04 +0000 (08:39 +0100)] 
_gnutls_openpgp_send_fingerprint: remove unused declaration

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_session_is_resumable: remove unused internal function
Daiki Ueno [Thu, 4 Feb 2021 07:38:16 +0000 (08:38 +0100)] 
_gnutls_session_is_resumable: remove unused internal function

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: replace TRUE and FALSE with <stdbool.h>
Daiki Ueno [Thu, 4 Feb 2021 07:56:33 +0000 (08:56 +0100)] 
handshake: replace TRUE and FALSE with <stdbool.h>

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: replace RESUME_TRUE and RESUME_FALSE with <stdbool.h>
Daiki Ueno [Thu, 4 Feb 2021 07:30:30 +0000 (08:30 +0100)] 
handshake: replace RESUME_TRUE and RESUME_FALSE with <stdbool.h>

Having those constants could cause wrong impression that there is a
third possible value.

To reproduce the changes other than lib/gnutls_int.h:

  for i in `git ls-files lib`; do
      sed -i
         -e 's/\(session->internals.\(resumed\|resumable\)\) *\(== *RESUME_FALSE\|!= *RESUME_TRUE\)/!\1/' \
  -e 's/\(session->internals.\(resumed\|resumable\)\) *\(== *RESUME_TRUE\|!= *RESUME_FALSE\)/\1/' \
  -e 's/RESUME_TRUE/true/' \
  -e 's/RESUME_FALSE/false/' \
      $i
  done

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotestcompat-openssl: run TLS 1.3 client/server tests in parallel
Daiki Ueno [Tue, 29 Dec 2020 08:59:06 +0000 (09:59 +0100)] 
testcompat-openssl: run TLS 1.3 client/server tests in parallel

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotestcompat-openssl: remove hand-written parallelism
Daiki Ueno [Tue, 29 Dec 2020 06:26:16 +0000 (07:26 +0100)] 
testcompat-openssl: remove hand-written parallelism

Previously, the test used to launch multiple tests in background and
then join them using shell primitives.  That approach makes the test
slower as it cannot benefit from the automake's parallel test harness,
as well as it makes diagnostic harder because the lines in the log
file mix up.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'check_cert_list_argument' into 'master'
Daiki Ueno [Sun, 31 Jan 2021 11:49:37 +0000 (11:49 +0000)] 
Merge branch 'check_cert_list_argument' into 'master'

Verify that cert_list_size > 0 and cert_list != NULL

See merge request gnutls/gnutls!1379

5 years agotestcompat-polarssl: remove hand-written parallelism
Daiki Ueno [Tue, 29 Dec 2020 09:06:50 +0000 (10:06 +0100)] 
testcompat-polarssl: remove hand-written parallelism

Previously, the test used to launch multiple tests in background and
then join them using shell primitives.  That approach makes the test
slower as it cannot benefit from the automake's parallel test harness,
as well as it makes diagnostic harder because the lines in the log
file mix up.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/fips-dh-memleak' into 'master'
Daiki Ueno [Mon, 25 Jan 2021 15:23:11 +0000 (15:23 +0000)] 
Merge branch 'wip/dueno/fips-dh-memleak' into 'master'

fips: avoid memleak in (EC)DH internal APIs

See merge request gnutls/gnutls!1380

5 years agoMerge branch 'pcert_deinit_on_cleanup' into 'master'
Daiki Ueno [Mon, 25 Jan 2021 13:24:24 +0000 (13:24 +0000)] 
Merge branch 'pcert_deinit_on_cleanup' into 'master'

gnutls_certificate_set_x509_key(): deinitialize pcerts array elements during cleanup

See merge request gnutls/gnutls!1378

5 years agofips: avoid memleak in (EC)DH internal APIs
Daiki Ueno [Fri, 22 Jan 2021 13:37:47 +0000 (14:37 +0100)] 
fips: avoid memleak in (EC)DH internal APIs

There were some confusions of gnutls_pk_params_clear and
gnutls_pk_params_release, as well as the number of parameters to scan
in the gnutls_pk_params_st structure.

Flagged by address sanitizer:
  ==354688==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 192 byte(s) in 12 object(s) allocated from:
      #0 0x7f13506163cf in __interceptor_malloc (/lib64/libasan.so.6+0xab3cf)
      #1 0x7f13503b94de in wrap_nettle_mpi_init /home/ueno/devel/gnutls/lib/nettle/mpi.c:79
      #2 0x7ffcb8495f07  ([stack]+0x1ef07)

  Direct leak of 160 byte(s) in 10 object(s) allocated from:
      #0 0x7f13506163cf in __interceptor_malloc (/lib64/libasan.so.6+0xab3cf)
      #1 0x7f13503b94de in wrap_nettle_mpi_init /home/ueno/devel/gnutls/lib/nettle/mpi.c:79

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoDeinitialize pcerts array elements during cleanup.
Tom Carroll [Sun, 10 Jan 2021 23:28:50 +0000 (15:28 -0800)] 
Deinitialize pcerts array elements during cleanup.

In gnutls_certificate_set_x509_key() cleanup, the pcert elements should
be deinitialized, freeing pcert's pubkey and cert fields.

Signed-off-by: Tom Carroll <incentivedesign@gmail.com>
5 years agoEnsure ca_list != NULL and ca_list_size > 0.
Tom Carroll [Mon, 11 Jan 2021 05:40:52 +0000 (21:40 -0800)] 
Ensure ca_list != NULL and ca_list_size > 0.

As ca_list_size is used in malloc, ensure that ca_list_size > 0.
If ca_list_size > 0, then ca_list cannot be NULL. Make these
assumptions explicit with argument condition check.

Signed-off-by: Tom Carroll <incentivedesign@gmail.com>
5 years agoVerify that cert_list != NULL and cert_list_size > 0.
Tom Carroll [Mon, 11 Jan 2021 05:31:19 +0000 (21:31 -0800)] 
Verify that cert_list != NULL and cert_list_size > 0.

gnutls_certificate_set_x509_key() assumes that cert_list != NULL and
cert_list_size > 0.  These assumptions are evident as cert_list_size is
used for malloc and cert_list[0] is accessed. Make those assumptions
explicit with argument condition check.

Signed-off-by: Tom Carroll <incentivedesign@gmail.com>
5 years agoMerge branch 'no-weak' into 'master'
Daiki Ueno [Sat, 9 Jan 2021 08:07:29 +0000 (08:07 +0000)] 
Merge branch 'no-weak' into 'master'

configure: Remove -no_weak_links from LDFLAGS after detecting function availability

Closes #966

See merge request gnutls/gnutls!1376

5 years agoMerge branch 'wip/dueno/autoconf-2.70' into 'master'
Daiki Ueno [Fri, 8 Jan 2021 19:27:38 +0000 (19:27 +0000)] 
Merge branch 'wip/dueno/autoconf-2.70' into 'master'

gnulib: update git submodule

Closes #1138

See merge request gnutls/gnutls!1374

5 years agoconfigure: Remove -no_weak_links from LDFLAGS after detecting function availability
Martin Storsjo [Thu, 7 Jan 2021 11:41:12 +0000 (13:41 +0200)] 
configure: Remove -no_weak_links from LDFLAGS after detecting function availability

This reverts commit 945a48993dcdd9ead17216e55c59db209923ea5e
and fixes the original issue (#966) differently.

This makes sure that when targeting a version of macOS less than
10.12, we won't pick up and unconditionally use functions that
only appeared later, when building with Xcode 11.4 or newer.
(With Xcode 11.4 or newer, the fix from 945a48993dcdd9 caused
-no_weak_links not be added, affecting the function availability
tests.)

Signed-off-by: Martin Storsjo <martin@martin.st>
5 years agoMerge branch 'ci-rework' into 'master'
Daiki Ueno [Fri, 8 Jan 2021 10:19:43 +0000 (10:19 +0000)] 
Merge branch 'ci-rework' into 'master'

CI pipeline rework - using stages and inheritance

See merge request gnutls/gnutls!1366

5 years agoMerge branch 'github-macos' into 'master'
Airtower [Fri, 8 Jan 2021 07:42:06 +0000 (07:42 +0000)] 
Merge branch 'github-macos' into 'master'

Use Github Actions for MacOS CI

Closes #1140

See merge request gnutls/gnutls!1375

5 years agoUpdate year of copyright notices in doc/gnutls.texi
Fiona Klute [Thu, 7 Jan 2021 19:29:54 +0000 (20:29 +0100)] 
Update year of copyright notices in doc/gnutls.texi

Static analysis in CI checks if this is up to date, and fails if
not. This fixes the failure.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoUpdate CI documentation for use of Github Actions
Fiona Klute [Sat, 2 Jan 2021 17:24:18 +0000 (18:24 +0100)] 
Update CI documentation for use of Github Actions

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoRemove Travis CI configuration
Fiona Klute [Sat, 2 Jan 2021 17:22:55 +0000 (18:22 +0100)] 
Remove Travis CI configuration

Replaced by Github Actions workflow added in
9fc73ec96fa5adfc8e9a4bd2ee9e6543ffcfe120.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoGithub Actions job for MacOS CI
Fiona Klute [Tue, 29 Dec 2020 21:03:53 +0000 (22:03 +0100)] 
Github Actions job for MacOS CI

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoMerge branch 'tmp-limit-gnutls-openssl-exported-symbols' into 'master'
Andreas Metzler [Wed, 30 Dec 2020 10:40:17 +0000 (10:40 +0000)] 
Merge branch 'tmp-limit-gnutls-openssl-exported-symbols' into 'master'

libgnutls-openssl: Clean up list of exported symbols

See merge request gnutls/gnutls!1373

5 years agognulib: update git submodule
Daiki Ueno [Tue, 29 Dec 2020 18:24:28 +0000 (19:24 +0100)] 
gnulib: update git submodule

This brings in the fix for building with autoconf 2.70:
https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00091.html

Suggested by Jan Palus in:
https://gitlab.com/gnutls/gnutls/-/issues/1138

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoFix a common typo of gnutls_priority_t.
Sadie Powell [Fri, 11 Dec 2020 05:39:56 +0000 (05:39 +0000)] 
Fix a common typo of gnutls_priority_t.

Signed-off-by: Sadie Powell <sadie@witchery.services>
5 years agolibgnutls-openssl: Clean up list of exported symbols
Andreas Metzler [Tue, 8 Dec 2020 10:36:57 +0000 (11:36 +0100)] 
libgnutls-openssl: Clean up list of exported symbols

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
5 years agoMerge branch 'wip/dueno/test-fixes' into 'master'
Daiki Ueno [Tue, 29 Dec 2020 12:28:32 +0000 (12:28 +0000)] 
Merge branch 'wip/dueno/test-fixes' into 'master'

fix CI failures on recent Fedora 33 image

Closes #1136 and #1135

See merge request gnutls/gnutls!1371

5 years agotestcompat-openssl: specify -sigalgs on s_client command line
Daiki Ueno [Tue, 29 Dec 2020 08:46:36 +0000 (09:46 +0100)] 
testcompat-openssl: specify -sigalgs on s_client command line

This is a left-over of commit
23958322865a8a77c2f924f569484e5fd150a24b. Otherwise the OpenSSL system
configuration may affect algorithm selection.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotestpkcs11: use datefudge to trick certificate expiry
Daiki Ueno [Mon, 28 Dec 2020 15:16:53 +0000 (16:16 +0100)] 
testpkcs11: use datefudge to trick certificate expiry

The certificates stored in tests/testpkcs11-certs expired on
2020-12-13.  To avoid verification failure due to that, use datefudge
to set custom date when calling gnutls-cli, gnutls-serv, and certtool.

Based on the patch by Andreas Metzler:
https://gitlab.com/gnutls/gnutls/-/issues/1135#note_469682121

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: Fix tpmtool_test due to changes in trousers
Stefan Berger [Mon, 21 Dec 2020 14:36:47 +0000 (09:36 -0500)] 
tests: Fix tpmtool_test due to changes in trousers

Recent changes to trousers now require an ownership of root:tss for
the tcsd config file, older ones requires tss:tss. So, start tcsd
using trial and error with either one of these ownership configurations
until one works.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
5 years agoMerge branch '#1074' into 'master'
Daiki Ueno [Tue, 8 Dec 2020 18:13:53 +0000 (18:13 +0000)] 
Merge branch '#1074' into 'master'

Fix non-empty session id (TLS13_APPENDIX_D4)

Closes #1074

See merge request gnutls/gnutls!1350

5 years agoFix non-empty session id (TLS13_APPENDIX_D4)
Norbert Pocs [Fri, 30 Oct 2020 16:18:30 +0000 (17:18 +0100)] 
Fix non-empty session id (TLS13_APPENDIX_D4)

When TLS1.3 is used with middlebox compatible mode, the session id should be filled with random session id,
but remained empty.

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Closes #1074

5 years agoRelease 3.7.0 3.7.0
Daiki Ueno [Wed, 2 Dec 2020 09:30:08 +0000 (10:30 +0100)] 
Release 3.7.0

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoNEWS: update for 3.7.0 release
Daiki Ueno [Wed, 2 Dec 2020 08:33:21 +0000 (09:33 +0100)] 
NEWS: update for 3.7.0 release

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'ihsinme-master-patch-42280' into 'master'
Daiki Ueno [Tue, 1 Dec 2020 16:32:44 +0000 (16:32 +0000)] 
Merge branch 'ihsinme-master-patch-42280' into 'master'

fix invalid unsigned arithmetic.

See merge request gnutls/gnutls!1364

5 years agofix invalid unsigned arithmetic.
ihsinme [Mon, 30 Nov 2020 14:56:15 +0000 (14:56 +0000)] 
fix invalid unsigned arithmetic.

Signed-off-by: ihsinme <ihsinme@gmail.com>
5 years agoMerge branch 'wip/dueno/fuzzer-fixes' into 'master'
Daiki Ueno [Tue, 1 Dec 2020 12:33:28 +0000 (12:33 +0000)] 
Merge branch 'wip/dueno/fuzzer-fixes' into 'master'

fuzz: fix handshake fuzzer issues spotted by oss-fuzz

See merge request gnutls/gnutls!1363