]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
4 years agoMerge branch 'wip/dueno/system_wide_priority_strings_init' into 'master'
Daiki Ueno [Fri, 5 Nov 2021 14:08:17 +0000 (14:08 +0000)] 
Merge branch 'wip/dueno/system_wide_priority_strings_init' into 'master'

priority: rework config reloading logic and locking

See merge request gnutls/gnutls!1483

4 years agopriority: rework config reloading logic and locking
Daiki Ueno [Sat, 30 Oct 2021 15:17:47 +0000 (17:17 +0200)] 
priority: rework config reloading logic and locking

The previous reloading logic relied on the existence of [priority]
section (in the initial loading) as an indicator whether the file is
loaded.  This didn't work well in the following cases:
- when the section didn't exist initially and then is added later
- when the section existed initially and then is removed later
To handle these cases, this change adds a new flag
system_priority_file_loaded which can be used together with the mtime
check.

This also adds an rwlock to protect global configuration.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoRevert "priority: fix potential race in reloading system-wide config"
Daiki Ueno [Mon, 1 Nov 2021 15:46:50 +0000 (16:46 +0100)] 
Revert "priority: fix potential race in reloading system-wide config"

This reverts commit 890c6937a3cfb4a0704bc815324221ec4cb89840.
Considering the entire logic around reloading the config file, the fix
was suboptimal.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/abi-dump-release' into 'master'
Daiki Ueno [Sat, 30 Oct 2021 15:28:47 +0000 (15:28 +0000)] 
Merge branch 'wip/dueno/abi-dump-release' into 'master'

devel: update release procedure taking into account of abi-dump

See merge request gnutls/gnutls!1481

4 years agoMerge branch 'wip/dueno/priority-race' into 'master'
Daiki Ueno [Sat, 30 Oct 2021 08:49:28 +0000 (08:49 +0000)] 
Merge branch 'wip/dueno/priority-race' into 'master'

priority: fix potential race in reloading system-wide config

See merge request gnutls/gnutls!1482

4 years agopriority: fix potential race in reloading system-wide config
Daiki Ueno [Thu, 28 Oct 2021 16:55:26 +0000 (18:55 +0200)] 
priority: fix potential race in reloading system-wide config

_gnutls_update_system_priorities is called from gnutls_priority_set*
functions every time when the SYSTEM keyword is used and updates a
global variable system_wide_priority_strings if the configuration
changes.  Although the critical path is protected with mtime check, it
should also hold a lock to avoid occasional race condition in
multi-thread programs.  This also clears
system_wide_priority_strings_init upon unloading and before reloading
the config file (thanks to Alexander Sosedkin).

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/asosedki/gitlab-ci-speed-up-cppcheck' into 'master'
Daiki Ueno [Thu, 28 Oct 2021 17:04:11 +0000 (17:04 +0000)] 
Merge branch 'wip/asosedki/gitlab-ci-speed-up-cppcheck' into 'master'

.gitlab-ci.yml: add caching to cppcheck

See merge request gnutls/gnutls!1480

4 years ago.gitlab-ci.yml: add caching to cppcheck
Alexander Sosedkin [Thu, 21 Oct 2021 10:46:56 +0000 (12:46 +0200)] 
.gitlab-ci.yml: add caching to cppcheck

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agodevel: update release procedure taking into account of abi-dump
Daiki Ueno [Tue, 26 Oct 2021 05:50:16 +0000 (07:50 +0200)] 
devel: update release procedure taking into account of abi-dump

As the *.abi files have been moved into a separate repository, we need
an extra step to update the repository for new release.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/asosedki/hash-filters-prf' into 'master'
Daiki Ueno [Thu, 21 Oct 2021 10:56:06 +0000 (10:56 +0000)] 
Merge branch 'wip/asosedki/hash-filters-prf' into 'master'

make insecure-hash filter out ciphersuites on ->prf as well

See merge request gnutls/gnutls!1479

4 years agoNEWS: add a notice of insecure-hash filtering ciphersuites on PRF
Alexander Sosedkin [Wed, 20 Oct 2021 15:49:56 +0000 (17:49 +0200)] 
NEWS: add a notice of insecure-hash filtering ciphersuites on PRF

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotests: add system-override-hash-influences-prf
Alexander Sosedkin [Wed, 20 Oct 2021 12:37:07 +0000 (14:37 +0200)] 
tests: add system-override-hash-influences-prf

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agopriority: filter out ciphersuites with prf blocked by insecure-hash
Alexander Sosedkin [Wed, 20 Oct 2021 12:36:44 +0000 (14:36 +0200)] 
priority: filter out ciphersuites with prf blocked by insecure-hash

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agopriority: refactor ciphersuite filtering
Alexander Sosedkin [Wed, 20 Oct 2021 12:34:58 +0000 (14:34 +0200)] 
priority: refactor ciphersuite filtering

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agoMerge branch 'ktls' into 'master'
Daiki Ueno [Wed, 20 Oct 2021 06:36:45 +0000 (06:36 +0000)] 
Merge branch 'ktls' into 'master'

ktls: basic implementation of SW mode

See merge request gnutls/gnutls!1451

4 years agoktls: basic implementation of SW mode
Hedgehog5040 [Fri, 14 May 2021 13:56:06 +0000 (15:56 +0200)] 
ktls: basic implementation of SW mode

ktls enables us to offload encryption/decryption to the kernel

prerequisites:
- configured with `--enable-ktls`
- tls module `modprobe tls` check with 'lsmod | grep tls'
- per connection:
gnutls_transport_set_int{2} must be set

When prerequisities are met then ktls is used by default.

If GnuTLS encounters a error during KTLS initialization, it will
not use ktls and fallback to userspace.

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
4 years agoMerge branch 'wip/dueno/abi-dump' into 'master'
František Krenželok [Tue, 19 Oct 2021 13:16:57 +0000 (13:16 +0000)] 
Merge branch 'wip/dueno/abi-dump' into 'master'

devel: move .abi files into a separate repository

See merge request gnutls/gnutls!1478

4 years agodevel: make use of abidw --drop-private-types
Daiki Ueno [Mon, 18 Oct 2021 14:27:46 +0000 (16:27 +0200)] 
devel: make use of abidw --drop-private-types

This will produce more compact abixml output.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agodevel: move .abi files into a separate repository
Daiki Ueno [Mon, 18 Oct 2021 09:49:46 +0000 (11:49 +0200)] 
devel: move .abi files into a separate repository

Changes to the .abi files are a bit too noisy to track in the main
repository.  This moves the files out of this repository and embed it
as a git submodule.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'mingw64-detection' into 'master'
Daiki Ueno [Fri, 24 Sep 2021 05:45:10 +0000 (05:45 +0000)] 
Merge branch 'mingw64-detection' into 'master'

fix mingw64 detection

See merge request gnutls/gnutls!1476

4 years agofix mingw64 detection
Steve Lhomme [Thu, 23 Sep 2021 07:03:50 +0000 (09:03 +0200)] 
fix mingw64 detection

__MINGW64__ is only defined for 64 bits builds of mingw64 [1].
The intended test what to only use the CertEnumCRLsInStoreFunc via LoadLibrary
for some ancient mingw32 build and never for mingw64.

__MINGW64_VERSION_MAJOR is a proper define to identify mingw64 against mingw32.

[1] https://sourceforge.net/p/predef/wiki/Compilers/

Co-authored-by: Johannes Kauffmann <johanneskauffmann@hotmail.com>
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
4 years agoMerge branch 'x25519-and-x448' into 'master'
Daiki Ueno [Thu, 23 Sep 2021 07:50:38 +0000 (07:50 +0000)] 
Merge branch 'x25519-and-x448' into 'master'

certtool: generate, parse, and manipulate X25519 and X448 pubkeys, privkeys, and certificates

See merge request gnutls/gnutls!1428

4 years agoMerge branch 'wip/dueno/shake' into 'master'
Daiki Ueno [Mon, 20 Sep 2021 15:24:04 +0000 (15:24 +0000)] 
Merge branch 'wip/dueno/shake' into 'master'

wrap_nettle_hash_exists: add missing hash algorithms

See merge request gnutls/gnutls!1473

4 years agowrap_nettle_hash_exists: add missing hash algorithms
Daiki Ueno [Fri, 17 Sep 2021 09:03:25 +0000 (11:03 +0200)] 
wrap_nettle_hash_exists: add missing hash algorithms

This adds SHAKE-128, SHAKE-256, and RIPEMD-160 to the supported
algorithms by nettle.  While SHAKEs are not a hash algorithm but an
XOF, it would be consistent to report they are implemented.

The simple test is expanded to exercise the code
path (gnutls_digest_get_id → wrap_nettle_hash_exists).

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/oss-fuzz-focal' into 'master'
Daiki Ueno [Sat, 18 Sep 2021 07:12:05 +0000 (07:12 +0000)] 
Merge branch 'wip/dueno/oss-fuzz-focal' into 'master'

fuzz: explicitly supply LDFLAGS to clang++ command line

See merge request gnutls/gnutls!1474

4 years agofuzz: explicitly supply LDFLAGS to clang++ command line
Daiki Ueno [Sat, 18 Sep 2021 05:18:59 +0000 (07:18 +0200)] 
fuzz: explicitly supply LDFLAGS to clang++ command line

This prevented fuzzer programs being linked in Ubuntu 20.03, used in
oss-fuzz.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agolib/x509: Avoid memcpy when string is empty
Daniel Kahn Gillmor [Fri, 17 Sep 2021 20:37:24 +0000 (16:37 -0400)] 
lib/x509: Avoid memcpy when string is empty

This fixes an ASAN warning in fuzz/gnutls_private_key_parser_fuzzer
when run against the malformed private key
fuzz/gnutls_private_key_parser_fuzzer.in/10a5c92fa30ddb6cbb4286d7699b2b7a7e032b17

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agoNEWS: added news about certtool handling x448 and x25519
Daniel Kahn Gillmor [Wed, 11 Aug 2021 21:31:40 +0000 (17:31 -0400)] 
NEWS: added news about certtool handling x448 and x25519

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agotests: add test for generating x25519 and x448 certificates
Daniel Kahn Gillmor [Wed, 11 Aug 2021 19:59:21 +0000 (15:59 -0400)] 
tests: add test for generating x25519 and x448 certificates

These certs should work just fine for the purposes of cryptographic
e-mail (S/MIME).

These usage flags are also used in the end-entity certificates found
in https://datatracker.ietf.org/doc/draft-ietf-lamps-samples/

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agotests: update details about sample X25519 certificate
Daniel Kahn Gillmor [Fri, 14 May 2021 21:14:41 +0000 (17:14 -0400)] 
tests: update details about sample X25519 certificate

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agocerttool: add x448 and x25519 for --key-type
Daniel Kahn Gillmor [Sat, 8 May 2021 00:14:53 +0000 (20:14 -0400)] 
certtool: add x448 and x25519 for --key-type

This is a simple extension of the certtool command-line interface.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agocerttool: when making X25519 or X448 certs, always use "key agreement"
Daniel Kahn Gillmor [Sat, 8 May 2021 02:25:41 +0000 (22:25 -0400)] 
certtool: when making X25519 or X448 certs, always use "key agreement"

This is related to #1227 -- but in this case, it's enforcing a
requirement of RFC 8410 §5.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agox509: handle X25519 and X448 in read_pubkey
Daniel Kahn Gillmor [Sat, 8 May 2021 01:53:47 +0000 (21:53 -0400)] 
x509: handle X25519 and X448 in read_pubkey

_gnutls_x509_read_ecdh_pubkey is basically a clone of
_gnutls_x509_read_eddsa_pubkey.  Another form of implementation
would be to collapse these two static functions into a common
function for all "CFRG" curves.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agonettle: handle X25519 and X448 in pk_fixup
Daniel Kahn Gillmor [Sat, 8 May 2021 01:30:53 +0000 (21:30 -0400)] 
nettle: handle X25519 and X448 in pk_fixup

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agox509: enable importing secret keys for X448 and X25519.
Daniel Kahn Gillmor [Sat, 8 May 2021 00:23:41 +0000 (20:23 -0400)] 
x509: enable importing secret keys for X448 and X25519.

_decode_pkcs8_modern_ecdh_key is virtually the same as
_decode_pkcs8_eddsa_key.  Another implementation would be
to collapse these two functions into one, since their structure
is identical.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agoEnable X25519 and X448 everywhere that EdDSA is supported.
Daniel Kahn Gillmor [Fri, 7 May 2021 23:53:28 +0000 (19:53 -0400)] 
Enable X25519 and X448 everywhere that EdDSA is supported.

These are just trivial extension points where the codepath is the same
for the ECDH scheme as it is for the EdDSA scheme.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agox509: handle X448 and X25519 in write_pubkey
Daniel Kahn Gillmor [Sat, 8 May 2021 00:14:07 +0000 (20:14 -0400)] 
x509: handle X448 and X25519 in write_pubkey

This uses the same structure as _gnutls_x509_write_eddsa_pubkey.

Another way to write this would be to combine those two functions,
despite X448 and X25519 not being EdDSA at all.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agopubkey: handle X25519 and X448 in gnutls_pubkey_import_pkcs11
Daniel Kahn Gillmor [Sat, 8 May 2021 00:12:15 +0000 (20:12 -0400)] 
pubkey: handle X25519 and X448 in gnutls_pubkey_import_pkcs11

I am not confident in the strings I chose to match on in
ASN1_ETYPE_PRINTABLE_STRING, in that I do not know what registry
I should look this up in.

The *parse_ecc_ecdh_params and *import_ecc_ecdh functions are tweaked
analogs to the eddsa versions of those functions.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agonettle: extend pk_verify_priv_params to handle X25519 and X448
Daniel Kahn Gillmor [Fri, 7 May 2021 23:48:10 +0000 (19:48 -0400)] 
nettle: extend pk_verify_priv_params to handle X25519 and X448

This is basically a copy of the EdDSA case in the switch statement.

Another way to implement it would be to augment the EdDSA case (and
the functions it uses) to have that case also handle ECDH use of the
CFRG curves.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agolib/pk: treat modern ECDH octet streams the same way as eddsa streams.
Daniel Kahn Gillmor [Fri, 7 May 2021 23:36:14 +0000 (19:36 -0400)] 
lib/pk: treat modern ECDH octet streams the same way as eddsa streams.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agolib/algorithms: add modern ecdh functions comparable to curve_is_eddsa
Daniel Kahn Gillmor [Fri, 7 May 2021 23:34:59 +0000 (19:34 -0400)] 
lib/algorithms: add modern ecdh functions comparable to curve_is_eddsa

This is useful for the so-called CFRG curves used in ECDH, x25519 and x448.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agoalgorithms: Explicitly name ECDH_X448_OID and ECDH_X25519_OID
Daniel Kahn Gillmor [Thu, 6 May 2021 18:10:46 +0000 (14:10 -0400)] 
algorithms: Explicitly name ECDH_X448_OID and ECDH_X25519_OID

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agoMerge branch 'wip/dueno/asan-aggressive' into 'master'
Daiki Ueno [Sat, 11 Sep 2021 05:04:44 +0000 (05:04 +0000)] 
Merge branch 'wip/dueno/asan-aggressive' into 'master'

.gitlab-ci.yml: new ASan job with -DAGGRESSIVE_REALLOC

See merge request gnutls/gnutls!1472

4 years ago.gitlab-ci.yml: new ASan job with -DAGGRESSIVE_REALLOC
Daiki Ueno [Fri, 10 Sep 2021 15:08:52 +0000 (17:08 +0200)] 
.gitlab-ci.yml: new ASan job with -DAGGRESSIVE_REALLOC

This would exercise the same logic currently covered with
fedora-valgrind-aggressive in each MR.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'tmp-abi-check' into 'master'
Daiki Ueno [Fri, 10 Sep 2021 13:47:33 +0000 (13:47 +0000)] 
Merge branch 'tmp-abi-check' into 'master'

devel: provide external git diff driver for *.abi files

See merge request gnutls/gnutls!1214

4 years agoMerge branch 'wip/dueno/oss-fuzz-muldefs' into 'master'
Daiki Ueno [Fri, 10 Sep 2021 04:43:34 +0000 (04:43 +0000)] 
Merge branch 'wip/dueno/oss-fuzz-muldefs' into 'master'

fuzz: allow multiple definitions of gnutls_rnd in oss-fuzz

See merge request gnutls/gnutls!1471

4 years agofuzz: allow multiple definitions of gnutls_rnd in oss-fuzz
Daiki Ueno [Thu, 9 Sep 2021 16:36:46 +0000 (18:36 +0200)] 
fuzz: allow multiple definitions of gnutls_rnd in oss-fuzz

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/lgtm' into 'master'
Daiki Ueno [Thu, 9 Sep 2021 11:27:48 +0000 (11:27 +0000)] 
Merge branch 'wip/dueno/lgtm' into 'master'

Suppress warnings spotted by LGTM

See merge request gnutls/gnutls!1470

4 years agobuild: remove tautological if conditions
Daiki Ueno [Thu, 9 Sep 2021 07:46:04 +0000 (09:46 +0200)] 
build: remove tautological if conditions

Spotted by LGTM.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoext/{client,server}_cert_type: use proper types for integers
Daiki Ueno [Thu, 9 Sep 2021 07:38:21 +0000 (09:38 +0200)] 
ext/{client,server}_cert_type: use proper types for integers

Spotted by LGTM.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/pythonpath' into 'master'
Daiki Ueno [Tue, 7 Sep 2021 17:51:09 +0000 (17:51 +0000)] 
Merge branch 'wip/dueno/pythonpath' into 'master'

tls-fuzzer: update submodules to the latest

See merge request gnutls/gnutls!1469

4 years agotests: use PYTHONPATH instead of creating symlinks in srcdir
Daiki Ueno [Mon, 6 Sep 2021 13:51:41 +0000 (15:51 +0200)] 
tests: use PYTHONPATH instead of creating symlinks in srcdir

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agotls-fuzzer: update submodules to the latest
Daiki Ueno [Tue, 7 Sep 2021 15:56:02 +0000 (17:56 +0200)] 
tls-fuzzer: update submodules to the latest

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'ssse3-sha384' into 'master'
Daiki Ueno [Tue, 7 Sep 2021 15:41:23 +0000 (15:41 +0000)] 
Merge branch 'ssse3-sha384' into 'master'

fix SSSE3 SHA384 to work more than once

See merge request gnutls/gnutls!1466

4 years agofix SSSE3 SHA384 to work more than once
Miroslav Lichvar [Wed, 1 Sep 2021 13:48:27 +0000 (15:48 +0200)] 
fix SSSE3 SHA384 to work more than once

The output function called sha512_digest() instead of sha384_digest(),
which caused the hash context to be reinitialized for SHA512 instead of
SHA384 and all following digests using the hash handle were wrong.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
4 years agoMerge branch 'wip/dueno/disable-0rtt-tests' into 'master'
Daiki Ueno [Tue, 7 Sep 2021 13:38:34 +0000 (13:38 +0000)] 
Merge branch 'wip/dueno/disable-0rtt-tests' into 'master'

testcompat-openssl-tls13-cli.sh: disable early data testing for CI stability

See merge request gnutls/gnutls!1468

4 years agotestcompat-openssl-tls13-cli.sh: disable early data testing
Daiki Ueno [Sat, 4 Sep 2021 08:38:23 +0000 (10:38 +0200)] 
testcompat-openssl-tls13-cli.sh: disable early data testing

This test is causing intermittent failure quite often in the CI.
Let's temporarily disable it until the cause is properly investigated.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agotestcompat-openssl-tls13-cli.sh: use different tmpdirs for sub-tests
Daiki Ueno [Sun, 5 Sep 2021 16:48:09 +0000 (18:48 +0200)] 
testcompat-openssl-tls13-cli.sh: use different tmpdirs for sub-tests

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agotests: rework port locking
Daiki Ueno [Sun, 5 Sep 2021 15:28:43 +0000 (17:28 +0200)] 
tests: rework port locking

This makes the locking logic per port, not per entire make process.
It also makes use of absolute paths for locking directory, so that
tlsfuzzer tests can use it.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'fix-tls13-post-hanshake-with-cert' into 'master'
Daiki Ueno [Wed, 1 Sep 2021 14:15:33 +0000 (14:15 +0000)] 
Merge branch 'fix-tls13-post-hanshake-with-cert' into 'master'

tests/tls13/post-handshake-with-cert: avoid a race condition

See merge request gnutls/gnutls!1464

4 years agoMerge branch 'terminate-fixes' into 'master'
Daiki Ueno [Tue, 31 Aug 2021 18:37:55 +0000 (18:37 +0000)] 
Merge branch 'terminate-fixes' into 'master'

Avoid tests killing entire process groups

See merge request gnutls/gnutls!1463

4 years agotests/tls13/post-handshake-with-cert: avoid a race condition
Alexander Sosedkin [Mon, 30 Aug 2021 17:26:49 +0000 (19:26 +0200)] 
tests/tls13/post-handshake-with-cert: avoid a race condition

A server tries to close connection and kill the client after reauth.
Client, in turn, attempts to send data in some cases.
This patch makes the server wait for the client to terminate first.

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotests: remove unused `terminate` from 2 tests
Alexander Sosedkin [Mon, 30 Aug 2021 17:38:03 +0000 (19:38 +0200)] 
tests: remove unused `terminate` from 2 tests

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotests: add a safeguard to terminate()
Alexander Sosedkin [Fri, 27 Aug 2021 15:10:37 +0000 (17:10 +0200)] 
tests: add a safeguard to terminate()

Add a safeguard to `terminate()` so that we don't kill whole pgroups.

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotests: don't kill whole pgroups
Alexander Sosedkin [Fri, 27 Aug 2021 15:02:51 +0000 (17:02 +0200)] 
tests: don't kill whole pgroups

`terminate()` executed from the child process results in a `kill(0, SIGTERM)`,
bringing the whole pgroup down. `exit(1)` should be called instead.

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agoMerge branch 'build_docs' into 'master'
Daiki Ueno [Thu, 26 Aug 2021 17:56:39 +0000 (17:56 +0000)] 
Merge branch 'build_docs' into 'master'

INSTALL.md: Update documentation on building static library

See merge request gnutls/gnutls!1462

4 years agoINSTALL.md: Update documentation on building static library [skip ci]
Nick Child [Wed, 25 Aug 2021 19:13:07 +0000 (15:13 -0400)] 
INSTALL.md: Update documentation on building static library [skip ci]

As of commit a88eb79d88c53531c49d7cedfce2207f36ac8a9d, building a
static archive (libgnutls.a) is off by default. This commit updates the
documentation for building a static library in INSTALL.md .

Signed-off-by: Nick Child <nick.child@ibm.com>
4 years agoMerge branch 'wip/dueno/guile-fixes' into 'master'
Daiki Ueno [Thu, 26 Aug 2021 07:32:47 +0000 (07:32 +0000)] 
Merge branch 'wip/dueno/guile-fixes' into 'master'

guile: Add 'gnutls_x509_crt_get_fingerprint',  'GNUTLS_DIG_SHA256'

See merge request gnutls/gnutls!1461

4 years agoguile: Add 'GNUTLS_DIG_SHA256' enum value.
Simon South [Sun, 22 Aug 2021 06:41:36 +0000 (08:41 +0200)] 
guile: Add 'GNUTLS_DIG_SHA256' enum value.

* guile/modules/gnutls/build/enums.scm (%digest-enum): Add 'sha256'.
* guile/modules/gnutls.in: Export 'digest/sha256'.
* guile/tests/x509-certificates.scm: Test 'digest/sha256' with
'x509-certificate-fingerprint'.
(%sha256-fingerprint): New constant.

Signed-off-by: Simon South <simon@simonsouth.net>
4 years agoguile: Add binding for 'gnutls_x509_crt_get_fingerprint'.
Simon South [Sun, 22 Aug 2021 06:40:14 +0000 (08:40 +0200)] 
guile: Add binding for 'gnutls_x509_crt_get_fingerprint'.

* guile/src/core.c (MAX_HASH_SIZE): New constant.
(scm_gnutls_x509_certificate_fingerprint): New function.
* guile/modules/gnutls.in: Export 'x509-certificate-fingerprint'.
* guile/tests/x509-certificates.scm: Test 'x509-certificate-fingerprint'.
(%sha1-fingerprint): New constant.
(u8vector->hex-string): New procedure.

Signed-off-by: Simon South <simon@simonsouth.net>
4 years agoMerge branch 'master' into 'master'
Daiki Ueno [Mon, 16 Aug 2021 05:35:23 +0000 (05:35 +0000)] 
Merge branch 'master' into 'master'

x509: pin/password callback support for openssl encrypted private keys

See merge request gnutls/gnutls!1459

4 years agox509: pin/password callback support for openssl encrypted private keys
Craig Gallek [Wed, 11 Aug 2021 16:54:37 +0000 (12:54 -0400)] 
x509: pin/password callback support for openssl encrypted private keys

This attempts to use the registered pin callback when the password for
an encrypted openssl private key is not supplied.  This matches the
functionality for PKCS8 sealed keys above and is similar to what openssl
does in this situation.

Signed-off-by: Craig Gallek <cgallek@gmail.com>
4 years agoMerge branch 'wip/dueno/asan-poisoning' into 'master'
Daiki Ueno [Tue, 10 Aug 2021 12:26:04 +0000 (12:26 +0000)] 
Merge branch 'wip/dueno/asan-poisoning' into 'master'

mem: instrument with ASan memory poisoning as well as valgrind

Closes #1260

See merge request gnutls/gnutls!1458

4 years agomem: instrument with ASan memory poisoning as well as valgrind
Daiki Ueno [Sat, 7 Aug 2021 07:16:50 +0000 (09:16 +0200)] 
mem: instrument with ASan memory poisoning as well as valgrind

This makes it possible to catch undefined memory access in the more
lightweight CI runs.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/tls13-rsa-pss-salt' into 'master'
Daiki Ueno [Sat, 7 Aug 2021 09:14:59 +0000 (09:14 +0000)] 
Merge branch 'wip/dueno/tls13-rsa-pss-salt' into 'master'

pk: add flags to force RSA-PSS salt length to match digest length

Closes #1258

See merge request gnutls/gnutls!1455

5 years agopk: add flags to force RSA-PSS salt length to match digest length
Daiki Ueno [Mon, 2 Aug 2021 16:32:28 +0000 (18:32 +0200)] 
pk: add flags to force RSA-PSS salt length to match digest length

This adds a couple of flags to RSA-PSS signing and verification, to
enforce that the salt length matches the digest length.  That is not
only recommended in RFC 4055, but also mandated in RFC 8446 in the TLS
1.3 context.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/fips-rsa-key-size' into 'master'
Daiki Ueno [Thu, 5 Aug 2021 11:39:36 +0000 (11:39 +0000)] 
Merge branch 'wip/dueno/fips-rsa-key-size' into 'master'

fips: allow more RSA modulus sizes

See merge request gnutls/gnutls!1453

5 years agofips: allow more RSA modulus sizes
Daiki Ueno [Wed, 21 Jul 2021 08:34:23 +0000 (10:34 +0200)] 
fips: allow more RSA modulus sizes

Previously, we restricted RSA modulus size to be either 2048 or 3072
bits in FIPS mode, following FIPS 186-4.  On the other hand, FIPS
140-2 IG A.14 and FIPS 140-3 IG C.F updates it to allow arbitrary
modulus sizes equal to or larger than 2048 bits under certain
conditions.

This change reflects the guidance, though it only allows known sizes
due to the complexity of calculating the approximate security strength
using the formula in FIPS 140-2 IG 7.5.

Suggested-by: Stephan Mueller
Reviewed-by: Stephan Mueller
Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/test-key-share-single' into 'master'
Daiki Ueno [Wed, 4 Aug 2021 12:21:48 +0000 (12:21 +0000)] 
Merge branch 'wip/dueno/test-key-share-single' into 'master'

tests: tls13/key_share: rewrite as single process

See merge request gnutls/gnutls!1457

5 years agotests: tls13/key_share: rewrite as single process
Daiki Ueno [Tue, 3 Aug 2021 12:17:41 +0000 (14:17 +0200)] 
tests: tls13/key_share: rewrite as single process

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/cppcheck' into 'master'
Daiki Ueno [Wed, 4 Aug 2021 07:52:00 +0000 (07:52 +0000)] 
Merge branch 'wip/dueno/cppcheck' into 'master'

devel: suppress cppcheck 2.5 false-positives

See merge request gnutls/gnutls!1456

5 years ago.gitlab-ci.yml: cppcheck: disable style checks
Daiki Ueno [Wed, 4 Aug 2021 04:45:30 +0000 (06:45 +0200)] 
.gitlab-ci.yml: cppcheck: disable style checks

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodevel: suppress cppcheck 2.5 false-positives
Daiki Ueno [Tue, 3 Aug 2021 09:44:52 +0000 (11:44 +0200)] 
devel: suppress cppcheck 2.5 false-positives

This fixes errors and warnings as well as some style issues spotted by
cppcheck 2.5.  Others are recorded in the suppressions file.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'fix-ocsp-signer-check' into 'master'
Daiki Ueno [Wed, 14 Jul 2021 14:16:53 +0000 (14:16 +0000)] 
Merge branch 'fix-ocsp-signer-check' into 'master'

gnutls_ocsp_resp_verify: Check key purpose if signer not on trust list

Closes #1254

See merge request gnutls/gnutls!1452

5 years agognutls_ocsp_resp_verify: Check key purpose if signer not on trust list
Fiona Klute [Tue, 13 Jul 2021 21:53:12 +0000 (23:53 +0200)] 
gnutls_ocsp_resp_verify: Check key purpose if signer not on trust list

According to [1] the id-kp-OCSPSigning key purpose is only needed for
delegated signers, not signers explicitly set as trusted. The previous
code would reject a signature directly from a CA on the trust list
(without delegation) because the CA certificate didn't contain the
id-kp-OCSPSigning key purpose.

The tests included in this commit check:

1. Is a signature directly from a CA on the trust list accepted?

2. Is a signature from a delegated signer issued by a CA on the trust
   list accepted?

3. Is a signature from a certificate without id-kp-OCSPSigning issued
   by a CA on the trust list rejected?

Note that the CA in these tests is also the one that issued the
certificate the OCSP response is for, but the code (current and
previous) doesn't enforce this.

[1] https://datatracker.ietf.org/doc/html/rfc6960#section-4.2.2.2

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoMerge branch 'wip/dueno/sh-tests' into 'master'
Daiki Ueno [Mon, 28 Jun 2021 07:07:31 +0000 (07:07 +0000)] 
Merge branch 'wip/dueno/sh-tests' into 'master'

tests: set SH_LOG_COMPILER so sh tests run under $(SHELL)

See merge request gnutls/gnutls!1450

5 years agotests: set SH_LOG_COMPILER so sh tests run under $(SHELL)
Daiki Ueno [Mon, 28 Jun 2021 05:04:55 +0000 (07:04 +0200)] 
tests: set SH_LOG_COMPILER so sh tests run under $(SHELL)

This omits the need of setting executable bits on shell script tests.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/kshare-x25519-x448' into 'master'
Daiki Ueno [Fri, 25 Jun 2021 12:04:43 +0000 (12:04 +0000)] 
Merge branch 'wip/dueno/kshare-x25519-x448' into 'master'

key_share: treat X25519 and X448 as same PK type when advertising

Closes #1249

See merge request gnutls/gnutls!1449

5 years agokey_share: treat X25519 and X448 as same PK type when advertising
Daiki Ueno [Fri, 25 Jun 2021 06:39:12 +0000 (08:39 +0200)] 
key_share: treat X25519 and X448 as same PK type when advertising

Previously, if both X25519 and X448 groups were enabled in the
priority string, the client sent both algorithms in a key_share
extension, while it was only capable of handling one algorithm from
the same (Edwards curve) category.  This adds an extra check so the
client should send either X25519 or X448.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'mcatanzaro/set-trust-list-return' into 'master'
Daiki Ueno [Thu, 24 Jun 2021 13:20:05 +0000 (13:20 +0000)] 
Merge branch 'mcatanzaro/set-trust-list-return' into 'master'

Fix gnutls_certificate_set_trust_list() return value documentation

See merge request gnutls/gnutls!1448

5 years agoFix gnutls_certificate_set_trust_list() return value documentation
Michael Catanzaro [Tue, 22 Jun 2021 19:12:09 +0000 (14:12 -0500)] 
Fix gnutls_certificate_set_trust_list() return value documentation

This function is documented to return an error code, but in fact it has
no return value and never fails. Fix this.

Signed-off-by: Michael Catanzaro <mcatanzaro@redhat.com>
5 years agoMerge branch 'guile-egain-eintr' into 'master'
Daiki Ueno [Sat, 19 Jun 2021 17:43:53 +0000 (17:43 +0000)] 
Merge branch 'guile-egain-eintr' into 'master'

guile: Writes to record ports handle EAGAIN/EINTR transparently.

See merge request gnutls/gnutls!1417

5 years agoguile: Writes to record ports handle EAGAIN/EINTR transparently.
Ludovic Courtès [Sat, 24 Apr 2021 20:02:14 +0000 (22:02 +0200)] 
guile: Writes to record ports handle EAGAIN/EINTR transparently.

Reported at <https://issues.guix.gnu.org/47867>
by Florian Pelz <pelzflorian@pelzflorian.de>.

This is a followup to a229bb36c9592b151f6feb277238c41ab39f40a9.

* guile/src/core.c (write_to_session_record_port) [USING_GUILE_BEFORE_2_2]:
Keep looping upon GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED.
(write_to_session_record_port) [!USING_GUILE_BEFORE_2_2]: Loop on
GNUTLS_E_INTERRUPTED and return -1 on GNUTLS_E_AGAIN if C_SESSION is
backed by a file descriptor.
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
5 years agoMerge branch 'wip/dueno/pkcs11-reuse-key-id' into 'master'
Daiki Ueno [Fri, 11 Jun 2021 15:51:44 +0000 (15:51 +0000)] 
Merge branch 'wip/dueno/pkcs11-reuse-key-id' into 'master'

doc: p11tool: mention how CKA_IDs of certs are calculated upon --write

See merge request gnutls/gnutls!1446

5 years agoMerge branch 'wip/dueno/config-sigalgs' into 'master'
Daiki Ueno [Fri, 11 Jun 2021 15:32:21 +0000 (15:32 +0000)] 
Merge branch 'wip/dueno/config-sigalgs' into 'master'

priority: reflect system wide config when constructing sigalgs

See merge request gnutls/gnutls!1447

5 years agopriority: reflect system wide config when constructing sigalgs
Daiki Ueno [Fri, 11 Jun 2021 04:58:43 +0000 (06:58 +0200)] 
priority: reflect system wide config when constructing sigalgs

Otherwise the client would advertise signature algorithms which it
cannot use and cause handshake to fail.

Reported by Philip Schaten in:
https://lists.gnupg.org/pipermail/gnutls-help/2021-June/004711.html

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agop11tool: mention how CKA_IDs of certs are calculated upon --write
Daiki Ueno [Wed, 9 Jun 2021 12:29:11 +0000 (14:29 +0200)] 
p11tool: mention how CKA_IDs of certs are calculated upon --write

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/release-3.7.2' into 'master' 3.7.2
Daiki Ueno [Sat, 29 May 2021 07:41:46 +0000 (07:41 +0000)] 
Merge branch 'wip/dueno/release-3.7.2' into 'master'

Release 3.7.2

See merge request gnutls/gnutls!1445

5 years agoRelease 3.7.2
Daiki Ueno [Sat, 29 May 2021 05:18:17 +0000 (07:18 +0200)] 
Release 3.7.2

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agorelease-steps: remove unnecessary steps
Daiki Ueno [Sat, 29 May 2021 05:09:07 +0000 (07:09 +0200)] 
release-steps: remove unnecessary steps

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