]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
7 years agognutls-cli-debug: mention RFC8446 for TLS1.3 and RFC8422 for X25519 tmp-gnutls-cli-debug-fix
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-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>
7 years agoallow no certificates to be reported by the gnutls_certificate_retrieve_function...
Nikos Mavrogiannopoulos [Tue, 24 Jul 2018 14:38:08 +0000 (16:38 +0200)] 
allow no certificates to be reported by the gnutls_certificate_retrieve_function callbacks

In 9829ef9a we introduced a wrapper over the older callback functions
which didn't handle this case.

Resolves #528

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'fix-cert-callbacks' into 'master'
Nikos Mavrogiannopoulos [Tue, 24 Jul 2018 10:13:48 +0000 (10:13 +0000)] 
Merge branch 'fix-cert-callbacks' into 'master'

cert-cred: fix possible segfault when resetting cert retrieval function

Closes #528

See merge request gnutls/gnutls!714

7 years agocert-cred: fix possible segfault when resetting cert retrieval function
Dmitry Eremin-Solenikov [Fri, 20 Jul 2018 17:49:28 +0000 (20:49 +0300)] 
cert-cred: fix possible segfault when resetting cert retrieval function

Reset get_cert_callback3 callback to NULL if provided callback is NULL.
Otherwise after the certificate request call_legacy_cert_cb1 /
call_legacy_cert_cb2 will try to unconditionally call legacy_cert_cb1 /
legacy_cert_cb2 callback (set to NULL) leading to segfault.

Fixes: 9829ef9a3ca06d60472599df7c74ebb9a53f1fe2
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoMerge branch 'misc-fixes' into 'master'
Tim Rühsen [Mon, 23 Jul 2018 20:33:17 +0000 (20:33 +0000)] 
Merge branch 'misc-fixes' into 'master'

Few small patches

See merge request gnutls/gnutls!715

7 years agokx: for uniformity print master secret size
Dmitry Eremin-Solenikov [Sun, 22 Jul 2018 17:31:36 +0000 (20:31 +0300)] 
kx: for uniformity print master secret size

During keys setup phase debug log will contain sizes of all keys and
secrets, except master secret. Dump MS length (48) to log for
uniformity.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoconstate: dump full key block to log
Dmitry Eremin-Solenikov [Sun, 22 Jul 2018 17:31:09 +0000 (20:31 +0300)] 
constate: dump full key block to log

Include full key block to the debug log.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoconstate: dump MAC keys to debug log
Dmitry Eremin-Solenikov [Sun, 22 Jul 2018 17:30:04 +0000 (20:30 +0300)] 
constate: dump MAC keys to debug log

_gnutls_set_keys() can dump client/server write keys/ivs to debug log,
but it skips MAC keys. Add MAC keys to log.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoconstate: drop unused variable in _gnutls_set_keys
Dmitry Eremin-Solenikov [Sun, 22 Jul 2018 17:25:35 +0000 (20:25 +0300)] 
constate: drop unused variable in _gnutls_set_keys

_gnutls_set_keys() creates rrnd as client random + server random, but
does not use it (it was used before for export key generation, but was
not removed when dropping support for export cipher suites).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fixes: 8bdb8d53aa5b4c5d04255b6c9b5f2dac8b23d51b
7 years agocert auth: simplify certificate selection code
Dmitry Eremin-Solenikov [Sat, 21 Jul 2018 10:23:42 +0000 (13:23 +0300)] 
cert auth: simplify certificate selection code

Merge pubkey_is_compat_with_cs() and select_sign_algorithm() functions
to ease extension of certificate selection code.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agoMerge branch 'tmp-fix-521' into 'master'
Nikos Mavrogiannopoulos [Sun, 22 Jul 2018 12:17:26 +0000 (12:17 +0000)] 
Merge branch 'tmp-fix-521' into 'master'

Remove trailing dot from hostname input

See merge request gnutls/gnutls!709

7 years agoRemove trailing dot from hostname input
Tim Rühsen [Thu, 19 Jul 2018 10:50:13 +0000 (12:50 +0200)] 
Remove trailing dot from hostname input

Fixes #532

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
7 years agoMerge branch 'tmp-fix-pkcs8-export' into 'master'
Nikos Mavrogiannopoulos [Fri, 20 Jul 2018 20:12:39 +0000 (20:12 +0000)] 
Merge branch 'tmp-fix-pkcs8-export' into 'master'

Addressed issue with ECDSA key export under PKCS#8

Closes #516

See merge request gnutls/gnutls!707

7 years agognutls_x509_privkey_import_ecc_raw: encode parameters on import
Nikos Mavrogiannopoulos [Tue, 17 Jul 2018 07:03:38 +0000 (09:03 +0200)] 
gnutls_x509_privkey_import_ecc_raw: encode parameters on import

That makes the structure fully usable after import. In _encode_privkey()
use the lower-level _gnutls_x509_export_int2() for key encoding as the
call to higher gnutls_x509_privkey_export2() could result to an infinite
recursion when keys are incomplete.

Introduced additional tests for PKCS#8 key import and export.

Resolves: #516

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoMerge branch 'certtool-gost-paramset' into 'master'
Nikos Mavrogiannopoulos [Fri, 20 Jul 2018 14:34:16 +0000 (14:34 +0000)] 
Merge branch 'certtool-gost-paramset' into 'master'

certtool: use gnutls_gost_paramset_get_name

See merge request gnutls/gnutls!710

7 years agocerttool: use gnutls_gost_paramset_get_name
Dmitry Eremin-Solenikov [Thu, 19 Jul 2018 11:19:07 +0000 (14:19 +0300)] 
certtool: use gnutls_gost_paramset_get_name

gost_param_name() predates gnutls_gost_paramset_get_name() and
gnutls_gost_paramset_t. Use current API functions instead of hand-coding
new functions.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
7 years agognutls-cli: do not fail if CKA_ID is too long
Nikos Mavrogiannopoulos [Thu, 19 Jul 2018 09:24:04 +0000 (11:24 +0200)] 
gnutls-cli: do not fail if CKA_ID is too long

Increased the buffer needed to read reasonable-sized CKA_IDs
and avoid failure when the CKA_ID is too long.

Resolves #520

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years ago.gitlab-ci.yml: combined abi-check and TLS1.3 check runs
Nikos Mavrogiannopoulos [Thu, 19 Jul 2018 05:47:40 +0000 (07:47 +0200)] 
.gitlab-ci.yml: combined abi-check and TLS1.3 check runs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agotests: handshake-timeout: reverted virt-time.h usage
Nikos Mavrogiannopoulos [Thu, 19 Jul 2018 04:06:34 +0000 (06:06 +0200)] 
tests: handshake-timeout: reverted virt-time.h usage

The tests nature (waiting on a socket) didn't fit well with the virt-time
implementation. Reverted to original real-time wait and improved error
detection in child process.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agognutls_priority_init: fix err_pos on invalid strings
Nikos Mavrogiannopoulos [Mon, 16 Jul 2018 12:04:01 +0000 (14:04 +0200)] 
gnutls_priority_init: fix err_pos on invalid strings

When the provided string would be resolved (e.g., due to a @ priority
being used), to a different string, then do not attempt to
detect the right location of the error. It will not be useful to the caller.

This addresses the issue of test suite failure when --with-system-priority-file
and --with-default-priority-string are provided. It also enhances the test suite
with these options being active.

Resolves #517

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
7 years agoexamples: tlsproxy: use snprintf instead of strncpy
Nikos Mavrogiannopoulos [Tue, 17 Jul 2018 19:55:33 +0000 (21:55 +0200)] 
examples: tlsproxy: use snprintf instead of strncpy

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>