]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
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 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 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 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 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>
6 years agoMerge branch 'aesni-xts' into 'master'
Daiki Ueno [Fri, 8 May 2020 14:42:17 +0000 (14:42 +0000)] 
Merge branch 'aesni-xts' into 'master'

accelerated: use AES-NI for AES-XTS when available

See merge request gnutls/gnutls!1244

6 years agoMerge branch 'cli-wait-resumption' into 'master'
Daiki Ueno [Fri, 8 May 2020 14:40:11 +0000 (14:40 +0000)] 
Merge branch 'cli-wait-resumption' into 'master'

gnutls-cli: Add option to wait longer for resumption data

See merge request gnutls/gnutls!1232

6 years agoaccelerated: use AES-NI for AES-XTS when available
Anderson Toshiyuki Sasaki [Mon, 4 May 2020 16:23:45 +0000 (18:23 +0200)] 
accelerated: use AES-NI for AES-XTS when available

This introduces a wrapper for the CRYPTOGAMS AES-XTS implementation
already present in the generated assembly code.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agognutls-cli: Add option to wait for resumption data
Anderson Toshiyuki Sasaki [Fri, 20 Mar 2020 15:37:33 +0000 (16:37 +0100)] 
gnutls-cli: Add option to wait for resumption data

This introduces the --waitresumption command line option which makes the
client to wait for the resumption data until a ticket is received under
TLS1.3.  The client will block if no ticket is received.  The new option
has no effect if the option --resume is not provided.

This is useful to force the client to wait for the resumption data when
the server takes long to send the ticket, allowing the session
resumption to be tested.  This is a common scenario in CI systems where
the testing machines have limited resources.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agobenchmark: enable AES-XTS cipher
Anderson Toshiyuki Sasaki [Tue, 5 May 2020 17:27:59 +0000 (19:27 +0200)] 
benchmark: enable AES-XTS cipher

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agonettle: disable RSA blinding in FIPS selftests
Daiki Ueno [Fri, 16 Aug 2019 15:01:05 +0000 (17:01 +0200)] 
nettle: disable RSA blinding in FIPS selftests

Nettle's RSA signing, encryption and decryption functions still
require randomness for blinding, so fallback to use a fixed buffer in
selftests where entropy might not be available.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'tmp-siv' into 'master'
Dmitry Baryshkov [Mon, 4 May 2020 14:40:07 +0000 (14:40 +0000)] 
Merge branch 'tmp-siv' into 'master'

nettle: expose SIV-CMAC through the AEAD interface

Closes #974 and #463

See merge request gnutls/gnutls!1238

6 years agoMerge branch 'tmp-reproducible-build' into 'master'
Tim Rühsen [Mon, 4 May 2020 13:03:56 +0000 (13:03 +0000)] 
Merge branch 'tmp-reproducible-build' into 'master'

New make target 'update-copyright-year'

Closes #980

See merge request gnutls/gnutls!1241

6 years agonettle: expose SIV-CMAC through the AEAD interface
Daiki Ueno [Sun, 26 Apr 2020 17:27:11 +0000 (19:27 +0200)] 
nettle: expose SIV-CMAC through the AEAD interface

This adds a couple of new cipher algorithms GNUTLS_CIPHER_AES_128_SIV
and GNUTLS_CIPHER_AES_256_SIV, exposing nettle_siv_cmac_aes{128,256}*
functions.  Note that they can only used with the AEAD interface and
authentication tags are prepended (not appended) to the ciphertext.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agonettle: vendor in SIV-CMAC implementation
Daiki Ueno [Sun, 26 Apr 2020 17:27:05 +0000 (19:27 +0200)] 
nettle: vendor in SIV-CMAC implementation

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agonettle: avoid manual backports of CFB8, CMAC, and XTS
Daiki Ueno [Sun, 26 Apr 2020 17:26:57 +0000 (19:26 +0200)] 
nettle: avoid manual backports of CFB8, CMAC, and XTS

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agonettle: rename import-chacha-from-nettle.sh to import-from-nettle.sh
Daiki Ueno [Sun, 26 Apr 2020 17:26:48 +0000 (19:26 +0200)] 
nettle: rename import-chacha-from-nettle.sh to import-from-nettle.sh

This script will handle other backports except ECC as well.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agoconfigure.ac: fix broken nettle_cfb8_decrypt detection
Daiki Ueno [Sun, 26 Apr 2020 17:26:36 +0000 (19:26 +0200)] 
configure.ac: fix broken nettle_cfb8_decrypt detection

Given the fixed version of the function will be part of Nettle 3.6,
use pkg-config --atleast-version instead of a manually comparison of
the Nettle version.

Fixes #974.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agoMerge branch 'tmp-reproducible-sig-doc' into 'master'
Daiki Ueno [Mon, 4 May 2020 12:24:10 +0000 (12:24 +0000)] 
Merge branch 'tmp-reproducible-sig-doc' into 'master'

doc: expand GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE description on RSA-PSS [ci skip]

Closes #953

See merge request gnutls/gnutls!1242

6 years agoNew make target 'update-copyright-year'
Tim Rühsen [Wed, 29 Apr 2020 10:41:52 +0000 (12:41 +0200)] 
New make target 'update-copyright-year'

We don't want to automatically update the copyright year as this
prevents reproducible builds.

Instead, 'make update-copyright-year' has to be executed at the
start of each new year and the changes have to be pushed.

Closes #980

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoMerge branch 'tmp-nettle-vko' into 'master'
Dmitry Baryshkov [Thu, 30 Apr 2020 11:45:16 +0000 (11:45 +0000)] 
Merge branch 'tmp-nettle-vko' into 'master'

gost: use gostdsa-vko from nettle 3.6rc2

See merge request gnutls/gnutls!1239

6 years agotests/prime-check: don't include gmp.h
Dmitry Baryshkov [Wed, 29 Apr 2020 17:43:23 +0000 (20:43 +0300)] 
tests/prime-check: don't include gmp.h

Do not include gmp.h header, <nettle/bignum.h> conflicts with it in
mini-gmp configuration and includes this header on it's own in
non-mini-gmp config.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agotests/srp: increase timeouts
Dmitry Baryshkov [Tue, 28 Apr 2020 14:45:40 +0000 (17:45 +0300)] 
tests/srp: increase timeouts

SRP test times out if running on the GitLab CI with mini-gmp version of
Nettle. Increase timeouts to let the test pass.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoCI: add nettle-mini-gmp test
Dmitry Baryshkov [Tue, 28 Apr 2020 12:48:29 +0000 (15:48 +0300)] 
CI: add nettle-mini-gmp test

Wget/Wget2 OSS-Fuzz builders use mini-gmp version of nettle. Check that
we do not break them occasionally.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agodoc: expand GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE description on RSA-PSS [ci skip]
Daiki Ueno [Thu, 30 Apr 2020 05:05:19 +0000 (07:05 +0200)] 
doc: expand GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE description on RSA-PSS [ci skip]

For RSA-PSS, this flag alone doens't fully enable reproducible
signatures and the user needs to indicate the fact that a zero-length
salt is used through SPKI upon verification.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
6 years agogost: use gostdsa-vko from nettle 3.6rc3
Dmitry Baryshkov [Tue, 28 Apr 2020 00:06:26 +0000 (03:06 +0300)] 
gost: use gostdsa-vko from nettle 3.6rc3

Now as we have upgraded Nettle to 3.6rc3 (which includes gostdsa_vko),
use this function from imported nettle sources.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agonettle: update imported source to nettle 3.6rc3
Dmitry Baryshkov [Tue, 28 Apr 2020 10:59:15 +0000 (13:59 +0300)] 
nettle: update imported source to nettle 3.6rc3

Update imported nettle version to 3.6rc3. This will bring in updated
gmp-glue code and a possiblity to use gostdsa-vko imported from nettle
sources.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'tmp-ext-name' into 'master'
Daiki Ueno [Fri, 24 Apr 2020 17:47:06 +0000 (17:47 +0000)] 
Merge branch 'tmp-ext-name' into 'master'

gnutls_session_ext_register: keep track of extension name

See merge request gnutls/gnutls!1224

6 years agoMerge branch 'tmp-check-soname' into 'master'
Daiki Ueno [Fri, 24 Apr 2020 17:41:02 +0000 (17:41 +0000)] 
Merge branch 'tmp-check-soname' into 'master'

fips: check library soname during configure

See merge request gnutls/gnutls!1231

6 years agofips: check library soname during configure
Daiki Ueno [Mon, 6 Apr 2020 12:37:53 +0000 (14:37 +0200)] 
fips: check library soname during configure

Previously, we hard-coded the sonames of linked libraries for FIPS
integrity checking.  That required downstream packagers to manually
adjust the relevant code in lib/fips.c, when a new interface version
of the dependent libraries (nettle, gmp) becomes available and linked
to libgnutls.

This patch automates that process with the configure script.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'tmp-update-gostdsa-vko' into 'master'
Dmitry Baryshkov [Tue, 21 Apr 2020 16:06:55 +0000 (16:06 +0000)] 
Merge branch 'tmp-update-gostdsa-vko' into 'master'

gost: update gostdsa_vko to follow Nettle

See merge request gnutls/gnutls!1237

6 years agognutls_session_ext_register: keep track of extension name
Daiki Ueno [Fri, 27 Mar 2020 08:53:38 +0000 (09:53 +0100)] 
gnutls_session_ext_register: keep track of extension name

Previously it discarded the name argument, and that was making the
debug output awkward, e.g., running tests/tls-session-ext-register -v:

  client|<4>| EXT[0x9cdc20]: Preparing extension ((null)/242) for 'client hello'
  client|<4>| EXT[0x9cdc20]: Preparing extension ((null)/241) for 'client hello'
  client|<4>| EXT[0x9cdc20]: Sending extension (null)/241 (2 bytes)

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agogost: update gostdsa_vko to follow Nettle
Dmitry Baryshkov [Sat, 15 Feb 2020 21:28:43 +0000 (00:28 +0300)] 
gost: update gostdsa_vko to follow Nettle

Update gostdsa_vko() following changes going to be accepted into Nettle.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agognutls_ext_get_name2: new function
Daiki Ueno [Tue, 21 Apr 2020 14:29:41 +0000 (16:29 +0200)] 
gnutls_ext_get_name2: new function

This adds a generalized version of gnutls_ext_get_name, which can
retrieve the name of the extension, even if it is registered per
session.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'tmp-no-auto-send-ticket' into 'master'
Daiki Ueno [Mon, 20 Apr 2020 06:12:33 +0000 (06:12 +0000)] 
Merge branch 'tmp-no-auto-send-ticket' into 'master'

handshake-tls13: add session flag to disable sending session tickets

See merge request gnutls/gnutls!1234

6 years agoMerge branch 'tmp-fix-ecc-freebsd' into 'master'
Dmitry Baryshkov [Sun, 19 Apr 2020 07:39:15 +0000 (07:39 +0000)] 
Merge branch 'tmp-fix-ecc-freebsd' into 'master'

build: attempt to fix build issues on FreeBSD

See merge request gnutls/gnutls!1236

6 years agoMerge branch 'tmp-xts-ig-a9' into 'master'
Daiki Ueno [Sun, 19 Apr 2020 05:24:38 +0000 (05:24 +0000)] 
Merge branch 'tmp-xts-ig-a9' into 'master'

xts: check key block according to FIPS-140-2 IG A.9

See merge request gnutls/gnutls!1233

6 years agobuild: attempt to fix build issues on FreeBSD
Dmitry Baryshkov [Thu, 16 Apr 2020 15:49:22 +0000 (18:49 +0300)] 
build: attempt to fix build issues on FreeBSD

BSD sed does not like \n and \0 in string substitution. Workaround this
by using sed magic.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'no-nettle-internal' into 'master'
Dmitry Baryshkov [Wed, 15 Apr 2020 17:10:42 +0000 (17:10 +0000)] 
Merge branch 'no-nettle-internal' into 'master'

Stop using Nettle and Hogweed internal symbols

See merge request gnutls/gnutls!1235

6 years agogitlab CI: when calling cppcheck ignore lib/nettle/ecc rather than lib/nettle/curve448
Dmitry Baryshkov [Wed, 15 Apr 2020 15:49:26 +0000 (18:49 +0300)] 
gitlab CI: when calling cppcheck ignore lib/nettle/ecc rather than lib/nettle/curve448

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agogitlab-ci: add test for usage of nettle/hogweed internal symbols
Dmitry Baryshkov [Tue, 14 Apr 2020 11:17:07 +0000 (14:17 +0300)] 
gitlab-ci: add test for usage of nettle/hogweed internal symbols

Check that GnuTLS does not depend on Nettle/Hogweed internal symbols.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agonettle: vendor in poly1305 code
Dmitry Baryshkov [Tue, 14 Apr 2020 10:47:43 +0000 (13:47 +0300)] 
nettle: vendor in poly1305 code

Nettle's poly1305 code ended up with internal symbol _poly1305_block in
public header. This causes issues on Nettle version changes. Since those
symbols are going to become nettle-internal, vendor in relevant source
file.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agogost: import _nettle_write_le32 to stop using Nettle's internal symbol
Dmitry Baryshkov [Mon, 13 Apr 2020 14:54:28 +0000 (17:54 +0300)] 
gost: import _nettle_write_le32 to stop using Nettle's internal symbol

Remove another dependency on nettle internal symbol by vendoring in
_nettle_write_le32 code

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agonettle: use new imported source files for GOST DSA
Dmitry Baryshkov [Mon, 13 Apr 2020 14:06:06 +0000 (17:06 +0300)] 
nettle: use new imported source files for GOST DSA

Provide GOST support using source files copied by script rather than
manually crafted by me.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agobuild: import-curve448 -> import-ecc
Dmitry Baryshkov [Mon, 13 Apr 2020 13:11:02 +0000 (16:11 +0300)] 
build: import-curve448 -> import-ecc

As the script now imports not just Curve448, but also gost code, rename
the script, target directory and symbols to follow that.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoxts: check key blocks according to FIPS-140-2 IG A.9
Daiki Ueno [Sat, 11 Apr 2020 13:28:29 +0000 (15:28 +0200)] 
xts: check key blocks according to FIPS-140-2 IG A.9

The implementation guidance suggests that a check of key1 != key2
should be done at any place before the keys are used:
https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Module-Validation-Program/documents/fips140-2/FIPS1402IG.pdf

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agodevel: modify curve448 script to import gost sources
Dmitry Baryshkov [Mon, 13 Apr 2020 13:08:29 +0000 (16:08 +0300)] 
devel: modify curve448 script to import gost sources

Curve448 script already imports several ecc sources into GnuTLS tree.
Modify it to also vendor in GOST-related ecc files.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoimport-chacha: fix several additional symbol clashes
Dmitry Baryshkov [Mon, 13 Apr 2020 09:43:42 +0000 (12:43 +0300)] 
import-chacha: fix several additional symbol clashes

Fix sed script used to rename symbols to remove few additional symbols
sitting in _nettle_FOO namespace.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agocurve448: import write-le64.c which defines internal symbol
Dmitry Baryshkov [Mon, 13 Apr 2020 09:59:12 +0000 (12:59 +0300)] 
curve448: import write-le64.c which defines internal symbol

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoimport-curve448: fix several additional symbol clashes
Dmitry Baryshkov [Mon, 13 Apr 2020 09:43:42 +0000 (12:43 +0300)] 
import-curve448: fix several additional symbol clashes

Fix sed script used to rename symbols to remove few additional symbols
sitting in _nettle_FOO namespace.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agohandshake-tls13: add session flag to disable sending session tickets
Daiki Ueno [Mon, 30 Mar 2020 09:27:40 +0000 (11:27 +0200)] 
handshake-tls13: add session flag to disable sending session tickets

While GnuTLS by default implicitly sends NewSessionTicket during
handshake, application protocols like QUIC set a clear boundary
between "in handshake" and "post handshake", and NST must be sent in
the post handshake state.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'ftbfs20201024' into 'master'
Nikos Mavrogiannopoulos [Mon, 6 Apr 2020 14:04:11 +0000 (14:04 +0000)] 
Merge branch 'ftbfs20201024' into 'master'

tests: Fix status-request-revoked after 2020-10-24

Closes #967

See merge request gnutls/gnutls!1230

6 years agotests: Fix status-request-revoked after 2020-10-24
Bernhard M. Wiedemann [Sun, 5 Apr 2020 13:09:57 +0000 (15:09 +0200)] 
tests: Fix status-request-revoked after 2020-10-24

included certs expire 2020-10-24 so this test fails after that date.

Fixes #967

This patch was done while working on reproducible builds for openSUSE.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
6 years agoMerge branch 'tmp-valgrind-memcheck' into 'master'
Nikos Mavrogiannopoulos [Sun, 5 Apr 2020 11:04:54 +0000 (11:04 +0000)] 
Merge branch 'tmp-valgrind-memcheck' into 'master'

build: use valgrind client request to detect undefined memory use

See merge request gnutls/gnutls!1228

6 years agoMerge branch 'compare_dn' into 'master'
Nikos Mavrogiannopoulos [Sun, 5 Apr 2020 11:03:50 +0000 (11:03 +0000)] 
Merge branch 'compare_dn' into 'master'

Compare DNs by comparing their string representations

Closes #553

See merge request gnutls/gnutls!1223

6 years agobuild: use valgrind client request to detect undefined memory use
Daiki Ueno [Tue, 31 Mar 2020 04:58:48 +0000 (06:58 +0200)] 
build: use valgrind client request to detect undefined memory use

This tightens the check introduced in
ac2f71b892d13a7ab4cc39086eef179042c7e23c, by using the valgrind client
request to explicitly mark the "uninitialized but initialization is
needed before use" regions.  With this patch and the
fix (c01011c2d8533dbbbe754e49e256c109cb848d0d) reverted, you will see
the following error when running dtls_hello_random_value under
valgrind:

  $ valgrind ./dtls_hello_random_value
  testing: default
  ==520145== Conditional jump or move depends on uninitialised value(s)
  ==520145==    at 0x4025F5: hello_callback (dtls_hello_random_value.c:90)
  ==520145==    by 0x488BF97: _gnutls_call_hook_func (handshake.c:1215)
  ==520145==    by 0x488C1AA: _gnutls_send_handshake2 (handshake.c:1332)
  ==520145==    by 0x488FC7E: send_client_hello (handshake.c:2290)
  ==520145==    by 0x48902A1: handshake_client (handshake.c:2908)
  ==520145==    by 0x48902A1: gnutls_handshake (handshake.c:2740)
  ==520145==    by 0x402CB3: client (dtls_hello_random_value.c:153)
  ==520145==    by 0x402CB3: start (dtls_hello_random_value.c:317)
  ==520145==    by 0x402EFE: doit (dtls_hello_random_value.c:331)
  ==520145==    by 0x4023D4: main (utils.c:254)
  ==520145==

Signed-off-by: Daiki Ueno <dueno@redhat.com>