]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
5 years agoAdd AF_ALG acceleration
Stephan Mueller [Sat, 14 Oct 2017 18:46:09 +0000 (20:46 +0200)] 
Add AF_ALG acceleration

The patch set adds the backend implementation to use the Linux kernel
crypto API via the AF_ALG interface. The GnuTLS AF_ALG extension uses
libkcapi [1] as the backend library which implements the actual kernel
communication.

[1] http://www.chronox.de/libkcapi.html

The symmetric cipher support, the hashing and the MAC support are
validated to work correctly using NIST CAVS test vectors.

The AEAD cipher support was tested by connecting to a remote host using
gnutls-cli (the following log strips out unrelated information):

Processed 143 CA certificate(s).
...
- Certificate type: X.509
- Got a certificate list of 1 certificates.
- Certificate[0] info:
...
- Description: (TLS1.2)-(ECDHE-SECP384R1)-(RSA-SHA512)-(AES-256-GCM)
- Session ID: 9E:5E:FC:09:2A:4E:2A:3D:22:44:68:42:C3:F6:2D:AB:F9:67:08:CE:6D:EE:E4:A2:EF:80:43:FE:3B:D9:1E:FE
- Ephemeral EC Diffie-Hellman parameters
 - Using curve: SECP384R1
 - Curve size: 384 bits
- Version: TLS1.2
- Key Exchange: ECDHE-RSA
- Server Signature: RSA-SHA512
- Cipher: AES-256-GCM
- MAC: AEAD
- Options: extended master secret, safe renegotiation,
- Handshake was completed

- Simple Client Mode:

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Co-authored-by: Daiki Ueno <ueno@gnu.org>
Co-authored-by: Hedgehog5040 <krenzelok.frantisek@gmail.com>
5 years agoMerge branch 'wip/dueno/tls13-compat' into 'master'
Daiki Ueno [Sun, 18 Apr 2021 05:16:25 +0000 (05:16 +0000)] 
Merge branch 'wip/dueno/tls13-compat' into 'master'

priority: add option to disable TLS 1.3 middlebox compatibility mode

Closes #1208

See merge request gnutls/gnutls!1410

5 years agopriority: add option to disable TLS 1.3 middlebox compatibility mode
Daiki Ueno [Fri, 16 Apr 2021 11:56:40 +0000 (13:56 +0200)] 
priority: add option to disable TLS 1.3 middlebox compatibility mode

This adds a new option %DISABLE_TLS13_COMPAT_MODE to disable TLS 1.3
compatibility mode at run-time.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/reallocarray' into 'master'
Daiki Ueno [Tue, 30 Mar 2021 12:54:04 +0000 (12:54 +0000)] 
Merge branch 'wip/dueno/reallocarray' into 'master'

build: avoid potential integer overflow in array allocation

Closes #1179

See merge request gnutls/gnutls!1392

5 years ago_gnutls_calloc: remove unused function
Daiki Ueno [Tue, 30 Mar 2021 11:39:46 +0000 (13:39 +0200)] 
_gnutls_calloc: remove unused function

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/system-keys-w32' into 'master'
Daiki Ueno [Mon, 29 Mar 2021 16:12:28 +0000 (16:12 +0000)] 
Merge branch 'wip/dueno/system-keys-w32' into 'master'

keys-win: free certificate context in gnutls_system_key_iter_deinit

Closes #1197

See merge request gnutls/gnutls!1406

5 years agokeys-win: free certificate context in gnutls_system_key_iter_deinit
Daiki Ueno [Mon, 29 Mar 2021 12:09:51 +0000 (14:09 +0200)] 
keys-win: free certificate context in gnutls_system_key_iter_deinit

Suggested by Bjørn Christensen in:
https://gitlab.com/gnutls/gnutls/-/issues/1197

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobuild: avoid integer overflow in additions
Daiki Ueno [Mon, 29 Mar 2021 09:06:37 +0000 (11:06 +0200)] 
build: avoid integer overflow in additions

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobuild: avoid potential integer overflow in array allocation
Daiki Ueno [Sun, 21 Feb 2021 07:43:26 +0000 (08:43 +0100)] 
build: avoid potential integer overflow in array allocation

This relies on _gnutls_reallocarray for all occasions of array
allocations, so that they can benefit from the built-in overflow
checks.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agopkcs11x: find_ext_cb: fix error propagation
Daiki Ueno [Mon, 29 Mar 2021 11:08:23 +0000 (13:08 +0200)] 
pkcs11x: find_ext_cb: fix error propagation

Use explicit error value, as rv is not set in this code path.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agomem: add _gnutls_reallocarray and _gnutls_reallocarray_fast
Daiki Ueno [Sun, 21 Feb 2021 07:42:23 +0000 (08:42 +0100)] 
mem: add _gnutls_reallocarray and _gnutls_reallocarray_fast

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobootstrap: pull in 'xalloc-oversized' module from Gnulib
Daiki Ueno [Sun, 21 Feb 2021 07:34:13 +0000 (08:34 +0100)] 
bootstrap: pull in 'xalloc-oversized' module from Gnulib

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-missing-gnutls-crypto-layers_png' into 'master'
Andreas Metzler [Sat, 20 Mar 2021 16:45:39 +0000 (16:45 +0000)] 
Merge branch 'tmp-missing-gnutls-crypto-layers_png' into 'master'

build: doc: install missing image file gnutls-crypto-layers.png

See merge request gnutls/gnutls!1405

5 years agobuild: doc: install missing image file gnutls-crypto-layers.png
Andreas Metzler [Sat, 20 Mar 2021 12:52:25 +0000 (13:52 +0100)] 
build: doc: install missing image file gnutls-crypto-layers.png

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
5 years agoMerge branch 'wip/dueno/coverity' into 'master'
Daiki Ueno [Tue, 16 Mar 2021 05:42:45 +0000 (05:42 +0000)] 
Merge branch 'wip/dueno/coverity' into 'master'

Fix resource leaks spotted by coverity

See merge request gnutls/gnutls!1403

5 years agoMerge branch 'wip/dueno/tzalloc-tests' into 'master'
Daiki Ueno [Mon, 15 Mar 2021 12:47:36 +0000 (12:47 +0000)] 
Merge branch 'wip/dueno/tzalloc-tests' into 'master'

gnulib: update git submodule

Closes #1190

See merge request gnutls/gnutls!1402

5 years agoexamples: avoid memory leak in ex-verify
Daiki Ueno [Mon, 15 Mar 2021 10:03:44 +0000 (11:03 +0100)] 
examples: avoid memory leak in ex-verify

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoexamples: avoid memory leak in tlsproxy
Daiki Ueno [Mon, 15 Mar 2021 10:03:22 +0000 (11:03 +0100)] 
examples: avoid memory leak in tlsproxy

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agosrc: avoid file descriptor leak in socket_open2
Daiki Ueno [Mon, 15 Mar 2021 09:56:46 +0000 (10:56 +0100)] 
src: avoid file descriptor leak in socket_open2

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognutls-cli-debug: avoid resource leak in saving DHE params
Daiki Ueno [Mon, 15 Mar 2021 09:48:49 +0000 (10:48 +0100)] 
gnutls-cli-debug: avoid resource leak in saving DHE params

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agosrptool: avoid FILE pointer leak on error
Daiki Ueno [Mon, 15 Mar 2021 09:47:50 +0000 (10:47 +0100)] 
srptool: avoid FILE pointer leak on error

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognulib: update git submodule
Daiki Ueno [Mon, 15 Mar 2021 08:55:20 +0000 (09:55 +0100)] 
gnulib: update git submodule

This brings in the fix for parse-datetime test failures on NetBSD:
https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00069.html
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=35f8ff2e1162bf3ee60d99b6812f2ae10f3f2898

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'oneshot-urandom' into 'master'
Daiki Ueno [Thu, 11 Mar 2021 06:23:03 +0000 (06:23 +0000)] 
Merge branch 'oneshot-urandom' into 'master'

sysrng-linux: re-open /dev/urandom every time

Closes #1188

See merge request gnutls/gnutls!1396

5 years agoMerge branch 'wip/dueno/aggressive-realloc-fixes' into 'master'
Daiki Ueno [Wed, 10 Mar 2021 19:02:59 +0000 (19:02 +0000)] 
Merge branch 'wip/dueno/aggressive-realloc-fixes' into 'master'

Fix issues with AGGRESSIVE_REALLOC

See merge request gnutls/gnutls!1401

5 years agostr: suppress -Wunused-function if AGGRESSIVE_REALLOC is defined
Daiki Ueno [Wed, 10 Mar 2021 15:12:23 +0000 (16:12 +0100)] 
str: suppress -Wunused-function if AGGRESSIVE_REALLOC is defined

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_buffer_resize: account for unused area if AGGRESSIVE_REALLOC
Daiki Ueno [Wed, 10 Mar 2021 15:11:29 +0000 (16:11 +0100)] 
_gnutls_buffer_resize: account for unused area if AGGRESSIVE_REALLOC

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoRelease 3.7.1 3.7.1
Daiki Ueno [Wed, 10 Mar 2021 04:06:13 +0000 (05:06 +0100)] 
Release 3.7.1

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/realloc' into 'master'
Daiki Ueno [Wed, 10 Mar 2021 10:20:31 +0000 (10:20 +0000)] 
Merge branch 'wip/dueno/realloc' into 'master'

gnutls_buffer_append_data: avoid use-after-free in the callers

Closes #1151

See merge request gnutls/gnutls!1399

5 years agoMerge branch 'wip/dueno/getcpuid' into 'master'
Daiki Ueno [Wed, 10 Mar 2021 09:37:49 +0000 (09:37 +0000)] 
Merge branch 'wip/dueno/getcpuid' into 'master'

x86: toggle polarity of check_fast_pclmul

See merge request gnutls/gnutls!1400

5 years agopre_shared_key: avoid use-after-free around realloc
Daiki Ueno [Fri, 29 Jan 2021 13:06:50 +0000 (14:06 +0100)] 
pre_shared_key: avoid use-after-free around realloc

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agokey_share: avoid use-after-free around realloc
Daiki Ueno [Fri, 29 Jan 2021 13:06:32 +0000 (14:06 +0100)] 
key_share: avoid use-after-free around realloc

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_buffer_resize: add option to use allocation simpler logic
Daiki Ueno [Tue, 9 Mar 2021 12:41:59 +0000 (13:41 +0100)] 
_gnutls_buffer_resize: add option to use allocation simpler logic

This helps detect common mistakes[1] in realloc usage with valgrind,
where the caller assumes that the original ptr is always returned.

1. https://bugzilla.mozilla.org/show_bug.cgi?id=1377618

Signed-off-by: Daiki Ueno <ueno@gnu.org>
Co-authored-by: Alexander Sosedkin <asosedkin@redhat.com>
5 years agox86: flip polarity of check_fast_pclmul
Daiki Ueno [Tue, 9 Mar 2021 19:29:37 +0000 (20:29 +0100)] 
x86: flip polarity of check_fast_pclmul

Otherwise GCC produces the following warnings as the stub
__get_cpuid() is defined as '#define __get_cpuid(...) 0':

x86-common.c: In function 'register_x86_crypto':
x86-common.c:314:15: warning: 'a' may be used uninitialized in this function [-Wmaybe-uninitialized]
  314 |  family = ((a >> 8) & 0x0F);
      |            ~~~^~~~~
x86-common.c:308:15: note: 'a' was declared here
  308 |  unsigned int a,b,c,d;
      |               ^

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognutls_buffer_append_data: remove duplicated code
Daiki Ueno [Tue, 9 Mar 2021 12:07:26 +0000 (13:07 +0100)] 
gnutls_buffer_append_data: remove duplicated code

The function shared the same logic as in _gnutls_buffer_resize.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agolib/nettle: get rid of _rnd_system_entropy_check
Alexander Sosedkin [Mon, 8 Mar 2021 13:56:32 +0000 (14:56 +0100)] 
lib/nettle: get rid of _rnd_system_entropy_check

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
5 years agolib/global: don't call now-noop _gnutls_rnd_check
Alexander Sosedkin [Mon, 8 Mar 2021 10:54:16 +0000 (11:54 +0100)] 
lib/global: don't call now-noop _gnutls_rnd_check

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
5 years agosysrng-linux: re-open /dev/urandom every time
Alexander Sosedkin [Thu, 4 Mar 2021 09:54:44 +0000 (10:54 +0100)] 
sysrng-linux: re-open /dev/urandom every time

Prompted by the following comment of Daiki Ueno:
> I also wonder why we keep the fd open for such a long time in the first
> place. Both OpenSSL and NSS have a similar fallback to /dev/urandom
> if getrandom is not available, but opens the device in one-shot,
> when reseeding is needed (and that's pretty rare).
https://gitlab.com/gnutls/gnutls/-/merge_requests/1383#note_521749519

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
5 years agoMerge branch 'wip/dueno/duplicate-certs-pkcs11' into 'master'
Daiki Ueno [Sat, 6 Mar 2021 07:24:23 +0000 (07:24 +0000)] 
Merge branch 'wip/dueno/duplicate-certs-pkcs11' into 'master'

gnutls_x509_trust_list_verify_crt2: skip duplicated certs for PKCS#11 too

See merge request gnutls/gnutls!1398

5 years agoMerge branch 'fix-id-on-xmppAddr' into 'master'
Daiki Ueno [Fri, 5 Mar 2021 17:42:15 +0000 (17:42 +0000)] 
Merge branch 'fix-id-on-xmppAddr' into 'master'

output UTF-8 decoded id-on-xmppAddr SAN's

See merge request gnutls/gnutls!1397

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>