]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
7 years agognutls_x509_trust_list_add_cas: corrected return value
Nikos Mavrogiannopoulos [Mon, 17 Sep 2018 07:12:29 +0000 (09:12 +0200)] 
gnutls_x509_trust_list_add_cas: corrected return value

When the flag GNUTLS_TL_USE_IN_TLS is used and add_new_ca_to_rdn_seq
the return value did not include the last certificate added to the
list. This corrects its return value.

Relates #552

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agofixed documentation in trust list functions
Nikos Mavrogiannopoulos [Mon, 17 Sep 2018 07:10:24 +0000 (09:10 +0200)] 
fixed documentation in trust list functions

That clarifies and addresses issues in the documentation of
gnutls_x509_trust_list_add_crls() and gnutls_x509_trust_list_add_cas()

Relates #552

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-crl' into 'master'
Nikos Mavrogiannopoulos [Mon, 17 Sep 2018 09:02:46 +0000 (09:02 +0000)] 
Merge branch 'tmp-crl' into 'master'

certtool: crl handling updates

See merge request gnutls/gnutls!747

7 years agotests: added CRL verification tests
Nikos Mavrogiannopoulos [Sun, 16 Sep 2018 13:54:41 +0000 (15:54 +0200)] 
tests: added CRL verification tests

This tests CRL verification with certtool --verify-crl on correct
and incorrect cases.

Relates #564

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agocerttool: updates in documentation in messages for CRL generation
Nikos Mavrogiannopoulos [Sun, 16 Sep 2018 13:35:19 +0000 (15:35 +0200)] 
certtool: updates in documentation in messages for CRL generation

This fixes the messages printed for the generation of a CRL, and
makes the return code of the CRL verification depending on the
verification result.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoFix variable used in reallocation
Nikos Mavrogiannopoulos [Fri, 14 Sep 2018 14:32:05 +0000 (16:32 +0200)] 
Fix variable used in reallocation

This corrects the variable name used in the sizeof argument
for realloc. This does not alter the actual allocation size,
but rather it fixes a logic error.

Relates: #554

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years ago.gitignore: updated
Nikos Mavrogiannopoulos [Wed, 22 Aug 2018 13:25:06 +0000 (15:25 +0200)] 
.gitignore: updated

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agodtls: recover when a NewSessionTicket message is lost
Nikos Mavrogiannopoulos [Wed, 22 Aug 2018 08:08:41 +0000 (10:08 +0200)] 
dtls: recover when a NewSessionTicket message is lost

When the server's NewSessionTicket gets lost while the ChangeCipherSpec
goes through, the client did not request retransmission by retransmitting
his last flight, and the handshake was blocked. This commit addresses
the issue and adds a reproducer.

Resolves #543

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agotlsfuzzer: remove duplicate tests and sort them alphabetically
Daiki Ueno [Mon, 27 Aug 2018 15:44:35 +0000 (17:44 +0200)] 
tlsfuzzer: remove duplicate tests and sort them alphabetically

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agodoc: fix reference to invocation nodes
Andreas Schwab [Mon, 10 Sep 2018 15:35:08 +0000 (17:35 +0200)] 
doc: fix reference to invocation nodes

Signed-off-by: Andreas Schwab <schwab@suse.de>
7 years agopriority: be backwards compatible with priority strings starting with NONE
Nikos Mavrogiannopoulos [Mon, 20 Aug 2018 13:17:04 +0000 (15:17 +0200)] 
priority: be backwards compatible with priority strings starting with NONE

That is, we allow priority strings which do not enable any groups to
work, by disabling TLS1.3. For example
'NONE:+VERS-TLS-ALL:+MAC-ALL:+RSA:+AES-128-GCM:+SIGN-ALL:+COMP-NULL'
is still operational, but no TLS1.3 is enabled when specified.

Resolves: #549

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-strdup' into 'master'
Tim Rühsen [Thu, 30 Aug 2018 08:15:03 +0000 (08:15 +0000)] 
Merge branch 'tmp-strdup' into 'master'

Use gnutls_strdup() in library code

See merge request gnutls/gnutls!742

7 years agoUse gnutls_strdup() instead of strdup() in library code
Tim Rühsen [Fri, 24 Aug 2018 14:34:14 +0000 (16:34 +0200)] 
Use gnutls_strdup() instead of strdup() in library code

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoRemove gnulib work-around '#undef strdup'
Tim Rühsen [Fri, 24 Aug 2018 14:27:36 +0000 (16:27 +0200)] 
Remove gnulib work-around '#undef strdup'

The 'issue' should be fixed already. Even if not, it has to
addressed in gnulib.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoMerge branch 'tmp-psk-ext-refactor' into 'master'
Daiki Ueno [Thu, 23 Aug 2018 14:19:17 +0000 (14:19 +0000)] 
Merge branch 'tmp-psk-ext-refactor' into 'master'

tls13/psk_ext_parser: simplify the iterator interface

See merge request gnutls/gnutls!736

7 years agoext/pre_shared_key: use consistent name for regitration entry
Daiki Ueno [Tue, 21 Aug 2018 13:02:56 +0000 (15:02 +0200)] 
ext/pre_shared_key: use consistent name for regitration entry

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoext/pre_shared_key: make ticket age calculation consistent
Daiki Ueno [Tue, 21 Aug 2018 12:54:41 +0000 (14:54 +0200)] 
ext/pre_shared_key: make ticket age calculation consistent

Previously we used a pattern like this:

  uint32_t obfuscated_ticket_age, ticket_age_add;
  time_t ticket_age;

  ticket_age = obfuscated_ticket_age - ticket_age_add;
  if (ticket_age < 0) {
   ...
  }

This always evaluates to false, because subtraction between unsigned
integers yields an unsigned integer.  Let's do the comparison before
subtraction and also use correct types for representing time: uint32_t
for protocol time and time_t for system time.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agotls13/psk_ext_parser: simplify the iterator interface
Daiki Ueno [Fri, 17 Aug 2018 13:45:20 +0000 (15:45 +0200)] 
tls13/psk_ext_parser: simplify the iterator interface

Previously it was unclear whether psk_ext_parser_st is stateful or
not.  This change introduces the simpler API to iterate over the
immutable data (psk_ext_parser_st), following the iterator pattern.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agognutls-cli-debug: mention RFC8446 for TLS1.3 and RFC8422 for X25519
Nikos Mavrogiannopoulos [Tue, 21 Aug 2018 14:18:11 +0000 (16:18 +0200)] 
gnutls-cli-debug: mention RFC8446 for TLS1.3 and RFC8422 for X25519

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-gnulib-use-git' into 'master'
Nikos Mavrogiannopoulos [Wed, 22 Aug 2018 04:04:51 +0000 (04:04 +0000)] 
Merge branch 'tmp-gnulib-use-git' into 'master'

Remove --no-git from ./bootstrap

See merge request gnutls/gnutls!739

7 years agoRemove --no-git from ./bootstrap [ci skip]
Tim Rühsen [Tue, 21 Aug 2018 11:10:48 +0000 (13:10 +0200)] 
Remove --no-git from ./bootstrap [ci skip]

This removes the --no-git option as bootstrap itself does not use
the remote repository for cloning. At least as long $GNULIB_SRCDIR
points to a recent enough local gnulib git repo.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoMerge branch 'tmp-update-version-numbers' into 'master'
Nikos Mavrogiannopoulos [Tue, 21 Aug 2018 14:01:45 +0000 (14:01 +0000)] 
Merge branch 'tmp-update-version-numbers' into 'master'

Update library to use the final RFC8446 version numbers

Closes #542 and #359

See merge request gnutls/gnutls!730

7 years agohandshake: do not negotiate TLS1.3 using the legacy version field
Nikos Mavrogiannopoulos [Fri, 17 Aug 2018 12:02:34 +0000 (14:02 +0200)] 
handshake: do not negotiate TLS1.3 using the legacy version field

Previously we could end-up with a TLS1.3 connection if the TLS1.3
ID was seen on the wire. We now explicitly fallback to TLS1.2
when we see a protocol with TLS1.3 semantics in an SSL2.0 or
in the legacy version of the client hello.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agohandshake: simplified protocol version checking functions
Nikos Mavrogiannopoulos [Fri, 17 Aug 2018 10:57:25 +0000 (12:57 +0200)] 
handshake: simplified protocol version checking functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agotlsfuzzer: modify to use the final code points
Nikos Mavrogiannopoulos [Fri, 17 Aug 2018 08:50:15 +0000 (10:50 +0200)] 
tlsfuzzer: modify to use the final code points

Relates #542

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agofuzz: updated traces for final TLS1.3 version
Nikos Mavrogiannopoulos [Mon, 13 Aug 2018 18:55:50 +0000 (20:55 +0200)] 
fuzz: updated traces for final TLS1.3 version

Resolves #359

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoprotocols: bumped TLS1.3 version number to RFC8446 value
Nikos Mavrogiannopoulos [Mon, 13 Aug 2018 18:46:21 +0000 (20:46 +0200)] 
protocols: bumped TLS1.3 version number to RFC8446 value

This adds support of the final RFC numbers.

Resolves #542

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'rfc7250_cert-types' into 'master'
Nikos Mavrogiannopoulos [Mon, 20 Aug 2018 19:20:12 +0000 (19:20 +0000)] 
Merge branch 'rfc7250_cert-types' into 'master'

RFC7250 certificate type negotiation

See merge request gnutls/gnutls!498

7 years agoImplemented RFC7250 certificate type negotiation extensions.
Tom Vrancken [Wed, 15 Aug 2018 16:29:32 +0000 (18:29 +0200)] 
Implemented RFC7250 certificate type negotiation extensions.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
7 years agoMerge branch 'tmp-record-size-limit' into 'master'
Daiki Ueno [Mon, 20 Aug 2018 13:17:35 +0000 (13:17 +0000)] 
Merge branch 'tmp-record-size-limit' into 'master'

record_size_limit extension

Closes #524

See merge request gnutls/gnutls!733

7 years agoext/record_size_limit: new extension
Daiki Ueno [Fri, 10 Aug 2018 12:06:16 +0000 (14:06 +0200)] 
ext/record_size_limit: new extension

This implements the record_size_limit extension as defined in RFC 8449.

Although it obsoletes the max_record_size extension, for compatibility
reasons GnuTLS still sends it on certain occasions.  For example, when
the new size is representable as the codepoint defined for
max_record_size.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoext/max_record: remove use of extension private data
Daiki Ueno [Tue, 14 Aug 2018 14:46:12 +0000 (16:46 +0200)] 
ext/max_record: remove use of extension private data

As the extension data is always stored in
session->security_parameters.max_record_send_size, it shouldn't be
necessary to track it with the private data.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoMerge branch 'tmp-fix-resumption-requested' into 'master'
Nikos Mavrogiannopoulos [Mon, 20 Aug 2018 09:52:47 +0000 (09:52 +0000)] 
Merge branch 'tmp-fix-resumption-requested' into 'master'

Fix gnutls_session_resumption_requested

Closes #546

See merge request gnutls/gnutls!735

7 years agognutls_session_resumption_requested: fixed behavior under TLS1.3
Nikos Mavrogiannopoulos [Fri, 17 Aug 2018 12:43:30 +0000 (14:43 +0200)] 
gnutls_session_resumption_requested: fixed behavior under TLS1.3

This makes gnutls_session_resumption_requested() functional under
TLS1.3 and introduces a unit test of the function.

Resolves #546

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-no-git-in-bootstrap' into 'master'
Tim Rühsen [Mon, 20 Aug 2018 07:22:24 +0000 (07:22 +0000)] 
Merge branch 'tmp-no-git-in-bootstrap' into 'master'

.gitlab-ci.yml: use --no-git to bootstrap

Closes #547

See merge request gnutls/gnutls!737

7 years ago.gitlab-ci.yml: use --no-git to bootstrap
Nikos Mavrogiannopoulos [Sun, 19 Aug 2018 16:59:02 +0000 (18:59 +0200)] 
.gitlab-ci.yml: use --no-git to bootstrap

That is, to reduce CI time, and avoid failures due to
non-availability of the gnulib git repo.

Resolves #547

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agohello_ext: removed bogus comment
Nikos Mavrogiannopoulos [Fri, 17 Aug 2018 12:48:56 +0000 (14:48 +0200)] 
hello_ext: removed bogus comment

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years ago.gitmodules: gnulib submodule is now synced from libidn's mirror
Nikos Mavrogiannopoulos [Fri, 17 Aug 2018 14:08:37 +0000 (16:08 +0200)] 
.gitmodules: gnulib submodule is now synced from libidn's mirror

This mirror is updated hourly and is hosted on gitlab, meaning
less dependency on external sites downtime.

Resolves: #547

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-ametzler-typo-guarranteed_overriden' into 'master'
Tim Rühsen [Sat, 18 Aug 2018 08:22:21 +0000 (08:22 +0000)] 
Merge branch 'tmp-ametzler-typo-guarranteed_overriden' into 'master'

Fix two typos (overriden/guarranteed)

See merge request gnutls/gnutls!734

7 years agoFix two typos (overriden/guarranteed)
Andreas Metzler [Wed, 15 Aug 2018 12:20:43 +0000 (14:20 +0200)] 
Fix two typos (overriden/guarranteed)

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
7 years agoMerge branch 'tmp-document-none' into 'master'
Nikos Mavrogiannopoulos [Wed, 15 Aug 2018 08:07:02 +0000 (08:07 +0000)] 
Merge branch 'tmp-document-none' into 'master'

doc: document the non-portability of NONE priority string

See merge request gnutls/gnutls!731

7 years agodoc: document the non-portability of NONE priority string
Nikos Mavrogiannopoulos [Mon, 13 Aug 2018 19:47:53 +0000 (21:47 +0200)] 
doc: document the non-portability of NONE priority string

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'tmp-fixes-cov' into 'master'
Nikos Mavrogiannopoulos [Tue, 14 Aug 2018 12:40:03 +0000 (12:40 +0000)] 
Merge branch 'tmp-fixes-cov' into 'master'

Fixes for issues identified by static analyzers

Closes #518

See merge request gnutls/gnutls!729

7 years agotools: check output of called functions
Nikos Mavrogiannopoulos [Mon, 13 Aug 2018 18:22:48 +0000 (20:22 +0200)] 
tools: check output of called functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agowrite_oid_and_params: moved nullity check of params earlier
Nikos Mavrogiannopoulos [Mon, 13 Aug 2018 18:19:55 +0000 (20:19 +0200)] 
write_oid_and_params: moved nullity check of params earlier

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agognutls_session_set_premaster: corrected error checks
Nikos Mavrogiannopoulos [Thu, 9 Aug 2018 14:13:50 +0000 (16:13 +0200)] 
gnutls_session_set_premaster: corrected error checks

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agopubkey_verify_hashed_data: apply algorithm checks
Nikos Mavrogiannopoulos [Thu, 9 Aug 2018 14:12:36 +0000 (16:12 +0200)] 
pubkey_verify_hashed_data: apply algorithm checks

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoprivkey_sign_raw_data: use assert to mark code which always succeeds
Nikos Mavrogiannopoulos [Thu, 9 Aug 2018 14:09:21 +0000 (16:09 +0200)] 
privkey_sign_raw_data: use assert to mark code which always succeeds

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years ago_gnutls_send_change_cipher_spec: removed unnecessary test
Nikos Mavrogiannopoulos [Thu, 9 Aug 2018 14:05:47 +0000 (16:05 +0200)] 
_gnutls_send_change_cipher_spec: removed unnecessary test

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years ago.travis.yml: do not run brew upgrade
Nikos Mavrogiannopoulos [Mon, 13 Aug 2018 19:04:56 +0000 (21:04 +0200)] 
.travis.yml: do not run brew upgrade

This addresses issue with travis compilation on MacOSX.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'tmp-use-explicit-bzero' into 'master'
Nikos Mavrogiannopoulos [Wed, 8 Aug 2018 16:30:38 +0000 (16:30 +0000)] 
Merge branch 'tmp-use-explicit-bzero' into 'master'

gnutls_memset: use explicit_bzero

Closes #230

See merge request gnutls/gnutls!728

7 years agognutls_memset: use explicit_bzero
Nikos Mavrogiannopoulos [Tue, 7 Aug 2018 14:27:19 +0000 (16:27 +0200)] 
gnutls_memset: use explicit_bzero

That is, use the glibc function when available and the second
parameter is zero.

Resolves #230

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-consistent-falltrough' into 'master'
Nikos Mavrogiannopoulos [Wed, 8 Aug 2018 14:22:08 +0000 (14:22 +0000)] 
Merge branch 'tmp-consistent-falltrough' into 'master'

use a consistent method to mark fall-through in switch cases

Closes #306

See merge request gnutls/gnutls!726

7 years agouse a consistent method to mark fall-through in switch cases
Nikos Mavrogiannopoulos [Tue, 7 Aug 2018 07:52:55 +0000 (09:52 +0200)] 
use a consistent method to mark fall-through in switch cases

Also document that method in contribution guide.

Resolves #306

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'tmp-tlsfuzzer-update-tls13' into 'master'
Daiki Ueno [Wed, 8 Aug 2018 11:58:14 +0000 (11:58 +0000)] 
Merge branch 'tmp-tlsfuzzer-update-tls13' into 'master'

tlsfuzzer: update to the latest version to enable more TLS 1.3 tests

Closes #537

See merge request gnutls/gnutls!727

7 years agoext/pre_shared_key: prevent crash if no server credentials are set
Daiki Ueno [Tue, 7 Aug 2018 12:45:07 +0000 (14:45 +0200)] 
ext/pre_shared_key: prevent crash if no server credentials are set

Previously, if server is configured without PSK credentials and the
client authenticated with PSK, the server crashed with:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b190ba in server_recv_params (session=0x636fc0, data=0x634e6e "",
    len=46, pskcred=0x0) at pre_shared_key.c:523
523                             prf = pskcred->binder_algo;

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agotlsfuzzer: update to the latest version
Daiki Ueno [Tue, 7 Aug 2018 11:21:16 +0000 (13:21 +0200)] 
tlsfuzzer: update to the latest version

Also enable test-tls13-ffdhe-sanity.py,
test-tls13-session-resumption.py, and
test-tls13-unrecognised-groups.py.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoalert: map GNUTLS_E_NO_COMMON_KEY_SHARE to handshake_failure
Daiki Ueno [Tue, 7 Aug 2018 10:32:56 +0000 (12:32 +0200)] 
alert: map GNUTLS_E_NO_COMMON_KEY_SHARE to handshake_failure

Previously, when server received a ClientHello that does include only
groups from unassigned ranges in supported_groups, it aborted the
connection with an illegal_parameter.

Resolves #537

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoalgorithms: add support for FFDHE6144
Daiki Ueno [Tue, 7 Aug 2018 09:43:32 +0000 (11:43 +0200)] 
algorithms: add support for FFDHE6144

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoMerge branch 'tmp-fix-ecdsa-pubkey-import' into 'master'
Nikos Mavrogiannopoulos [Tue, 7 Aug 2018 10:54:15 +0000 (10:54 +0000)] 
Merge branch 'tmp-fix-ecdsa-pubkey-import' into 'master'

Corrected the importing of ECDSA public keys

Closes #538

See merge request gnutls/gnutls!725

7 years agoCorrected the importing of ECDSA public keys
Nikos Mavrogiannopoulos [Fri, 3 Aug 2018 20:26:47 +0000 (22:26 +0200)] 
Corrected the importing of ECDSA public keys

This seems to be a regression since EdDSA support. The call to
_gnutls_x509_get_pk_algorithm() in public key import was unnecessary
and in fact it was overriding the available curve with a curve associated
with the OID. As the ECDSA OID doesn't include the curve, that had the
result of deleting the already read curve.

Resolves #538

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoEnsure we are sending the right protocol version on second client hello
Nikos Mavrogiannopoulos [Fri, 3 Aug 2018 12:13:14 +0000 (14:13 +0200)] 
Ensure we are sending the right protocol version on second client hello

That is, when we respond to a Hello Retry Request as client, we put
the TLS1.2 version on the second client hello to send a hello that is
as close as possible to the original hello. That effectively separates
the handling of TLS1.2 rehandshake and TLS1.3 hello retry request
when sending a client hello.

Resolves #535

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agodoc: improved text on certifications
Nikos Mavrogiannopoulos [Tue, 7 Aug 2018 05:30:55 +0000 (07:30 +0200)] 
doc: improved text on certifications

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agodoc: few improvements over certificate validation text
Nikos Mavrogiannopoulos [Tue, 7 Aug 2018 05:13:35 +0000 (07:13 +0200)] 
doc: few improvements over certificate validation text

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'tmp-persistent-id' into 'master'
Nikos Mavrogiannopoulos [Tue, 7 Aug 2018 06:02:44 +0000 (06:02 +0000)] 
Merge branch 'tmp-persistent-id' into 'master'

resumption: keep persistent session identifiers

Closes #484

See merge request gnutls/gnutls!721

7 years agognutls-serv: re-introduce the session identifier message
Nikos Mavrogiannopoulos [Mon, 30 Jul 2018 19:50:35 +0000 (21:50 +0200)] 
gnutls-serv: re-introduce the session identifier message

The message "If your browser supports session resuming, then you should
see the same session ID, when you press the reload button", is now printed
again even under TLS1.3.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoresume: keep persistent session identifiers
Nikos Mavrogiannopoulos [Mon, 30 Jul 2018 14:48:26 +0000 (16:48 +0200)] 
resume: keep persistent session identifiers

With the introduction of session ticket support (TLS1.2) and
TLS1.3, session identifiers have no persistency on server or
client side. Improve the situation by introducing persistent
session identifiers on server side in a backwards compatible
way.

Resolves #484

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-handshake-interleave' into 'master'
Nikos Mavrogiannopoulos [Mon, 6 Aug 2018 15:20:34 +0000 (15:20 +0000)] 
Merge branch 'tmp-handshake-interleave' into 'master'

Fix interleaved handshake handling in TLS 1.3

Closes #272

See merge request gnutls/gnutls!708

7 years ago.gitlab-ci.yml: include fuzz/*.log in artifacts
Daiki Ueno [Thu, 19 Jul 2018 13:57:59 +0000 (15:57 +0200)] 
.gitlab-ci.yml: include fuzz/*.log in artifacts

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agotests: tls-fuzzer: enable tests relying on header fragmentation
Daiki Ueno [Wed, 18 Jul 2018 13:56:17 +0000 (15:56 +0200)] 
tests: tls-fuzzer: enable tests relying on header fragmentation

Those tests were previously disabled because splitting of handshake
messages in a very short (< 4 bytes) fragments is not implemented.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agorecord: send unexpected_message upon empty unencrypted records
Daiki Ueno [Thu, 2 Aug 2018 13:44:15 +0000 (15:44 +0200)] 
record: send unexpected_message upon empty unencrypted records

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agobuffers: handle very short fragmentation of handshake messages
Daiki Ueno [Fri, 27 Jul 2018 04:30:41 +0000 (06:30 +0200)] 
buffers: handle very short fragmentation of handshake messages

If the received record doesn't even complete the handshake
header (i.e., the record size < 4), keep it in a temporary buffer and
let the caller receive more records.  Once enough amount of data is
received, move the already received records back to record_buffer and
proceed to the normal processing.

Fixes: #272
Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agombuffers: introduce _mbuffer_head_push_first
Daiki Ueno [Fri, 27 Jul 2018 04:23:12 +0000 (06:23 +0200)] 
mbuffers: introduce _mbuffer_head_push_first

This is similar to _mbuffer_enqueue, but adds an element to the
beginning of the buffer.

This is to make the incomplete header handling case easier.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years ago_gnutls_parse_record_buffered_msgs: eliminate local variable usage
Daiki Ueno [Fri, 27 Jul 2018 04:10:37 +0000 (06:10 +0200)] 
_gnutls_parse_record_buffered_msgs: eliminate local variable usage

If `remain > 0` is true, `recv_buf[0].length > 0` always holds.
Combine those conditions and remove the `remain` utilizing MIN().

This is to make the incomplete header handling case easier.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agobuffers: avoid confusion in fragment length calculation
Daiki Ueno [Fri, 27 Jul 2018 03:35:02 +0000 (05:35 +0200)] 
buffers: avoid confusion in fragment length calculation

Previously, to calculate the fragment length, it added/subtracted one
to the ending offset back and forth; that was not easier to read and
couldn't handle empty payload messages in TLS.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoMerge branch 'tmp-skip-zero-rtt' into 'master'
Nikos Mavrogiannopoulos [Mon, 6 Aug 2018 10:33:41 +0000 (10:33 +0000)] 
Merge branch 'tmp-skip-zero-rtt' into 'master'

TLS 1.3: ignore "early_data" extension

Closes #512

See merge request gnutls/gnutls!706

7 years agotlsfuzzer: update to the latest version
Daiki Ueno [Thu, 2 Aug 2018 14:59:27 +0000 (16:59 +0200)] 
tlsfuzzer: update to the latest version

Also enable test-tls13-0rtt-garbage.py.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agoTLS 1.3: ignore "early_data" extension
Daiki Ueno [Mon, 16 Jul 2018 09:30:05 +0000 (11:30 +0200)] 
TLS 1.3: ignore "early_data" extension

As 0-RTT is still not implemented in GnuTLS, the server responds with
1-RTT, by skipping decryption failure up to max_early_data_size, as
suggested in 4.2.10 Early Data Detection.

Resolves #512

Signed-off-by: Daiki Ueno <dueno@redhat.com>
7 years agop11tool: print expiration time on certificates
Nikos Mavrogiannopoulos [Fri, 3 Aug 2018 19:45:14 +0000 (21:45 +0200)] 
p11tool: print expiration time on certificates

This is particularly useful when displaying information about a
certificate trust store.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agoMerge branch 'tmp-handshake-return-early' into 'master'
Nikos Mavrogiannopoulos [Fri, 3 Aug 2018 14:20:11 +0000 (14:20 +0000)] 
Merge branch 'tmp-handshake-return-early' into 'master'

tls1.3: server returns early on handshake when no cert is provided by client

Closes #481 and #457

See merge request gnutls/gnutls!711

7 years agotls1.3: server returns early on handshake when no cert is provided by client
Nikos Mavrogiannopoulos [Thu, 19 Jul 2018 13:52:26 +0000 (15:52 +0200)] 
tls1.3: server returns early on handshake when no cert is provided by client

Under TLS1.3 the server knows the negotiated keys early, if no client
certificate is sent. In that case, the server is not only able to
transmit the session ticket immediately after its finished message,
but is also able to transmit data, similarly to false start.

Resolves #481
Resolves #457

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agognutls-serv: don't close connection properly when handshake is not yet complete
Nikos Mavrogiannopoulos [Mon, 23 Jul 2018 13:01:49 +0000 (15:01 +0200)] 
gnutls-serv: don't close connection properly when handshake is not yet complete

In the case handshake is not yet complete and we need
to terminate, it is because of an issue. As such prefer an
unclear termination at this stage. This addresses error detection
issues with tlsfuzzer.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agognutls-cli: corrected input buffer null-termination
Nikos Mavrogiannopoulos [Thu, 2 Aug 2018 14:16:27 +0000 (16:16 +0200)] 
gnutls-cli: corrected input buffer null-termination

This was a regression in the previous cleanup at
f138ff85df69976badce44a5c46157cce091020f included in
3.6.3.

Resolves #534

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agocerttool: added example of converting to DER in manpage
Nikos Mavrogiannopoulos [Tue, 31 Jul 2018 09:37:50 +0000 (11:37 +0200)] 
certtool: added example of converting to DER in manpage

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-fix-wabi' into 'master'
Tim Rühsen [Sat, 28 Jul 2018 09:52:06 +0000 (09:52 +0000)] 
Merge branch 'tmp-fix-wabi' into 'master'

Fix gcc-8 -Wabi warnings

Closes #531

See merge request gnutls/gnutls!720

7 years agoFix gcc-8 -Wabi warnings
Tim Rühsen [Fri, 27 Jul 2018 21:46:50 +0000 (23:46 +0200)] 
Fix gcc-8 -Wabi warnings

Fixes #531

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoMerge branch 'tmp-test-large-cert' into 'master'
Nikos Mavrogiannopoulos [Fri, 27 Jul 2018 14:16:53 +0000 (14:16 +0000)] 
Merge branch 'tmp-test-large-cert' into 'master'

tests: improved test suite

Closes #508 and #513

See merge request gnutls/gnutls!719

7 years agoext/key_share: check the validity of server key shares
Nikos Mavrogiannopoulos [Fri, 27 Jul 2018 09:58:38 +0000 (11:58 +0200)] 
ext/key_share: check the validity of server key shares

That is, when generating the public key based on the server's
key share, ensure that the algorithms match completely with
the key shares the client initially sent. This was detected
by the updated traces for TLS1.3 fuzzying.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agognutls-serv: improve output under TLS1.3
Nikos Mavrogiannopoulos [Thu, 26 Jul 2018 13:37:58 +0000 (15:37 +0200)] 
gnutls-serv: improve output under TLS1.3

That is, silence fields no longer applicable under TLS1.3
and make sure that newer functions like gnutls_session_get_desc()
get used when describing the session.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agofuzz: updated traces for latest TLS1.3 draft
Nikos Mavrogiannopoulos [Thu, 26 Jul 2018 13:06:34 +0000 (15:06 +0200)] 
fuzz: updated traces for latest TLS1.3 draft

Relates #359

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agotests: run tls-fuzzer PSK testsuite
Nikos Mavrogiannopoulos [Thu, 26 Jul 2018 10:40:54 +0000 (12:40 +0200)] 
tests: run tls-fuzzer PSK testsuite

Resolves #508

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agotests: added unit test of handshake with large certificate
Nikos Mavrogiannopoulos [Thu, 26 Jul 2018 09:27:23 +0000 (11:27 +0200)] 
tests: added unit test of handshake with large certificate

This checks whether handshake message fragmentation and de-fragmentation
is functional on server and client.

Resolves #513

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agocerttool: eliminated limits in certificate export size
Nikos Mavrogiannopoulos [Thu, 26 Jul 2018 09:02:37 +0000 (11:02 +0200)] 
certtool: eliminated limits in certificate export size

That allows printing an exporting certificates of size only bounded
by avail memory.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agocerttool: eliminate maximum limit in fields read with READ_MULTI_LINE_TOKENIZED()
Nikos Mavrogiannopoulos [Thu, 26 Jul 2018 08:56:25 +0000 (10:56 +0200)] 
certtool: eliminate maximum limit in fields read with READ_MULTI_LINE_TOKENIZED()

This allows to generate a certificate with an extension of arbitrary size.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'tmp-tls13-fixes' into 'master'
Tim Rühsen [Thu, 26 Jul 2018 08:04:21 +0000 (08:04 +0000)] 
Merge branch 'tmp-tls13-fixes' into 'master'

Fixes on TLS1.3 support

Closes #525

See merge request gnutls/gnutls!718

7 years agognutls.h: corrected typo
Nikos Mavrogiannopoulos [Wed, 25 Jul 2018 14:41:38 +0000 (16:41 +0200)] 
gnutls.h: corrected typo

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agosend_client_hello: don't override version after HRR is received
Nikos Mavrogiannopoulos [Wed, 25 Jul 2018 12:48:47 +0000 (14:48 +0200)] 
send_client_hello: don't override version after HRR is received

When a Hello Retry Request is received, do not set our (transient)
version to TLS1.2 on the second client hello. That's because both
peers have already negotiated TLS1.3.

This addresses issue with peers which may send a changecipherspec
message at this stage, which is now allowed when our version is
set to be TLS1.2. Introduced test suite using openssl and resumption
using HRR which reproduces the issue.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agohello_ext_parse: apply the test for pre-shared key ext being last on client hello
Nikos Mavrogiannopoulos [Wed, 25 Jul 2018 11:08:35 +0000 (13:08 +0200)] 
hello_ext_parse: apply the test for pre-shared key ext being last on client hello

We were incorrectly insisting on pre-shared key extension being last in
both client and server hello. That was incorrect, as only in client hello
it is required by TLS1.3 to be last.

Quoting:
   The "pre_shared_key" extension MUST be the last extension in the
   ClientHello (this facilitates implementation as described below).
   Servers MUST check that it is the last extension and otherwise fail
   the handshake with an "illegal_parameter" alert.

Resolves #525

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years ago.gitlab-ci.yml: automatically retry failed jobs
Nikos Mavrogiannopoulos [Tue, 24 Jul 2018 18:58:10 +0000 (20:58 +0200)] 
.gitlab-ci.yml: automatically retry failed jobs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agodoc update
Nikos Mavrogiannopoulos [Tue, 24 Jul 2018 14:48:32 +0000 (16:48 +0200)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>