]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
7 years agodrbg-aes: removed the continuous DRBG checks
Nikos Mavrogiannopoulos [Mon, 18 Jun 2018 13:10:32 +0000 (15:10 +0200)] 
drbg-aes: removed the continuous DRBG checks

These are no longer necessary for FIPS140-2 compliance.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'fix-autoreconf' into 'master'
Nikos Mavrogiannopoulos [Sat, 16 Jun 2018 21:27:49 +0000 (21:27 +0000)] 
Merge branch 'fix-autoreconf' into 'master'

Fix usage of 'autoreconf'

See merge request gnutls/gnutls!667

7 years agoFix usage of 'autoreconf'
Tim Rühsen [Fri, 15 Jun 2018 17:39:22 +0000 (19:39 +0200)] 
Fix usage of 'autoreconf'

'autoreconf' created a different configure script than ./bootstrap.
The result was a broken wchar.h that failed to compile.

The work-around was 'autoreconf -I gl/m4' which is not what a developer
expects. This patch moves gl/m4/* to m4/ which is the default include dir
for autoreconf.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoconfigure: Check for clock_gettime and fmemopen using a proper test
Martin Storsjo [Thu, 14 Jun 2018 09:53:42 +0000 (12:53 +0300)] 
configure: Check for clock_gettime and fmemopen using a proper test

Don't use AC_CHECK_FUNCS for these functions, but actually test by
including the real header that defines the functions. This allows
the macOS version selection work as intended, making the references
to these functions weak if targeting a version of macOS where these
functions aren't available. Thanks to -no_weak_imports, these weak
references end up in failed linker tests, marking the functions as
unavailable.

This fixes issue #142.

Signed-off-by: Martin Storsjo <martin@martin.st>
7 years agoconfigure: Include sys/random.h before checking for getentropy on macOS
Martin Storsjo [Thu, 14 Jun 2018 09:52:03 +0000 (12:52 +0300)] 
configure: Include sys/random.h before checking for getentropy on macOS

This function is available since macOS 10.12, but it's in
sys/random.h on macOS, contrary to the other platforms supporting
it where it is present in unistd.h.

If we don't include the right header that declares the function
and its availability, the configure check would succeed even if
targeting older versions of macOS that lacks the function.

Also include the same header in the source file that actually
uses getentropy.

Signed-off-by: Martin Storsjo <martin@martin.st>
7 years agoconfigure: Pass -no_weak_imports to the linker, if supported
Martin Storsjo [Thu, 14 Jun 2018 09:36:10 +0000 (12:36 +0300)] 
configure: Pass -no_weak_imports to the linker, if supported

This avoids linking to functions that aren't available in the
lowest targeted macOS version.

If the proper header declaring a function is included, and
gnutls is built with -mmacosx-version-min or the
MACOSX_DEPLOYMENT_TARGET environment variable is set, each
reference to a function that doesn't exist in the minimum
targeted version will be made a weak reference, so that loading
the binary still works, but the function pointer will resolve
to NULL if running on a version of the platform that lacks it.

Since this project doesn't do such runtime checks for functions
it expects to have available, we should instead add this linker
option to fail on the weak references. This allows autoconf to
work as intended, detecting that these functions aren't usable.

This flag appeared in Xcode 8, so check for its availability
before using it. (Xcode 8 and the 10.12 SDK is coincidentally
the release where most relevant new functions appeared, so with
older Xcode versions, the modern platform functions we might want
to avoid don't exist.)

See issue #142.

Signed-off-by: Martin Storsjo <martin@martin.st>
7 years agoconfigure: Remove a duplicate check for fmemopen
Martin Storsjo [Thu, 14 Jun 2018 10:47:41 +0000 (13:47 +0300)] 
configure: Remove a duplicate check for fmemopen

The duplicate was added in 5bb8a18b without any specific reasoning
as to why.

Signed-off-by: Martin Storsjo <martin@martin.st>
7 years agoMerge branch 'tmp-tlsfuzzer-tls13-hrr' into 'master'
Nikos Mavrogiannopoulos [Fri, 15 Jun 2018 14:44:55 +0000 (14:44 +0000)] 
Merge branch 'tmp-tlsfuzzer-tls13-hrr' into 'master'

update tlsfuzzer with TLS 1.3 HRR test

Closes #469

See merge request gnutls/gnutls!664

7 years agotlsfuzzer: update to the latest version
Daiki Ueno [Wed, 13 Jun 2018 15:50:20 +0000 (17:50 +0200)] 
tlsfuzzer: update to the latest version

Also enable test-tls13-hrr.py.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years ago_gnutls13_handshake_server: send CCS immediately after HRR
Daiki Ueno [Wed, 13 Jun 2018 15:47:50 +0000 (17:47 +0200)] 
_gnutls13_handshake_server: send CCS immediately after HRR

In the TLS 1.3 middlebox compatibility mode, CCS follows the first
handshake message sent from the server, that is either SH or HRR.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years ago_gnutls13_handshake_server: corrected transition when post_handshake callback is set
Nikos Mavrogiannopoulos [Thu, 14 Jun 2018 11:43:30 +0000 (13:43 +0200)] 
_gnutls13_handshake_server: corrected transition when post_handshake callback is set

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years ago_gnutls_send_change_cipher_spec: don't cache under TLS 1.3
Daiki Ueno [Wed, 13 Jun 2018 15:43:32 +0000 (17:43 +0200)] 
_gnutls_send_change_cipher_spec: don't cache under TLS 1.3

Under TLS 1.3, when the server sent HRR, CCS may be followed by
receiving ClientHello.  In that case, the messsage shouldn't be
cached.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoMerge branch 'tmp-iovec-api' into 'master'
Nikos Mavrogiannopoulos [Thu, 14 Jun 2018 19:38:38 +0000 (19:38 +0000)] 
Merge branch 'tmp-iovec-api' into 'master'

Introduce an iovec API for encryption

Closes #458

See merge request gnutls/gnutls!653

7 years agoabi-check skip session::set_transport_vec_push_function
Nikos Mavrogiannopoulos [Sun, 10 Jun 2018 09:42:10 +0000 (11:42 +0200)] 
abi-check skip session::set_transport_vec_push_function

This prevents an abi-compliance checker error when run under
gcc8 (though this error is not there under any other gcc).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agocorrected check for iovec types in libc
Nikos Mavrogiannopoulos [Sun, 27 May 2018 13:13:47 +0000 (15:13 +0200)] 
corrected check for iovec types in libc

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Sat, 2 Jun 2018 20:23:29 +0000 (22:23 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agognutls-cli: benchmark for TLS1.3 and TLS1.2
Nikos Mavrogiannopoulos [Sat, 2 Jun 2018 20:15:58 +0000 (22:15 +0200)] 
gnutls-cli: benchmark for TLS1.3 and TLS1.2

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agocipher: use gnutls_aead_cipher_encryptv
Nikos Mavrogiannopoulos [Sat, 2 Jun 2018 19:37:00 +0000 (21:37 +0200)] 
cipher: use gnutls_aead_cipher_encryptv

This eliminates the need of a memory allocation during each
packet encryption when no padding is done.

Relates #458

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agognutls_aead_cipher_encryptv: introduced
Nikos Mavrogiannopoulos [Sat, 2 Jun 2018 19:25:10 +0000 (21:25 +0200)] 
gnutls_aead_cipher_encryptv: introduced

This API allows encryption using a scatter input, by also
taking advantage of ciphers which are optimized for such input.
That is particularly useful under TLS1.3 since its encryption is
based on encryption of scattered data (data+pad).

Resolves #458

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMAX_CIPHER_BLOCK_SIZE: increased to 64-bytes for CHACHA20
Nikos Mavrogiannopoulos [Sat, 2 Jun 2018 19:23:41 +0000 (21:23 +0200)] 
MAX_CIPHER_BLOCK_SIZE: increased to 64-bytes for CHACHA20

This was not necessary since that value was only used by block
(in TLS sense) ciphers, but that definition could also be used
for the CHACHA20.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoconfigure: reduce warnings about implicit-fallthrough [ci skip]
Nikos Mavrogiannopoulos [Thu, 14 Jun 2018 12:51:23 +0000 (14:51 +0200)] 
configure: reduce warnings about implicit-fallthrough [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agognutls_alert_send_appropriate: fix type
Nikos Mavrogiannopoulos [Thu, 14 Jun 2018 11:22:03 +0000 (13:22 +0200)] 
gnutls_alert_send_appropriate: fix type

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoREADME-ci.freebsd.md: updated for new build method with gnulib [ci skip]
Nikos Mavrogiannopoulos [Thu, 14 Jun 2018 11:18:54 +0000 (13:18 +0200)] 
README-ci.freebsd.md: updated for new build method with gnulib [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'gnulib-bootstrap' into 'master'
Nikos Mavrogiannopoulos [Thu, 14 Jun 2018 10:38:29 +0000 (10:38 +0000)] 
Merge branch 'gnulib-bootstrap' into 'master'

Gnulib bootstrap, fix 'make distcheck' and more...

See merge request gnutls/gnutls!641

7 years agoUse $(MAKE) instead of make
Tim Rühsen [Wed, 6 Jun 2018 07:45:32 +0000 (09:45 +0200)] 
Use $(MAKE) instead of make

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agodistclean temp. test files for 'make distcheck'
Tim Rühsen [Tue, 5 Jun 2018 15:06:05 +0000 (17:06 +0200)] 
distclean temp. test files for 'make distcheck'

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoAdd DISTCLEANFILES to src/Makefile.am to fix 'make distcheck'
Tim Rühsen [Tue, 5 Jun 2018 08:58:10 +0000 (10:58 +0200)] 
Add DISTCLEANFILES to src/Makefile.am to fix 'make distcheck'

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoFix creation of ChangeLog for 'make distcheck'
Tim Rühsen [Mon, 4 Jun 2018 14:15:07 +0000 (16:15 +0200)] 
Fix creation of ChangeLog for 'make distcheck'

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoFix 'compare-makefile' make target for 'make distcheck'
Tim Rühsen [Mon, 4 Jun 2018 09:56:57 +0000 (11:56 +0200)] 
Fix 'compare-makefile' make target for 'make distcheck'

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoFix 'compare-exported' make target for 'make distcheck'
Tim Rühsen [Mon, 4 Jun 2018 09:33:18 +0000 (11:33 +0200)] 
Fix 'compare-exported' make target for 'make distcheck'

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoFix distcheck issues
Tim Rühsen [Thu, 31 May 2018 11:20:51 +0000 (13:20 +0200)] 
Fix distcheck issues

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoFix gcc 8 warnings
Tim Rühsen [Mon, 21 May 2018 14:25:20 +0000 (16:25 +0200)] 
Fix gcc 8 warnings

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoFix CI testing -Werror
Tim Rühsen [Sat, 19 May 2018 11:24:58 +0000 (13:24 +0200)] 
Fix CI testing -Werror

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoSkip sc_prohibit_always_true_header_tests
Tim Rühsen [Sat, 19 May 2018 08:19:32 +0000 (10:19 +0200)] 
Skip sc_prohibit_always_true_header_tests

We can't simply remove the checks for HAVE_SYS_SOCKET_H.
If we do, we have to make checks on real WIN32, which
is currently not an option.
So we skip sc_prohibit_always_true_header_tests.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoFix sc_prohibit_always-defined_macros
Tim Rühsen [Sat, 19 May 2018 07:37:24 +0000 (09:37 +0200)] 
Fix sc_prohibit_always-defined_macros

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoAvoid certain gnulib tests
Tim Rühsen [Fri, 18 May 2018 21:23:26 +0000 (23:23 +0200)] 
Avoid certain gnulib tests

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoUpdate GTK-DOC check in configure.ac
Tim Rühsen [Fri, 18 May 2018 21:10:16 +0000 (23:10 +0200)] 
Update GTK-DOC check in configure.ac

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoUse ./bootstrap in .gitlab-ci.yml
Tim Rühsen [Wed, 6 Jun 2018 07:19:45 +0000 (09:19 +0200)] 
Use ./bootstrap in .gitlab-ci.yml

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoAdd bootstrap + bootstrap.conf
Tim Rühsen [Fri, 18 May 2018 18:31:31 +0000 (20:31 +0200)] 
Add bootstrap + bootstrap.conf

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoAdd gnulib submodule
Tim Rühsen [Fri, 18 May 2018 18:06:16 +0000 (20:06 +0200)] 
Add gnulib submodule

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoMerge branch 'req-nettle-3_4' into 'master'
Nikos Mavrogiannopoulos [Thu, 14 Jun 2018 06:26:03 +0000 (06:26 +0000)] 
Merge branch 'req-nettle-3_4' into 'master'

nettle: require Nettle library >= 3.4

See merge request gnutls/gnutls!662

7 years agonettle: require Nettle library >= 3.4
Dmitry Eremin-Solenikov [Wed, 13 Jun 2018 09:12:18 +0000 (12:12 +0300)] 
nettle: require Nettle library >= 3.4

Nettle version 3.4 was released more than a half year ago, require it to
compile GnuTLS library. It allows us to remove bundled code that was
merged into that release.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoMerge branch 'tmp-tlsfuzzer-tls13' into 'master'
Nikos Mavrogiannopoulos [Wed, 13 Jun 2018 08:37:46 +0000 (08:37 +0000)] 
Merge branch 'tmp-tlsfuzzer-tls13' into 'master'

update tlsfuzzer with TLS 1.3

Closes #411

See merge request gnutls/gnutls!660

7 years ago.gitlab-ci.yml: fix artifact paths for TLS1.3/interop
Daiki Ueno [Tue, 12 Jun 2018 11:01:17 +0000 (13:01 +0200)] 
.gitlab-ci.yml: fix artifact paths for TLS1.3/interop

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agotlsfuzzer-tls13: use a random port for testing
Nikos Mavrogiannopoulos [Tue, 12 Jun 2018 07:12:07 +0000 (09:12 +0200)] 
tlsfuzzer-tls13: use a random port for testing

That eliminates the need for locking and allows parallel runs.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agotlsfuzzer: update to the latest version
Daiki Ueno [Fri, 8 Jun 2018 11:13:27 +0000 (13:13 +0200)] 
tlsfuzzer: update to the latest version

Also enable the TLS 1.3 tests.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agobuffers: remove redundant assignment
Daiki Ueno [Mon, 11 Jun 2018 10:08:18 +0000 (12:08 +0200)] 
buffers: remove redundant assignment

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agorecord: use correct alert type upon receiving empty Alert
Daiki Ueno [Mon, 11 Jun 2018 08:51:16 +0000 (10:51 +0200)] 
record: use correct alert type upon receiving empty Alert

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agorecord: improve empty message handling in TLS 1.3
Daiki Ueno [Fri, 8 Jun 2018 13:55:06 +0000 (15:55 +0200)] 
record: improve empty message handling in TLS 1.3

Previously, _gnutls_recv_in_buffers() silently discarded empty
messages because such messages are used as a countermeasure to
vulnerabilities in the CBC mode.  In TLS 1.3, however, there are only
AEAD ciphers and such logic is meaningless.  Moreover, in the protocol
it is suggested to send "unexpected_message" alert when receiving
empty messages in certain occasions.  This change moves the empty
message handling to record_add_to_buffers().

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agorecord: fix padding removal when the payload is zero-length
Daiki Ueno [Fri, 8 Jun 2018 10:51:40 +0000 (12:51 +0200)] 
record: fix padding removal when the payload is zero-length

Previoysly if TLSInnerPlaintext.content is zero-length, the loop
couldn't detect ContentType following the content.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoMerge branch 'tmp-measure-record' into 'master'
Nikos Mavrogiannopoulos [Tue, 12 Jun 2018 13:00:03 +0000 (13:00 +0000)] 
Merge branch 'tmp-measure-record' into 'master'

Address issues in record layer decoding

Closes #472, #456, and #455

See merge request gnutls/gnutls!657

7 years agopriorities: introduced %FORCE_ETM
Nikos Mavrogiannopoulos [Tue, 5 Jun 2018 08:37:58 +0000 (10:37 +0200)] 
priorities: introduced %FORCE_ETM

This introduces a priority string option to force encrypt-then-mac
during negotiation, to prevent negotiating the legacy CBC ciphersuites.

Resolves #472

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agopriorities: hmac-sha256 ciphersuites were removed from defaults
Nikos Mavrogiannopoulos [Wed, 6 Jun 2018 07:25:20 +0000 (09:25 +0200)] 
priorities: hmac-sha256 ciphersuites were removed from defaults

These ciphersuites are deprecated since the introduction of AEAD
ciphersuites, and are only necessary for compatibility with older
servers. Since older servers already support hmac-sha1 there is
no reason to keep these ciphersuites enabled by default, as they
increase our attack surface.

Relates #456

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agocbc_mac_verify: require minimum padding under SSL3.0
Nikos Mavrogiannopoulos [Thu, 7 Jun 2018 07:56:49 +0000 (09:56 +0200)] 
cbc_mac_verify: require minimum padding under SSL3.0

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agocipher: separated CBC w/o EtM handling
Nikos Mavrogiannopoulos [Thu, 7 Jun 2018 07:54:50 +0000 (09:54 +0200)] 
cipher: separated CBC w/o EtM handling

This would allow to further modify for more invasive work-arounds.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agodummy_wait: always hash the same amount of blocks that would have been on minimum pad
Nikos Mavrogiannopoulos [Mon, 4 Jun 2018 15:57:52 +0000 (17:57 +0200)] 
dummy_wait: always hash the same amount of blocks that would have been on minimum pad

This improves protection against lucky13-type of attacks when
encrypt-then-mac is not in use.

Resolves #456

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agocbc-record-check.sh: introduced
Nikos Mavrogiannopoulos [Mon, 21 May 2018 07:04:55 +0000 (09:04 +0200)] 
cbc-record-check.sh: introduced

That enhances the existing CBC check and adds sha384, uses PSK
to reduce handshake time, and other updates.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agodummy_wait: correctly account the length field in SHA384 HMAC
Nikos Mavrogiannopoulos [Fri, 18 May 2018 13:43:36 +0000 (15:43 +0200)] 
dummy_wait: correctly account the length field in SHA384 HMAC

The existing lucky13 attack count-measures did not work correctly for
SHA384 HMAC.

The overall impact of that should not be significant as SHA384 is prioritized
lower than SHA256 or SHA1 and thus it is not typically negotiated, unless a
client prioritizes a SHA384 MAC, or a server only supports SHA384, and in both
cases the vulnerability is only present if Encrypt-then-MAC (RFC7366) is unsupported
by the peer.

Resolves #455

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoFix warnings seen on OpenCSW Solaris 10
Tim Rühsen [Thu, 7 Jun 2018 10:11:30 +0000 (12:11 +0200)] 
Fix warnings seen on OpenCSW Solaris 10

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agognutls_session_get_data2: harmonize documentation with practice
Nikos Mavrogiannopoulos [Fri, 8 Jun 2018 06:56:23 +0000 (08:56 +0200)] 
gnutls_session_get_data2: harmonize documentation with practice

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoMerge branch 'fix-overflow' into 'master'
Nikos Mavrogiannopoulos [Wed, 6 Jun 2018 13:03:35 +0000 (13:03 +0000)] 
Merge branch 'fix-overflow' into 'master'

Fix variable overflow in TLS1.3 session ticket code

Closes #471

See merge request gnutls/gnutls!656

8 years agoFix variable overflow in TLS1.3 session ticket code
Tim Rühsen [Wed, 6 Jun 2018 10:45:13 +0000 (12:45 +0200)] 
Fix variable overflow in TLS1.3 session ticket code

8 years agoMerge branch 'tmp-session-ticket-incompatible' into 'master'
Nikos Mavrogiannopoulos [Tue, 5 Jun 2018 22:20:11 +0000 (22:20 +0000)] 
Merge branch 'tmp-session-ticket-incompatible' into 'master'

TLS 1.3 session ticket: don't send ticket when no common KE modes

See merge request gnutls/gnutls!652

8 years agotls13/session_ticket: don't send ticket when no common KE modes
Daiki Ueno [Fri, 1 Jun 2018 13:04:49 +0000 (15:04 +0200)] 
tls13/session_ticket: don't send ticket when no common KE modes

When the server had received psk_key_exchange_modes extension which
doesn't have any overlap with the server configuration, omit to send
NewSessionTicket.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agoext/psk_ke_modes: always send extension unless disabled in config
Daiki Ueno [Tue, 5 Jun 2018 12:08:26 +0000 (14:08 +0200)] 
ext/psk_ke_modes: always send extension unless disabled in config

With the psk_key_exchange_modes extension, clients can restrict the
key exchange modes for use with resumption and in that case the server
shouldn't send NewSessionTicket.  This patch makes use of it to avoid
receiving useless tickets, by sending the psk_key_exchange_modes
extension unless PSK is completely disabled.

A couple of tests need to be adjusted: tls13/prf to take into account
of the psk_key_exchange_modes extension sent, and tls13/no-psk-exts to
not treat the presence of the extension as error.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agoMerge branch 'fix-tests' into 'master'
Nikos Mavrogiannopoulos [Sat, 2 Jun 2018 05:23:34 +0000 (05:23 +0000)] 
Merge branch 'fix-tests' into 'master'

Fix tests

See merge request gnutls/gnutls!646

8 years agoAdd --enable-doc to DISTCHECK_CONFIGURE_FLAGS
Tim Rühsen [Wed, 23 May 2018 20:26:20 +0000 (22:26 +0200)] 
Add --enable-doc to DISTCHECK_CONFIGURE_FLAGS

Make sure that 'make distcheck' works even if
'./configure --disable-doc' has been used in the project dir.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
8 years agoFix tests 'ocsp-must-staple-connection' and 'ocsp-tls-connection'
Tim Rühsen [Wed, 23 May 2018 20:24:05 +0000 (22:24 +0200)] 
Fix tests 'ocsp-must-staple-connection' and 'ocsp-tls-connection'

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
8 years agoFix tests/cert-tests/template-test for 'make distcheck'
Tim Rühsen [Wed, 23 May 2018 20:22:27 +0000 (22:22 +0200)] 
Fix tests/cert-tests/template-test for 'make distcheck'

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
8 years agoMerge branch 'tmp-session-ticket-key-name' into 'master'
Nikos Mavrogiannopoulos [Fri, 1 Jun 2018 13:46:25 +0000 (13:46 +0000)] 
Merge branch 'tmp-session-ticket-key-name' into 'master'

psk: add deterministic detection of session tickets

Closes #450

See merge request gnutls/gnutls!651

8 years agoext/pre_shared_key: make PSK identity parsing robuster
Daiki Ueno [Fri, 1 Jun 2018 07:54:41 +0000 (09:54 +0200)] 
ext/pre_shared_key: make PSK identity parsing robuster

Previously, to determine whether a PSK identity is a ticket or a PSK
username, it relied on PskIdentity.obfuscated_ticket_age, which
"SHOULD" be 0 if the identity is a PSK username.

This patch instead checks the key name of the ticket first and then
check the constraints of the PSK username.  That way, it can
distinguish tickets and PSK usernames in a more realible manner.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years ago_gnutls_decrypt_session_ticket: fail early on key name mismatch
Daiki Ueno [Fri, 1 Jun 2018 08:01:08 +0000 (10:01 +0200)] 
_gnutls_decrypt_session_ticket: fail early on key name mismatch

If the key name of the ticket doesn't match, we don't need to parse
the entire ticket.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agoMerge branch 'tmp_rename_ecc_extensions' into 'master'
Nikos Mavrogiannopoulos [Thu, 31 May 2018 06:54:05 +0000 (06:54 +0000)] 
Merge branch 'tmp_rename_ecc_extensions' into 'master'

Renamed extension supported ECC to supported groups.

Closes #451 and #454

See merge request gnutls/gnutls!649

8 years agoRenamed extension supported ECC to supported groups. Fixes #451.
Tom Vrancken [Tue, 29 May 2018 13:53:45 +0000 (15:53 +0200)] 
Renamed extension supported ECC to supported groups. Fixes #451.
Split combined ECC extensions into different files.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
8 years agoMerge branch 'fix-warnings' into 'master'
Nikos Mavrogiannopoulos [Sat, 26 May 2018 19:43:24 +0000 (19:43 +0000)] 
Merge branch 'fix-warnings' into 'master'

Fix some warnings in test suite

See merge request gnutls/gnutls!647

8 years agoFix more warnings in tests/
Tim Rühsen [Thu, 24 May 2018 10:45:32 +0000 (12:45 +0200)] 
Fix more warnings in tests/

To not introduce larger code changes, these bugs are mostly
fixed by #pragma understood by gcc and clang.
A check for the minimal gcc/clang version prevents warnings about
unknown pragmas with other or older compilers.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
8 years agoFix warnings in test suite
Tim Rühsen [Thu, 24 May 2018 07:49:34 +0000 (09:49 +0200)] 
Fix warnings in test suite

Fixes:
tls-ext-register.c:238:11: warning: unused variable 'i' [-Wunused-variable]
record-retvals.c:118:14: warning: unused variable 'vers' [-Wunused-variable]
record-retvals.c:347:1: warning: label 'next' defined but not used [-Wunused-label]
alerts.c:71:14: warning: unused variable 'vers' [-Wunused-variable]
alerts.c:71:11: warning: unused variable 'i' [-Wunused-variable]
alerts.c:160:11: warning: unused variable 'i' [-Wunused-variable]
send-client-cert.c:176:6: warning: no previous prototype for 'start' [-Wmissing-prototypes]
tls-session-supplemental.c:186:6: warning: unused variable 'optval' [-Wunused-variable]
tls-session-supplemental.c:184:7: warning: unused variable 'topbuf' [-Wunused-variable]
tls-session-supplemental.c:183:6: warning: unused variable 'err' [-Wunused-variable]
x509self.c:211:6: warning: unused variable 'optval' [-Wunused-variable]
x509self.c:208:7: warning: unused variable 'topbuf' [-Wunused-variable]
x509self.c:207:6: warning: unused variable 'err' [-Wunused-variable]

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
8 years agoMerge branch 'tmp-session-resumption2' into 'master'
Nikos Mavrogiannopoulos [Sat, 26 May 2018 05:34:20 +0000 (05:34 +0000)] 
Merge branch 'tmp-session-resumption2' into 'master'

TLS 1.3 session resumption

Closes #441 and #290

See merge request gnutls/gnutls!638

8 years agotests: resume: check whether PSK username matches on resumption
Nikos Mavrogiannopoulos [Tue, 22 May 2018 07:14:45 +0000 (09:14 +0200)] 
tests: resume: check whether PSK username matches on resumption

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoresumption: reduce session parameters stored under TLS1.3
Nikos Mavrogiannopoulos [Tue, 22 May 2018 07:04:32 +0000 (09:04 +0200)] 
resumption: reduce session parameters stored under TLS1.3

That is, do not store extensions or security parameters which
depend on extension negotiation.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agosession_ticket: use random nonces
Nikos Mavrogiannopoulos [Tue, 15 May 2018 14:35:32 +0000 (16:35 +0200)] 
session_ticket: use random nonces

Avoid using any time values in plain as this could allow association
of clients.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Tue, 15 May 2018 14:03:23 +0000 (16:03 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: mention changes under TLS 1.3
Nikos Mavrogiannopoulos [Tue, 15 May 2018 12:14:55 +0000 (14:14 +0200)] 
doc: mention changes under TLS 1.3

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added main use-case test for gnutls_session_ticket_send()
Nikos Mavrogiannopoulos [Tue, 15 May 2018 09:22:24 +0000 (11:22 +0200)] 
tests: added main use-case test for gnutls_session_ticket_send()

It verifies whether a server can use gnutls_session_ticket_send()
to send a ticket after re-authentication, and whether a client
can receive that ticket and re-authenticate with it, while
its certificate is made available to server.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: do not include async messages into transcript
Nikos Mavrogiannopoulos [Tue, 15 May 2018 09:21:55 +0000 (11:21 +0200)] 
handshake: do not include async messages into transcript

This prevents the session tickets to affect re-authentication
or other operations that require the transcript.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_session_ticket_send: new function
Nikos Mavrogiannopoulos [Tue, 15 May 2018 08:27:00 +0000 (10:27 +0200)] 
gnutls_session_ticket_send: new function

Introduced in order for a server to be able to send an arbitrary
amount of tickets, at any time.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: store session parameters in TLS1.3 ticket
Nikos Mavrogiannopoulos [Tue, 15 May 2018 08:10:20 +0000 (10:10 +0200)] 
handshake: store session parameters in TLS1.3 ticket

This allows a TLS1.3 server to obtain certificate or other
information from the client on a resumed session.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: TLS1.3 async messages trigger the handshake hook
Nikos Mavrogiannopoulos [Mon, 14 May 2018 14:05:27 +0000 (16:05 +0200)] 
handshake: TLS1.3 async messages trigger the handshake hook

That is, the callback set with gnutls_handshake_set_hook_function() is
now called even on the async handshake messages received under TLS1.3,
such as key update, etc.

Resolves #441

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: check various parameters on resumption
Nikos Mavrogiannopoulos [Mon, 14 May 2018 12:33:15 +0000 (14:33 +0200)] 
tests: check various parameters on resumption

That is, check gnutls_session_is_resumed() is functional on server
side, whether PRF is respected on resumption, whether gnutls_certificate_get_peers()
and gnutls_certificate_get_ours() operate as expected, and whether session
resumption fails with tickets after expiration time has passed.

In addition improve function documentation by documenting the current
semantics for the functions above.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: exercise TLS 1.3 session resumption
Daiki Ueno [Tue, 17 Apr 2018 11:32:18 +0000 (13:32 +0200)] 
tests: exercise TLS 1.3 session resumption

This requires a few changes to the resume.c test: because
NewSessionTicket is a post-handshake message,
gnutls_session_get_data2() needs to be called after sending the first
application data.  Also, when GNUTLS_E_AGAIN, gnutls_record_recv()
needs to retry.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agognutls-cli: ignore E_AGAIN to accommodate async handshake message
Daiki Ueno [Mon, 30 Apr 2018 12:27:52 +0000 (14:27 +0200)] 
gnutls-cli: ignore E_AGAIN to accommodate async handshake message

When an async handshake message has arrived while no application data
is available, gnutls_record_recv() returns GNUTLS_E_AGAIN and the loop
in socket_recv() blocks.  Since socket_recv() is guarded by select(),
it should be safe to ignore GNUTLS_E_AGAIN.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agognutls_auth_get_type: simplified
Nikos Mavrogiannopoulos [Mon, 14 May 2018 07:01:59 +0000 (09:01 +0200)] 
gnutls_auth_get_type: simplified

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoTLS 1.3: Introduced TLS 1.3 session resumption
Ander Juaristi [Mon, 16 Apr 2018 15:13:47 +0000 (17:13 +0200)] 
TLS 1.3: Introduced TLS 1.3 session resumption

This introduces session resumption under TLS 1.3. For that,
it enables the psk_ke_modes extension when we enable session
tickets. It enables sending session tickets in addition to
PSK usernames. The detection of resumption vs pure PSK is done by
comparing the indexes sent with the index received by the server.

TLS 1.3 session tickets are always sent to the peer unless the
GNUTLS_NO_TICKETS is specified.

Resolves #290

Signed-off-by: Ander Juaristi <a@juaristi.eus>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agopsk_ke_modes: introduce psk_ke_modes_is_required() and update doc
Nikos Mavrogiannopoulos [Thu, 10 May 2018 12:25:12 +0000 (14:25 +0200)] 
psk_ke_modes: introduce psk_ke_modes_is_required() and update doc

This adds a helper function to be extended when session resumption
is added, and clarifies why we send a prioritized list on ke modes.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: Ander Juaristi <a@juaristi.eus>
8 years agosession tickets: expose {encrypt,decrypt}_ticket as internal API
Ander Juaristi [Thu, 12 Apr 2018 15:58:47 +0000 (17:58 +0200)] 
session tickets: expose {encrypt,decrypt}_ticket as internal API

To reuse the same ticket construction in any TLS versions, expose the
private functions in ext/session_ticket.c.

Signed-off-by: Ander Juaristi <a@juaristi.eus>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoext/pre_shared_key: fix binder calculation when HRR is sent
Daiki Ueno [Thu, 3 May 2018 07:39:15 +0000 (09:39 +0200)] 
ext/pre_shared_key: fix binder calculation when HRR is sent

In that case, ClientHello1 and HelloRetryRequest are included in the
PSK binder computation, not only the truncated ClientHello2.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agohandshake: record transcript offset of client Finished
Daiki Ueno [Mon, 16 Apr 2018 15:22:19 +0000 (17:22 +0200)] 
handshake: record transcript offset of client Finished

This is for deriving resumption_master_secret, whose value is
calculated over ClientHello...client Finished.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agoMerge branch 'fix-testdane' into 'master'
Nikos Mavrogiannopoulos [Thu, 24 May 2018 20:57:38 +0000 (20:57 +0000)] 
Merge branch 'fix-testdane' into 'master'

Fix testdane by removing www.kumari.net

See merge request gnutls/gnutls!648

8 years agoFix testdane by removing www.kumari.net
Tim Rühsen [Thu, 24 May 2018 13:24:17 +0000 (15:24 +0200)] 
Fix testdane by removing www.kumari.net

danetool --check www.kumari.net:
  Verification: Verification failed. The certificate differs.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
8 years agoMerge branch 'docs-fix' into 'master'
Nikos Mavrogiannopoulos [Wed, 23 May 2018 12:38:54 +0000 (12:38 +0000)] 
Merge branch 'docs-fix' into 'master'

Updated documentation on Hello extensions.

Closes #437

See merge request gnutls/gnutls!644