]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
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>
6 years agoCompare DNs by comparing their string representations
Pierre Ossman [Tue, 24 Mar 2020 14:32:13 +0000 (15:32 +0100)] 
Compare DNs by comparing their string representations

A binary comparison will not work in case the contents is the same but
the ASN.1 type differ (e.g. PrintableString vs UTF8String). Such
variations are permitted so we need to handle them.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
6 years agoProperly compare DNs when checking sorting
Pierre Ossman [Tue, 24 Mar 2020 14:29:34 +0000 (15:29 +0100)] 
Properly compare DNs when checking sorting

We might want to do other things than a simple memcmp() so make sure
we're using the right helper when comparing DNs.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
6 years agoMerge branch 'tmp-libidn-simplify' into 'master'
Nikos Mavrogiannopoulos [Fri, 3 Apr 2020 09:42:12 +0000 (09:42 +0000)] 
Merge branch 'tmp-libidn-simplify' into 'master'

IDNA: require libidn2 2.0.0

Closes #832

See merge request gnutls/gnutls!1229

6 years agoIDNA: require libidn2 2.0.0
Nikos Mavrogiannopoulos [Tue, 31 Mar 2020 14:58:07 +0000 (16:58 +0200)] 
IDNA: require libidn2 2.0.0

We require private symbols which dissapear at some point in
IDN2 releases in order to support old versions of libidn2. Simplify
the code by requiring only recent versions and avoid issues such
as #832.

Resolves: #832

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
6 years agoNEWS: updated for release 3.6.13
Nikos Mavrogiannopoulos [Tue, 31 Mar 2020 05:40:21 +0000 (07:40 +0200)] 
NEWS: updated for release

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoNEWS: doc update
Nikos Mavrogiannopoulos [Mon, 30 Mar 2020 18:52:36 +0000 (20:52 +0200)] 
NEWS: doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agobumped version
Nikos Mavrogiannopoulos [Mon, 30 Mar 2020 18:52:27 +0000 (20:52 +0200)] 
bumped version

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoMerge branch 'tmp-added-reproducer-for-960' into 'master'
Nikos Mavrogiannopoulos [Mon, 30 Mar 2020 18:49:53 +0000 (18:49 +0000)] 
Merge branch 'tmp-added-reproducer-for-960' into 'master'

Added reproducer for fix in !1225

See merge request gnutls/gnutls!1227

6 years agoMerge branch 'fix-padlock' into 'master'
Nikos Mavrogiannopoulos [Mon, 30 Mar 2020 08:03:55 +0000 (08:03 +0000)] 
Merge branch 'fix-padlock' into 'master'

Fix padlock accelerated code

Closes #930

See merge request gnutls/gnutls!1226

6 years agoNEWS: doc update
Nikos Mavrogiannopoulos [Sun, 29 Mar 2020 19:30:37 +0000 (21:30 +0200)] 
NEWS: doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
6 years agotests: added check for random value of client and server hello in TLS
Nikos Mavrogiannopoulos [Sun, 29 Mar 2020 19:30:37 +0000 (21:30 +0200)] 
tests: added check for random value of client and server hello in TLS

This creates a tests that checks whether the TLS client and server
hello have sufficient non-zero bytes.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
6 years agotests: added reproducer for client hello random value behavior in DTLS
Nikos Mavrogiannopoulos [Sun, 29 Mar 2020 17:05:30 +0000 (19:05 +0200)] 
tests: added reproducer for client hello random value behavior in DTLS

This adds an equivalent test of tls13/hello_random_value.c for DTLS
and extends the tests for server hello as well.

Relates: #960

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agopsk: added checks to satisfy static analyzers
Nikos Mavrogiannopoulos [Mon, 30 Mar 2020 06:23:03 +0000 (08:23 +0200)] 
psk: added checks to satisfy static analyzers

Added null checks in legacy callbacks to avoid warnings from
static analyzers. The issues do not appear to be reproducible
in real-world use.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoMerge branch 'fix-dlts-client-zero-random' into 'master'
Nikos Mavrogiannopoulos [Sun, 29 Mar 2020 19:44:25 +0000 (19:44 +0000)] 
Merge branch 'fix-dlts-client-zero-random' into 'master'

dtls client hello: fix zeroed random (fixes #960)

Closes #960

See merge request gnutls/gnutls!1225

6 years agopadlock: fix exception in wrap_padlock_hash_fast
Dmitry Baryshkov [Fri, 27 Mar 2020 23:31:10 +0000 (02:31 +0300)] 
padlock: fix exception in wrap_padlock_hash_fast

wrap_padlock_hash_fast() allocates a context on a stack (via local
variable) then tries to free it by calling wrap_padlock_hash_deinit()
causing a crash. Remove a call to deinit() to fix a crash.

Fixes #930

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agopadlock: fix exception in sha code
Dmitry Baryshkov [Fri, 27 Mar 2020 23:29:31 +0000 (02:29 +0300)] 
padlock: fix exception in sha code

padlock sha code will segfault (at least on Nano) if it is passed a NULL
data pointer (even if size is 0). Pass digest output buffer as a dummy
data pointer in such case.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agopadlock: make cbc code return error properly
Dmitry Baryshkov [Fri, 27 Mar 2020 23:27:31 +0000 (02:27 +0300)] 
padlock: make cbc code return error properly

If underlying padlock_cbc_en/decrypt return an error, pass this error to
calling code.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agodtls client hello: fix zeroed random (fixes #960)
Stefan Bühler [Fri, 27 Mar 2020 16:17:57 +0000 (17:17 +0100)] 
dtls client hello: fix zeroed random (fixes #960)

This broke with bcf4de03 "handshake: treat reply to HRR as a reply to
hello verify request", which failed to "De Morgan" properly.

Signed-off-by: Stefan Bühler <stbuehler@web.de>
6 years agoMerge branch 'better_SSL3.0_tests' into 'master'
Nikos Mavrogiannopoulos [Fri, 27 Mar 2020 08:54:24 +0000 (08:54 +0000)] 
Merge branch 'better_SSL3.0_tests' into 'master'

improve gnutls-cli-debug testing of old SSL 3.0 servers

See merge request gnutls/gnutls!1221

6 years agoMerge branch 'tmp-get-keylog-func' into 'master'
Daiki Ueno [Wed, 25 Mar 2020 14:29:36 +0000 (14:29 +0000)] 
Merge branch 'tmp-get-keylog-func' into 'master'

gnutls_session_get_keylog_function: new function

See merge request gnutls/gnutls!1220

6 years agoMerge branch 'fix_echo_serv' into 'master'
Daiki Ueno [Tue, 24 Mar 2020 14:16:27 +0000 (14:16 +0000)] 
Merge branch 'fix_echo_serv' into 'master'

gnutls-serv: Do not exit when a message to be echoed is received

Closes #959

See merge request gnutls/gnutls!1222

6 years agognutls-serv: Do not exit when a message to be echoed is received
Anderson Toshiyuki Sasaki [Tue, 24 Mar 2020 08:55:08 +0000 (09:55 +0100)] 
gnutls-serv: Do not exit when a message to be echoed is received

Previously, when gnutls-serv was executed with the --echo option, it
would exit when a message to be echoed was received.  Moreover, the
server would output "Memory error" although no error occurred.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agoMerge branch 'ajuaristi-issue-586' into 'master'
Nikos Mavrogiannopoulos [Tue, 24 Mar 2020 08:26:01 +0000 (08:26 +0000)] 
Merge branch 'ajuaristi-issue-586' into 'master'

support non-NULL-terminated PSKs

Closes #586

See merge request gnutls/gnutls!917

6 years agoMerge branch 'postpone_config_loading' into 'master'
Daiki Ueno [Mon, 23 Mar 2020 16:30:58 +0000 (16:30 +0000)] 
Merge branch 'postpone_config_loading' into 'master'

global: Load configuration after FIPS POST

Closes #956

See merge request gnutls/gnutls!1216

6 years ago_gnutls_check_id_for_change: ensure that we check the username length
Nikos Mavrogiannopoulos [Wed, 18 Mar 2020 10:23:47 +0000 (11:23 +0100)] 
_gnutls_check_id_for_change: ensure that we check the username length

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoEnsure that an incorrectly formatted password file doesn't cause invalid memory access
Nikos Mavrogiannopoulos [Wed, 18 Mar 2020 10:01:53 +0000 (10:01 +0000)] 
Ensure that an incorrectly formatted password file doesn't cause invalid memory access

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoUpdate NEWS file
Ander Juaristi [Sun, 15 Mar 2020 22:31:49 +0000 (23:31 +0100)] 
Update NEWS file

Signed-off-by: Ander Juaristi <a@juaristi.eus>
6 years agoUpdate files
Ander Juaristi [Tue, 3 Mar 2020 11:49:32 +0000 (11:49 +0000)] 
Update files

Signed-off-by: Ander Juaristi <a@juaristi.eus>
6 years agopsk: Allow non-NULL PSK usernames
Ander Juaristi [Mon, 2 Mar 2020 15:37:10 +0000 (16:37 +0100)] 
psk: Allow non-NULL PSK usernames

This commit closes #586.

Two new functions are introduced: gnutls_psk_server_get_username2()
and gnutls_psk_set_client_username2(), which are identical in behavior
to those named similarly (without the final '2'), but allow arbitrary
gnutls datums (not strings) to be used as usernames.

Two new callback functions are also introduced, with their respective
setters: gnutls_psk_set_server_credentials_function2() and
gnutls_psk_set_client_credentials_function2().

In addition, the password file format is extended so that non-string
usernames can be specified. A leading '#' character tells GnuTLS that the
username should be interpreted as a raw byte string (encoded in HEX).

Example:

    #deadbeef:9e32cf7786321a828ef7668f09fb35db

Signed-off-by: Ander Juaristi's avatarAnder Juaristi <a@juaristi.eus>
6 years agoMerge branch 'fix-fuzz' into 'master'
Tim Rühsen [Mon, 23 Mar 2020 12:45:22 +0000 (12:45 +0000)] 
Merge branch 'fix-fuzz' into 'master'

Two fixes for oss-fuzz build target

See merge request gnutls/gnutls!1219

6 years agoadd NEWS entry
Daniel Lenski [Mon, 23 Mar 2020 02:12:44 +0000 (19:12 -0700)] 
add NEWS entry

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
6 years agoadd additional tests of SSL 3.0 (with extensions, and with cipher suites not in SSL...
Daniel Lenski [Mon, 23 Mar 2020 02:01:55 +0000 (19:01 -0700)] 
add additional tests of SSL 3.0 (with extensions, and with cipher suites not in SSL 3.0)

See #958

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
6 years agotest_ssl3: minimize cipher suites to those actually included in SSL 3.0
Daniel Lenski [Mon, 23 Mar 2020 02:00:32 +0000 (19:00 -0700)] 
test_ssl3: minimize cipher suites to those actually included in SSL 3.0

See #958

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
6 years agoSSL 3.0 (RFC6101) doesn't actually appear to require extensions, and some servers...
Daniel Lenski [Mon, 23 Mar 2020 01:58:26 +0000 (18:58 -0700)] 
SSL 3.0 (RFC6101) doesn't actually appear to require extensions, and some servers don't accept them

See #958

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
6 years agognutls_session_get_keylog_function: new function
Daiki Ueno [Sun, 22 Mar 2020 09:44:51 +0000 (10:44 +0100)] 
gnutls_session_get_keylog_function: new function

This adds a way to retrieve the keylog function set by
gnutls_session_set_keylog_function() to allow application protocols to
implement custom logging facility.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agooss-fuzz: return build error if fuzzers have failed to build
Dmitry Baryshkov [Sun, 22 Mar 2020 13:07:12 +0000 (16:07 +0300)] 
oss-fuzz: return build error if fuzzers have failed to build

Instead of silently ignoring build errors and running fewer fuzzers,
exit on the first build error.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agooss-fuzz: use CC rather than CXX to compile fuzzers
Dmitry Baryshkov [Sun, 22 Mar 2020 13:05:40 +0000 (16:05 +0300)] 
oss-fuzz: use CC rather than CXX to compile fuzzers

clang++ will choke on several fuzzer sources because C++ is stricter
than C wrt. type conversion:

gnutls_base64_decoder_fuzzer.c:26:63: error: non-constant-expression
cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'unsigned
int' in initializer list [-Wc++11-narrowing]
        gnutls_datum_t raw = {.data = (unsigned char *)data, .size = size};

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'tmp-fuzz-readme' into 'master'
Tim Rühsen [Sun, 22 Mar 2020 12:34:39 +0000 (12:34 +0000)] 
Merge branch 'tmp-fuzz-readme' into 'master'

fuzz: Update README.md for clang-9 [skip ci]

See merge request gnutls/gnutls!1218

6 years agofuzz: Update README.md for clang-9 [skip ci]
Tim Rühsen [Thu, 19 Mar 2020 16:49:11 +0000 (17:49 +0100)] 
fuzz: Update README.md for clang-9 [skip ci]

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoMerge branch 'eddsa-pkcs11' into 'master'
Nikos Mavrogiannopoulos [Fri, 20 Mar 2020 12:37:16 +0000 (12:37 +0000)] 
Merge branch 'eddsa-pkcs11' into 'master'

Add support for loading Ed25519 keys from PKCS#11 and using them

Closes #946

See merge request gnutls/gnutls!1200

6 years agoMerge branch 'tmp-prf-get' into 'master'
Daiki Ueno [Fri, 20 Mar 2020 06:09:35 +0000 (06:09 +0000)] 
Merge branch 'tmp-prf-get' into 'master'

state: add function to get the current hash algorithm

See merge request gnutls/gnutls!1217

6 years agostate: add function to get the current hash algorithm
Daiki Ueno [Sun, 15 Mar 2020 10:18:30 +0000 (11:18 +0100)] 
state: add function to get the current hash algorithm

This is particularly useful when the application applies key
derivation function by itself with the same underlying hash algorithm
as the session.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'tmp-chacha' into 'master'
Daiki Ueno [Thu, 19 Mar 2020 12:49:08 +0000 (12:49 +0000)] 
Merge branch 'tmp-chacha' into 'master'

cipher: expose raw ChaCha20 cipher

See merge request gnutls/gnutls!1210

6 years agoabi: add enum values for GNUTLS_CIPHER_CHACHA20_*
Daiki Ueno [Sat, 14 Mar 2020 08:53:31 +0000 (09:53 +0100)] 
abi: add enum values for GNUTLS_CIPHER_CHACHA20_*

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agocipher: allow setting ChaCha20 initial block counter
Daiki Ueno [Sat, 14 Mar 2020 05:09:56 +0000 (06:09 +0100)] 
cipher: allow setting ChaCha20 initial block counter

This also introduces GNUTLS_CIPHER_CHACHA20_32, which is a 96-bit
nonce variant of GNUTLS_CIPHER_CHACHA20_64.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agonettle: vendor in ChaCha20 implementation from nettle
Daiki Ueno [Fri, 13 Mar 2020 16:24:26 +0000 (17:24 +0100)] 
nettle: vendor in ChaCha20 implementation from nettle

This enables to use bundled ChaCha20 implementation if the system
nettle doesn't have nettle_chacha_set_counter.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agocipher: expose raw ChaCha20 cipher
Daiki Ueno [Sat, 14 Mar 2020 05:01:49 +0000 (06:01 +0100)] 
cipher: expose raw ChaCha20 cipher

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoglobal: Load configuration after FIPS POST
Anderson Toshiyuki Sasaki [Wed, 18 Mar 2020 15:17:39 +0000 (16:17 +0100)] 
global: Load configuration after FIPS POST

Previously, if the loaded configuration file disabled an algorithm
tested during FIPS-140 power-on self-tests, the test would fail.  By
loading the configuration file after the test is finished, such failure
is avoided as any algorithm is allowed during the tests.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agoMerge branch 'tmp-ed448-fixes' into 'master'
Daiki Ueno [Wed, 18 Mar 2020 10:07:42 +0000 (10:07 +0000)] 
Merge branch 'tmp-ed448-fixes' into 'master'

ed448: fix certificate signature verification

See merge request gnutls/gnutls!1213