]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
5 years agoMerge branch 'tmp-gettext' into 'master'
Dmitry Baryshkov [Sun, 14 Jun 2020 21:05:51 +0000 (21:05 +0000)] 
Merge branch 'tmp-gettext' into 'master'

configure.ac: prefer the latest version of build infrastructure

See merge request gnutls/gnutls!1284

5 years ago.gitlab-ci: disable config.cache for nettle-master builds
Dmitry Baryshkov [Sun, 14 Jun 2020 20:31:27 +0000 (23:31 +0300)] 
.gitlab-ci: disable config.cache for nettle-master builds

Disable usage of config.cache for nettle-master builds. Such
config.cache files can easily become stale, thus resulting in build
failures.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoWipe session ticket keys before releasing the session structure
Fiona Klute [Sun, 14 Jun 2020 10:52:46 +0000 (12:52 +0200)] 
Wipe session ticket keys before releasing the session structure

This includes both a copy of the master key and one or two derived
keys, all of which could be used to decrypt session tickets if
stolen. The derived keys could only be used for tickets issued within
a certain time frame (by default several hours).

The documentation for gnutls_session_ticket_enable_server() already
states that the master key should be wiped before releasing it, and
the same should apply to internal copies.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agotests/cert-test/invalid-sig: use datefudge to test expired certs
Daiki Ueno [Tue, 9 Jun 2020 08:44:57 +0000 (10:44 +0200)] 
tests/cert-test/invalid-sig: use datefudge to test expired certs

Suggested by Andreas Metzler in:
https://gitlab.com/gnutls/gnutls/-/issues/1021

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: check_for_datefudge: don't exit the test programs
Daiki Ueno [Tue, 9 Jun 2020 08:41:18 +0000 (10:41 +0200)] 
tests: check_for_datefudge: don't exit the test programs

This makes check_for_datefudge not to immediately exit the program,
but to return non-zero to allow the tests by themselves to control the
behavior when "datefudge" is not found.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'nettle_so' into 'master'
Anderson Sasaki [Tue, 9 Jun 2020 16:04:57 +0000 (16:04 +0000)] 
Merge branch 'nettle_so' into 'master'

configure: improve nettle, gmp, and hogweed soname detection

See merge request gnutls/gnutls!1286

5 years agoconfigure: improve nettle, gmp, and hogweed soname detection
Vitezslav Cizek [Tue, 9 Jun 2020 11:54:04 +0000 (13:54 +0200)] 
configure: improve nettle, gmp, and hogweed soname detection

Some linkers might optimize away the libraries passed on the
command line if they aren't actually needed, such as gnu ld with
--as-needed.
The ldd output then won't list the shared libraries and the
detection will fail.
Make sure nettle and others are really used.

Signed-off-by: Vitezslav Cizek <vcizek@suse.com>
5 years agoModied the license to GPLv2.1+ to keep with LICENSE file.
Lei Maohui [Mon, 8 Jun 2020 07:15:07 +0000 (16:15 +0900)] 
Modied the license to GPLv2.1+ to keep with LICENSE file.

Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
5 years agoconfigure.ac: prefer the latest version of build infrastructure
Daiki Ueno [Mon, 8 Jun 2020 04:45:24 +0000 (06:45 +0200)] 
configure.ac: prefer the latest version of build infrastructure

AM_GNU_GETTEXT_REQUIRE_VERSION tells autopoint to copy the latest
possible build infrastructure installed on the system, rather than the
fixed version from the archive.dir.tar.xz.  This makes the
bootstrapping slightly faster and allows us not to stick with the
ancient gettext version.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'fix-vista-ci' into 'master'
Dmitry Baryshkov [Sun, 7 Jun 2020 17:41:21 +0000 (17:41 +0000)] 
Merge branch 'fix-vista-ci' into 'master'

Fix Vista CI and add a Vista DLL target

See merge request gnutls/gnutls!1279

5 years agoCI: fix typo in the Vista target
Steve Lhomme [Sun, 7 Jun 2020 17:41:21 +0000 (17:41 +0000)] 
CI: fix typo in the Vista target

This resulted in the MinGW64.Vista+ target doing the same thing as the MinGW64
target.

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
5 years agoMerge branch 'tmp-iov-memleak' into 'master'
Dmitry Baryshkov [Sun, 7 Jun 2020 14:34:43 +0000 (14:34 +0000)] 
Merge branch 'tmp-iov-memleak' into 'master'

crypto-api: always allocate memory when serializing iovec_t

Closes #1017

See merge request gnutls/gnutls!1278

5 years agoRELEASES.md: move the release steps to devel/ [ci skip]
Daiki Ueno [Sun, 7 Jun 2020 13:46:51 +0000 (15:46 +0200)] 
RELEASES.md: move the release steps to devel/ [ci skip]

As the information is only useful to developers, having it under
devel/ rather than in the tarball is more releavant.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoRELEASES.md: mention 3.7.x releases
Daiki Ueno [Sun, 7 Jun 2020 13:45:13 +0000 (15:45 +0200)] 
RELEASES.md: mention 3.7.x releases

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoRELEASES.md: fix typo in scp command line
Daiki Ueno [Sun, 7 Jun 2020 13:41:59 +0000 (15:41 +0200)] 
RELEASES.md: fix typo in scp command line

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoNEWS: add missing API modifications to 3.6.14 entry
Daiki Ueno [Sun, 7 Jun 2020 13:39:39 +0000 (15:39 +0200)] 
NEWS: add missing API modifications to 3.6.14 entry

Reported by Andreas Metzler in:
https://lists.gnupg.org/pipermail/gnutls-help/2020-June/004650.html

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'gost-split-6' into 'master'
Dmitry Baryshkov [Sat, 6 Jun 2020 23:56:28 +0000 (23:56 +0000)] 
Merge branch 'gost-split-6' into 'master'

MAGMA/KUZNYECHIK CTR-ACPKM and CMAC support

See merge request gnutls/gnutls!1161

5 years agoMerge branch 'merge-mandatory-libs' into 'master'
Dmitry Baryshkov [Sat, 6 Jun 2020 22:03:14 +0000 (22:03 +0000)] 
Merge branch 'merge-mandatory-libs' into 'master'

Merge the extra libraries to link dynamically in GNUTLS_LIBS_PRIVATE

Closes #1020

See merge request gnutls/gnutls!1280

5 years agocrypto-selftest: add test vectors for MAGMA/KUZNYECHIK-CTR-ACPKM
Dmitry Eremin-Solenikov [Wed, 8 Jan 2020 22:42:22 +0000 (01:42 +0300)] 
crypto-selftest: add test vectors for MAGMA/KUZNYECHIK-CTR-ACPKM

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agocrypto-api: add _gnutls_cipher_set_key wrapper()
Dmitry Eremin-Solenikov [Wed, 8 Jan 2020 22:11:50 +0000 (01:11 +0300)] 
crypto-api: add _gnutls_cipher_set_key wrapper()

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agocipher/mac: enhance handlers with setkey callback
Dmitry Eremin-Solenikov [Thu, 17 Oct 2019 13:38:40 +0000 (16:38 +0300)] 
cipher/mac: enhance handlers with setkey callback

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoselftests: add test vectors for MAGMA/KUZNYECHIK-OMAC
Dmitry Eremin-Solenikov [Wed, 8 Jan 2020 21:58:50 +0000 (00:58 +0300)] 
selftests: add test vectors for MAGMA/KUZNYECHIK-OMAC

Add test vectors for newly added MAC algorithms.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agolib: add Magma/Kuznyechik OMAC support
Dmitry Eremin-Solenikov [Fri, 21 Sep 2018 19:11:51 +0000 (22:11 +0300)] 
lib: add Magma/Kuznyechik OMAC support

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agolib: add Magma/Kuznyechik ciphers support
Dmitry Eremin-Solenikov [Fri, 21 Sep 2018 19:11:14 +0000 (22:11 +0300)] 
lib: add Magma/Kuznyechik ciphers support

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agonettle/gost: add ACPKM rekeying code
Dmitry Eremin-Solenikov [Fri, 21 Sep 2018 19:10:30 +0000 (22:10 +0300)] 
nettle/gost: add ACPKM rekeying code

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agonettle/gost: add CMAC-64/Magma/Kuznyechik code
Dmitry Eremin-Solenikov [Fri, 21 Sep 2018 19:10:03 +0000 (22:10 +0300)] 
nettle/gost: add CMAC-64/Magma/Kuznyechik code

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agonettle/gost: add Kuznyechik code
Dmitry Eremin-Solenikov [Fri, 21 Sep 2018 19:09:36 +0000 (22:09 +0300)] 
nettle/gost: add Kuznyechik code

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agonettle/gost: add Magma code
Dmitry Eremin-Solenikov [Fri, 21 Sep 2018 19:09:11 +0000 (22:09 +0300)] 
nettle/gost: add Magma code

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agonettle/gost: export gost28147_decrypt_simple for magma cipher
Dmitry Eremin-Solenikov [Fri, 21 Sep 2018 19:08:44 +0000 (22:08 +0300)] 
nettle/gost: export gost28147_decrypt_simple for magma cipher

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
6 years agoMerge the extra libraries to link dynamically in GNUTLS_LIBS_PRIVATE
Steve Lhomme [Sat, 6 Jun 2020 12:05:16 +0000 (14:05 +0200)] 
Merge the extra libraries to link dynamically in GNUTLS_LIBS_PRIVATE

This should fix #1020 where bcrypt is missing from thirdparty_libadd.

Ultimately it would be good to add libraries that always need to be linked in
one variable that is shared between the Makefile and the pkg-config file.

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
6 years agocrypto-api: always allocate memory when serializing iovec_t 1278/head
Daiki Ueno [Fri, 5 Jun 2020 14:26:33 +0000 (16:26 +0200)] 
crypto-api: always allocate memory when serializing iovec_t

The AEAD iov interface falls back to serializing the input buffers if
the low-level cipher doesn't support scatter/gather encryption.
However, there was a bug in the functions used for the serialization,
which causes memory leaks under a certain condition (i.e. the number
of input buffers is 1).

This patch makes the logic of the functions simpler, by removing a
micro-optimization that tries to minimize the number of calls to
malloc/free.

The original problem was reported by Marius Steffen in:
https://bugzilla.samba.org/show_bug.cgi?id=14399
and the cause was investigated by Alexander Haase in:
https://gitlab.com/gnutls/gnutls/-/merge_requests/1277

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agoMerge branch 'master' into 'master'
Daiki Ueno [Fri, 5 Jun 2020 16:38:58 +0000 (16:38 +0000)] 
Merge branch 'master' into 'master'

tests: updated tlsfuzzer tests to latest version

See merge request gnutls/gnutls!1276

6 years agoMerge branch 'tmp-aead-init-leak' into 'master'
Daiki Ueno [Fri, 5 Jun 2020 16:38:35 +0000 (16:38 +0000)] 
Merge branch 'tmp-aead-init-leak' into 'master'

gnutls_aead_cipher_init: fix potential memleak

Closes #1010

See merge request gnutls/gnutls!1274

6 years agoMerge branch 'aia' into 'master'
Sahana Prasad [Fri, 5 Jun 2020 11:45:32 +0000 (11:45 +0000)] 
Merge branch 'aia' into 'master'

AIA callback to retrieve missing chain certificates

See merge request gnutls/gnutls!1262

6 years agotests: updated tlsfuzzer tests to latest version
KrenzelokFrantisek [Thu, 4 Jun 2020 14:59:33 +0000 (16:59 +0200)] 
tests: updated tlsfuzzer tests to latest version
excluded some tests from test-certificate-malformed.py

Signed-off-by: KrenzelokFrantisek <krenzelok.frantisek@gmail.com>
6 years agoMerge branch 'tmp-autogen-int' into 'master'
Daiki Ueno [Thu, 4 Jun 2020 11:47:25 +0000 (11:47 +0000)] 
Merge branch 'tmp-autogen-int' into 'master'

serv: omit upper bound of --maxearlydata option definition

See merge request gnutls/gnutls!1273

6 years agodevel/libgnutls-latest-x86_64.abi, doc, NEWS, and manpage updates
Sahana Prasad [Wed, 27 May 2020 10:42:24 +0000 (12:42 +0200)] 
devel/libgnutls-latest-x86_64.abi, doc, NEWS, and manpage updates

Signed-off-by: Sahana Prasad <sahana@redhat.com>
6 years agotests: Adds new tests missingissuer and missingissuer_aia
Sahana Prasad [Fri, 22 May 2020 13:11:32 +0000 (15:11 +0200)] 
tests: Adds new tests missingissuer and missingissuer_aia

Signed-off-by: Sahana Prasad <sahana@redhat.com>
6 years agoImplements a callback function gnutls_x509_trust_list_set_getissuer_function()
Sahana Prasad [Fri, 22 May 2020 07:42:47 +0000 (09:42 +0200)] 
Implements a callback function gnutls_x509_trust_list_set_getissuer_function()

Signed-off-by: Sahana Prasad <sahana@redhat.com>
6 years agoMerge branch 'tmp-release-3.6.14' into 'master' 3.6.14
Daiki Ueno [Wed, 3 Jun 2020 12:52:17 +0000 (12:52 +0000)] 
Merge branch 'tmp-release-3.6.14' into 'master'

Release 3.6.14 [ci skip]

See merge request gnutls/gnutls!1272

6 years agoRelease 3.6.14 [ci skip]
Daiki Ueno [Mon, 1 Jun 2020 12:18:03 +0000 (14:18 +0200)] 
Release 3.6.14 [ci skip]

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agoMerge branch 'tmp-totp-init' into 'master'
Daiki Ueno [Wed, 3 Jun 2020 11:49:18 +0000 (11:49 +0000)] 
Merge branch 'tmp-totp-init' into 'master'

stek: differentiate initial state from valid time window of TOTP

See merge request gnutls/gnutls!1275

6 years agovalgrind: check if session ticket key is used without initialization
Daiki Ueno [Tue, 2 Jun 2020 19:45:17 +0000 (21:45 +0200)] 
valgrind: check if session ticket key is used without initialization

This adds a valgrind client request for
session->key.session_ticket_key to make sure that it is not used
without initialization.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agostek: differentiate initial state from valid time window of TOTP
Daiki Ueno [Tue, 2 Jun 2020 18:53:11 +0000 (20:53 +0200)] 
stek: differentiate initial state from valid time window of TOTP

There was a confusion in the TOTP implementation in stek.c.  When the
mechanism is initialized at the first time, it records the timestamp
but doesn't initialize the key.  This removes the timestamp recording
at the initialization phase, so the key is properly set later.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agognutls_cipher_init: fix potential memleak
Daiki Ueno [Tue, 2 Jun 2020 03:38:28 +0000 (05:38 +0200)] 
gnutls_cipher_init: fix potential memleak

Upon failure this function returns without freeing memory allocated
internally.  This makes sure that it is released and do not touch the
output handle argument.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agognutls_aead_cipher_init: fix potential memleak
Daiki Ueno [Tue, 2 Jun 2020 03:34:29 +0000 (05:34 +0200)] 
gnutls_aead_cipher_init: fix potential memleak

When _gnutls_aead_cipher_init() fails, the function returns without
freeing the allocted handle.  This was once fixed in commit
502be130493e8ce802cdf60fffdbb5f1885352a5 but regressed after a code
reorganization in commit 2eef509ce5f2d250f8dcaeffa46444dd2b694e91.

Reported by Miroslav Lichvar.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agoserv: omit upper bound of --maxearlydata option definition
Daiki Ueno [Mon, 1 Jun 2020 15:23:59 +0000 (17:23 +0200)] 
serv: omit upper bound of --maxearlydata option definition

It turned out that AutoGen treats numbers that exceed INT_MAX in a
platform dependent way.  In this case, 4294967295 (UINT_MAX) is
treated as is on 64-bit platforms, while it is interpreted as "-1" on
32-bit platforms.  This causes a problem when the program
documentation is compiled under multilib environment.

Reported by Ivan Molodetskikh in:
https://bugzilla.redhat.com/show_bug.cgi?id=1841844
and the cause was identified by Anderson Toshiyuki Sasaki.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agoMerge branch 'tmp-known-certs' into 'master'
Daiki Ueno [Sun, 31 May 2020 16:15:57 +0000 (16:15 +0000)] 
Merge branch 'tmp-known-certs' into 'master'

_gnutls_pkcs11_verify_crt_status: check validity against system cert

See merge request gnutls/gnutls!1271

6 years agotests: add test case for certificate chain superseding 1271/head
Daiki Ueno [Sun, 31 May 2020 12:28:48 +0000 (14:28 +0200)] 
tests: add test case for certificate chain superseding

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agox509: trigger fallback verification path when cert is expired
Daiki Ueno [Sun, 31 May 2020 11:59:53 +0000 (13:59 +0200)] 
x509: trigger fallback verification path when cert is expired

gnutls_x509_trust_list_verify_crt2 use the macro SIGNER_OLD_OR_UNKNOWN
to trigger the fallback verification path if the signer of the last
certificate is not in the trust store.  Previously, it doesn't take
into account of the condition where the certificate is expired.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years ago_gnutls_pkcs11_verify_crt_status: check validity against system cert
Daiki Ueno [Sun, 31 May 2020 10:39:14 +0000 (12:39 +0200)] 
_gnutls_pkcs11_verify_crt_status: check validity against system cert

To verify a certificate chain, this function replaces known
certificates with the ones in the system trust store if possible.

However, if it is found, the function checks the validity of the
original certificate rather than the certificate found in the trust
store.  That reveals a problem in a scenario that (1) a certificate is
signed by multiple issuers and (2) one of the issuers' certificate has
expired and included in the input chain.

This patch makes it a little robuster by actually retrieving the
certificate from the trust store and perform check against it.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agoMerge branch 'nowincrypt' into 'master'
Dmitry Baryshkov [Sun, 31 May 2020 12:41:15 +0000 (12:41 +0000)] 
Merge branch 'nowincrypt' into 'master'

use bcrypt for the windows random generator instead of wincrypt

See merge request gnutls/gnutls!1255

6 years agoMerge branch 'fix-valgrind' into 'master'
Dmitry Baryshkov [Sun, 31 May 2020 12:32:30 +0000 (12:32 +0000)] 
Merge branch 'fix-valgrind' into 'master'

configure.ac: add -fno-builtin-strcmp if valgrind is enabled

Closes #944

See merge request gnutls/gnutls!1264

6 years agoMerge branch 'add-aes192-gcm' into 'master'
Dmitry Baryshkov [Sat, 30 May 2020 12:53:20 +0000 (12:53 +0000)] 
Merge branch 'add-aes192-gcm' into 'master'

lib: add support for AES-192-GCM

See merge request gnutls/gnutls!1267

6 years agoMerge branch 'tmp-macosx-vers' into 'master'
Dmitry Baryshkov [Sat, 30 May 2020 12:51:01 +0000 (12:51 +0000)] 
Merge branch 'tmp-macosx-vers' into 'master'

.travis.yml: use several different OSX versions

See merge request gnutls/gnutls!1269

6 years agoMerge branch 'tmp-fix-macosx-link' into 'master'
Dmitry Baryshkov [Sat, 30 May 2020 12:50:38 +0000 (12:50 +0000)] 
Merge branch 'tmp-fix-macosx-link' into 'master'

configure: check that -no_weak_links works with FD_SET

Closes #966

See merge request gnutls/gnutls!1266

6 years agodevel: provide external git diff driver for *.abi files [ci skip]
Daiki Ueno [Mon, 16 Mar 2020 16:16:08 +0000 (17:16 +0100)] 
devel: provide external git diff driver for *.abi files [ci skip]

This adds an external diff driver for *.abi files, that shows only
interesting changes in those files.  This would be useful when adding
a new API.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'tmp-fileio' into 'master'
Daiki Ueno [Sat, 30 May 2020 10:22:18 +0000 (10:22 +0000)] 
Merge branch 'tmp-fileio' into 'master'

lib: improve external file loading

See merge request gnutls/gnutls!1261

6 years agobuild: write "FILE *fp" instead of "FILE *fd"
Daiki Ueno [Sat, 30 May 2020 09:06:57 +0000 (11:06 +0200)] 
build: write "FILE *fp" instead of "FILE *fd"

This makes it clear that "fd" is not a file descriptor but a FILE
pointer.  Suggested by Tim Rühsen.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agognutls_load_file: document limitation regarding partial failure
Daiki Ueno [Mon, 25 May 2020 13:33:49 +0000 (15:33 +0200)] 
gnutls_load_file: document limitation regarding partial failure

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agocert-cred: clear private key data loaded from file
Daiki Ueno [Mon, 25 May 2020 09:21:38 +0000 (11:21 +0200)] 
cert-cred: clear private key data loaded from file

This makes use of the RF_SENSITIVE flag newly added to read_file
function when reading potentially senstive information from a file.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agolib: avoid file descriptor leak when application forks
Daiki Ueno [Mon, 25 May 2020 08:09:28 +0000 (10:09 +0200)] 
lib: avoid file descriptor leak when application forks

This makes use of the "e" flag of fopen, provided by the Gnulib's
fopen-gnu module.

Reported by Remi Denis-Courmont in:
https://gitlab.com/gnutls/gnutls/-/issues/985
and fix suggested by Tim Rühsen.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agognulib: update git submodule
Daiki Ueno [Mon, 25 May 2020 16:37:51 +0000 (18:37 +0200)] 
gnulib: update git submodule

This brings in the new fopen-gnu module and the RF_SENSITIVE flag for
fread_file and read_file.  This also adds the following changes to be
consistent with the latest changes in Gnulib:
- the callers of fread_file and read_file to be adjusted for the FLAGS
  argument
- "attribute.h" needs to be used extensively

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agop12: do not encrypt encrypt certificate bag with empty password
Dmitry Baryshkov [Wed, 27 May 2020 21:05:35 +0000 (00:05 +0300)] 
p12: do not encrypt encrypt certificate bag with empty password

Do not encrypt certificate bag if the user has specified empty password
(--password ''). Encryption can be turned on by specifying
--empty-password.

Fixes #888

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agowin32: use bcrypt instead of CryptoAPI on Vista+ for random numbers
Steve Lhomme [Wed, 29 Apr 2020 08:32:08 +0000 (10:32 +0200)] 
win32: use bcrypt instead of CryptoAPI on Vista+ for random numbers

CryptoAPI is a deprecated API [1] that is forbidden in UWP builds.

Rewrite the CryptoAPI calls in bcrypt.

bcrypt is used instead of CryptoAPI when targeting Windows Vista and above.

https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptdecrypt

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
6 years agocerttool: do not ask for private key password if it was provided
Dmitry Baryshkov [Wed, 27 May 2020 20:42:01 +0000 (23:42 +0300)] 
certtool: do not ask for private key password if it was provided

Make pin_callback() use cinfo->password if it is set (via command line
or from template).

Fixes #933

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years ago.travis.yml: use several different OSX versions
Dmitry Baryshkov [Thu, 28 May 2020 00:15:55 +0000 (03:15 +0300)] 
.travis.yml: use several different OSX versions

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'ncrypt-uwp10' into 'master'
Dmitry Baryshkov [Wed, 27 May 2020 21:14:51 +0000 (21:14 +0000)] 
Merge branch 'ncrypt-uwp10' into 'master'

win32: allow using ncrypt in UWP builds

See merge request gnutls/gnutls!1256

6 years agowin32: move the NCRYPT key import into a function
Steve Lhomme [Wed, 27 May 2020 21:14:50 +0000 (21:14 +0000)] 
win32: move the NCRYPT key import into a function

No functional change. The has been simply moved.

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
6 years agoMerge branch 'static-ncrypt' into 'master'
Dmitry Baryshkov [Wed, 27 May 2020 21:13:43 +0000 (21:13 +0000)] 
Merge branch 'static-ncrypt' into 'master'

Allow statically linking ncrypt (win32)

See merge request gnutls/gnutls!1254

6 years agoconfigure.ac: determine if the Vista APIs can be linked statically
Steve Lhomme [Wed, 27 May 2020 21:13:43 +0000 (21:13 +0000)] 
configure.ac: determine if the Vista APIs can be linked statically

If _WIN32_WINNT is higher or equal to 0x0600, Vista API's are allowed during
the build. We can assume that the minimum platform the code will run on is
Vista [1]

In that case there's no need to call API's (ncrypt) dynamically when it can be
done statically.

[1] https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
6 years agoMerge branch 'tmp-fips-redefinition' into 'master'
Dmitry Baryshkov [Wed, 27 May 2020 21:11:41 +0000 (21:11 +0000)] 
Merge branch 'tmp-fips-redefinition' into 'master'

fips: make FIPS140-2 mode enablement logic simpler

See merge request gnutls/gnutls!1253

6 years agoMerge branch 'build-datefudge-check' into 'master'
Dmitry Baryshkov [Wed, 27 May 2020 20:11:45 +0000 (20:11 +0000)] 
Merge branch 'build-datefudge-check' into 'master'

tests: build datefudge-check during make all

Closes #920

See merge request gnutls/gnutls!1265

6 years agolib: add support for AES-192-GCM
Dmitry Baryshkov [Tue, 26 May 2020 21:34:02 +0000 (00:34 +0300)] 
lib: add support for AES-192-GCM

Add support for AES-192 in GCM mode.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoconfigure: check that -no_weak_links works with FD_SET
Dmitry Baryshkov [Tue, 26 May 2020 13:19:59 +0000 (16:19 +0300)] 
configure: check that -no_weak_links works with FD_SET

Several Xcode/SDK versions provide FD_SET implementation that does not
work with -no_weak_links. Check that this option does not break FD_SET
usage.

Fixes #966

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agotests: build datefudge-check during make all
Dmitry Baryshkov [Tue, 26 May 2020 10:12:24 +0000 (13:12 +0300)] 
tests: build datefudge-check during make all

Most of the tests depend on datefudge-check. Let's make it during 'make
all' stage to allow running individual tests w/o requiring to build it
separately.

Fixes #920

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoconfigure.ac: add -fno-builtin-strcmp if valgrind is enabled
Dmitry Baryshkov [Tue, 26 May 2020 10:06:03 +0000 (13:06 +0300)] 
configure.ac: add -fno-builtin-strcmp if valgrind is enabled

Recent GCC provides strcmp which makes Valgrind assume that it accesses
uninitialized data. Disable this optimization if Valgrind tests are
enabled.

Fixes #944

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'crpyt32' into 'master'
Dmitry Baryshkov [Mon, 25 May 2020 08:53:51 +0000 (08:53 +0000)] 
Merge branch 'crpyt32' into 'master'

win32: link with crypt32

See merge request gnutls/gnutls!1257

6 years agoMerge branch 'rrivers2-master-patch-89518' into 'master'
Daiki Ueno [Mon, 25 May 2020 04:47:00 +0000 (04:47 +0000)] 
Merge branch 'rrivers2-master-patch-89518' into 'master'

Update session_ticket.c to add support for zero length session tickets returned from the server

See merge request gnutls/gnutls!1260

6 years agoUpdate session_ticket.c to add support for zero length session tickets returned from...
rrivers2 [Sun, 24 May 2020 23:11:01 +0000 (23:11 +0000)] 
Update session_ticket.c to add support for zero length session tickets returned from the server

check that ticket_len > 0 prior to calling gnutls_realloc_fast

Signed-off-by: Rod Rivers <5981058-rrivers2@users.noreply.gitlab.com>
6 years agoMerge branch 'tmp-vendor-minitasn1' into 'master'
Dmitry Baryshkov [Sun, 24 May 2020 20:00:14 +0000 (20:00 +0000)] 
Merge branch 'tmp-vendor-minitasn1' into 'master'

Vendor-in libtasn1 sources in a form of minitasn1

See merge request gnutls/gnutls!1247

6 years agoMerge branch 'x509-common-name' into 'master'
Dmitry Baryshkov [Sun, 24 May 2020 18:49:23 +0000 (18:49 +0000)] 
Merge branch 'x509-common-name' into 'master'

x509: support commonName extension

Closes #989

See merge request gnutls/gnutls!1250

6 years agoMerge branch 'fix-aki' into 'master'
Dmitry Baryshkov [Sun, 24 May 2020 18:48:24 +0000 (18:48 +0000)] 
Merge branch 'fix-aki' into 'master'

x509: aki: always print authorityCert info

Closes #991

See merge request gnutls/gnutls!1249

6 years agobuild: vendor in libtasn1 code
Dmitry Baryshkov [Thu, 14 May 2020 02:54:58 +0000 (05:54 +0300)] 
build: vendor in libtasn1 code

Instead of keeping the minitasn1 source in Git, vendor in it during
bootstrap as we do with Nettle code. This also upgrades included
minitasn1 to latest version (4.16.0).

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agowin32: link with crypt32
Steve Lhomme [Tue, 19 May 2020 14:23:40 +0000 (16:23 +0200)] 
win32: link with crypt32

Since 5d03564cccd2c10c41252ea468d4a098bd08e9c1 we use CertOpenStore().
To properly link it needs to be linked with the crypt32.dll.
https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certopenstore

This library was missing from the pkg-config library. It exists in
thirdparty_libadd to link gnutls as a DLL.

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
6 years agofips: remove FIPS_STARTUP_ONLY_TEST_CASE macro
Daiki Ueno [Tue, 19 May 2020 14:18:39 +0000 (16:18 +0200)] 
fips: remove FIPS_STARTUP_ONLY_TEST_CASE macro

The macro was intended to avoid non-recoverable errors during library
initialization, but the code path has been removed in commit
3963518d067a64412bbe0aa9ce5fc33ae729c15f.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agofips: make FIPS140-2 mode enablement logic simpler
Daiki Ueno [Mon, 18 May 2020 10:25:42 +0000 (12:25 +0200)] 
fips: make FIPS140-2 mode enablement logic simpler

Previously, to enable the FIPS140-2 mode, both /etc/system-fips and
the fips=1 kernel command line need to be set.  While this was
designed to be consistent, the convention is not well followed by the
other crypto libraries and the former tends to be ignored.  This
aligns the behavior to the latter, i.e. if fips=1 is set, the library
enables the FIPS140-2 mode regardless of the existence of
/etc/system-fips.

Suggested by Alexander Sosedkin.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agox509: support commonName extension
Dmitry Baryshkov [Sun, 17 May 2020 21:13:34 +0000 (00:13 +0300)] 
x509: support commonName extension

Add support for Common Name certificate extension.

Fixes #989

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agorefine tests for ancient servers which support both SSL 3.0 and TLS 1.0, but both...
Daniel Lenski [Sun, 17 May 2020 21:50:47 +0000 (14:50 -0700)] 
refine tests for ancient servers which support both SSL 3.0 and TLS 1.0, but both only with %NO_EXTENSIONS

This is a follow-up to !1221.

See #958 and https://gitlab.com/openconnect/openconnect/-/issues/145 for a
real-world example of ancient Cisco servers with these deficiencies.

With !1221 only, gnutls-cli-debug reports that these ancient servers only support
SSL 3.0 (but without extensions). Information after this point is
largely erroneous:

    $ gnutls-cli-debug ***vpn.***.com
    GnuTLS debug client 3.6.12
    Checking ***vpn.***.com:443
    whether the server accepts default record size (512 bytes)... no
                      whether %ALLOW_SMALL_RECORDS is required... no
                                 for SSL 3.0 (RFC6101) support... yes
                                   for SSL 3.0 with extensions... no

With this additional change, gnutls-cli-debug correctly reports that such a
server also supports TLS 1.0 (but again with extensions disabled). Below
I've marked some of the significant fields that have changed:

    $ gnutls-cli-debug ***vpn.***.com
    GnuTLS debug client 3.6.12
    Checking ***vpn.***.com:443
    whether the server accepts default record size (512 bytes)... no
                      whether %ALLOW_SMALL_RECORDS is required... no
                                 for SSL 3.0 (RFC6101) support... yes
                                   for SSL 3.0 with extensions... no
                            whether we need to disable TLS 1.2... yes
                            whether we need to disable TLS 1.1... yes
    # This is now correct:
                            whether we need to disable TLS 1.0... no
    # This is now correct:
                            whether %NO_EXTENSIONS is required... yes
    # This is now correct:
                                 for TLS 1.0 (RFC2246) support... yes
                                 for TLS 1.1 (RFC4346) support... no
                                      fallback from TLS 1.1 to... failed
                                 for TLS 1.2 (RFC5246) support... no
    # This is now correct:
                        for known TLS or SSL protocols support... yes
                           TLS1.2 neg fallback from TLS 1.6 to... failed (server requires fallback dance)
                  for inappropriate fallback (RFC7507) support... no
                                         for HTTPS server name... ******
                                   for certificate chain order... sorted
                         for Safe renegotiation support (SCSV)... no
                           for version rollback bug in RSA PMS... no
                      for version rollback bug in Client Hello... no
                whether the server ignores the RSA PMS version... no
    whether small records (512 bytes) are tolerated on handshake... yes
        whether cipher suites not in SSL 3.0 spec are accepted... yes
    whether a bogus TLS record version in the client hello is accepted... yes
             whether the server understands TLS closure alerts... partially
                whether the server supports session resumption... yes
                          for anonymous authentication support... no
                          for ephemeral Diffie-Hellman support... no
                            for RFC7919 Diffie-Hellman support... no
                          for AES-GCM cipher (RFC5288) support... no
                          for AES-CCM cipher (RFC6655) support... no
                        for AES-CCM-8 cipher (RFC6655) support... no
                          for AES-CBC cipher (RFC3268) support... no
                     for CAMELLIA-GCM cipher (RFC6367) support... no
                     for CAMELLIA-CBC cipher (RFC5932) support... no
    # This is now correct:
                         for 3DES-CBC cipher (RFC2246) support... yes
    # This is now correct:
                      for ARCFOUR 128 cipher (RFC2246) support... yes
                for CHACHA20-POLY1305 cipher (RFC7905) support... no
    for GOST28147-CNT cipher (draft-smyshlyaev-tls12-gost-suites) support... no
                                           for MD5 MAC support... yes
                                          for SHA1 MAC support... yes
                                        for SHA256 MAC support... no
    for GOST28147-IMIT MAC (draft-smyshlyaev-tls12-gost-suites) support... no

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
6 years agox509: aki: always print authorityCert info
Dmitry Baryshkov [Sun, 17 May 2020 19:01:22 +0000 (22:01 +0300)] 
x509: aki: always print authorityCert info

Always print authorityCertIssuer/SerialNumber. Currently it is output
only if keyIdentifier is not present.

Fixes #991

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'cert-policies' into 'master'
Dmitry Baryshkov [Fri, 15 May 2020 19:10:26 +0000 (19:10 +0000)] 
Merge branch 'cert-policies' into 'master'

Decode certificate policies OIDs

See merge request gnutls/gnutls!1245

6 years agoMerge branch 'pkcs7-attrs' into 'master'
Dmitry Baryshkov [Thu, 14 May 2020 09:26:36 +0000 (09:26 +0000)] 
Merge branch 'pkcs7-attrs' into 'master'

PKCS7 attribute printing update

See merge request gnutls/gnutls!1246

6 years agooutput: add Russian security class policies
Dmitry Baryshkov [Mon, 11 May 2020 20:50:40 +0000 (23:50 +0300)] 
output: add Russian security class policies

Add Russian Security Class certificate policies (per
draft-deremin-rfc4491-bis).

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agox509: print certificate policiy names
Dmitry Baryshkov [Mon, 11 May 2020 20:11:56 +0000 (23:11 +0300)] 
x509: print certificate policiy names

Add ability to print names for several pre-defined Certificate policies.
Currently the list is populated with anyPolicy from X.509 and CA/B
policies.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agocerttool: use gnutls_pkcs7_print_signature_info
Dmitry Baryshkov [Wed, 13 May 2020 23:22:05 +0000 (02:22 +0300)] 
certtool: use gnutls_pkcs7_print_signature_info

Use new function to remove code duplication.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agopkcs7: add function to display signature information
Dmitry Baryshkov [Wed, 13 May 2020 23:20:57 +0000 (02:20 +0300)] 
pkcs7: add function to display signature information

Basically export print_pkcs7_info() in a way usable by external
applications.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agopkcs7: decode attribute OIDs when printing
Dmitry Baryshkov [Wed, 13 May 2020 23:22:20 +0000 (02:22 +0300)] 
pkcs7: decode attribute OIDs when printing

Try printing symbolic names for well-known OIDs when printing PKCS7
signature info.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'tmp-fips-leftover' into 'master'
Daiki Ueno [Thu, 14 May 2020 05:51:05 +0000 (05:51 +0000)] 
Merge branch 'tmp-fips-leftover' into 'master'

fips: leftover fixes

See merge request gnutls/gnutls!1243

6 years agodevel: add libtasn1 submodule
Dmitry Baryshkov [Thu, 14 May 2020 02:28:20 +0000 (05:28 +0300)] 
devel: add libtasn1 submodule

GnuTLS maintains a part of libtasn1 sources in form of minitasn1 import.
Add libtasn1 submodule to ease synchronization with libtasn1.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agox509: generify oid to str conversions
Dmitry Baryshkov [Wed, 13 May 2020 23:15:23 +0000 (02:15 +0300)] 
x509: generify oid to str conversions

Make oid to name conversion functions generic enough by allowing caller
to specify a pointer to OID table.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>