]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
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

8 years agoFixed some spelling issues. [ci skip]
Tom Vrancken [Tue, 22 May 2018 09:22:42 +0000 (11:22 +0200)] 
Fixed some spelling issues. [ci skip]

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
8 years agoAdded extra extension flag to docs.
Tom Vrancken [Mon, 21 May 2018 19:58:55 +0000 (21:58 +0200)] 
Added extra extension flag to docs.
Added description of default pack and unpack functions.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
8 years agoRemoved section about Heartbleed.
Tom Vrancken [Mon, 21 May 2018 07:44:16 +0000 (09:44 +0200)] 
Removed section about Heartbleed.
Referenced new functions _gnutls_hello_ext_set_datum / _gnutls_hello_ext_get_datum for manipulation extension data.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
8 years agoFixed typo and incorrect function references.
Tom Vrancken [Sun, 20 May 2018 08:23:36 +0000 (10:23 +0200)] 
Fixed typo and incorrect function references.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
8 years agoUpdated documentation on Hello extensions.
Tom Vrancken [Sat, 19 May 2018 20:22:29 +0000 (22:22 +0200)] 
Updated documentation on Hello extensions.

Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
8 years agoMerge branch 'tmp-pkcs11-raw' into 'master'
Nikos Mavrogiannopoulos [Mon, 21 May 2018 11:45:11 +0000 (11:45 +0000)] 
Merge branch 'tmp-pkcs11-raw' into 'master'

gnutls_pkcs11_token_get_ptr, gnutls_pkcs11_obj_get_ptr: introduced

See merge request gnutls/gnutls!640

8 years agopkcs11: consistent/clear naming of find obj callbacks and structs
Nikos Mavrogiannopoulos [Sat, 19 May 2018 09:30:35 +0000 (11:30 +0200)] 
pkcs11: consistent/clear naming of find obj callbacks and structs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Fri, 18 May 2018 09:04:34 +0000 (11:04 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_pkcs11_token_get_ptr, gnutls_pkcs11_obj_get_ptr: introduced
Nikos Mavrogiannopoulos [Fri, 18 May 2018 07:19:16 +0000 (09:19 +0200)] 
gnutls_pkcs11_token_get_ptr, gnutls_pkcs11_obj_get_ptr: introduced

This allows an application to open a PKCS#11 token using a URI,
and use it directly, bypassing gnutls. That is useful to take
advantage of PKCS#11 functionality not wrapped by gnutls but
still use PKCS#11 URIs to identify the token.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoCONTRIBUTING.md: document why gnulib is kept separate [ci skip]
Nikos Mavrogiannopoulos [Sat, 19 May 2018 10:47:16 +0000 (12:47 +0200)] 
CONTRIBUTING.md: document why gnulib is kept separate [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agocerttool: split long prompt for serial
Martin Sucha [Fri, 18 May 2018 16:52:41 +0000 (18:52 +0200)] 
certtool: split long prompt for serial

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agodoc: add note about CRL numbers to man page
Martin Sucha [Fri, 18 May 2018 11:00:43 +0000 (13:00 +0200)] 
doc: add note about CRL numbers to man page

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agocerttool: ask again until serial/crl number is valid
Martin Sucha [Fri, 18 May 2018 10:35:39 +0000 (12:35 +0200)] 
certtool: ask again until serial/crl number is valid

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agotests: remove check for broken datefudge
Martin Sucha [Fri, 18 May 2018 09:39:53 +0000 (11:39 +0200)] 
tests: remove check for broken datefudge

This check is not necessary with Fedora 28 build image
currently used for CI as it contains datefudge 1.22
as well.

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agocerttool: remove extra function
Martin Sucha [Fri, 18 May 2018 08:43:26 +0000 (10:43 +0200)] 
certtool: remove extra function

I did not notice strip_nl previously.

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agotests: add negative tests for certtool crl numbers
Martin Sucha [Fri, 18 May 2018 08:31:30 +0000 (10:31 +0200)] 
tests: add negative tests for certtool crl numbers

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agodoc: add NEWS about serial and CRL numbers
Martin Sucha [Sun, 13 May 2018 21:28:33 +0000 (23:28 +0200)] 
doc: add NEWS about serial and CRL numbers

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agodoc: add hex format to example template
Martin Sucha [Sun, 13 May 2018 21:04:29 +0000 (23:04 +0200)] 
doc: add hex format to example template

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agocerttool: use larger serial and CRL numbers
Martin Sucha [Thu, 17 May 2018 10:31:01 +0000 (12:31 +0200)] 
certtool: use larger serial and CRL numbers

Serial/CRL numbers can be up to 20 octets in length
as per RFC 5280, so it should be possible to use
such numbers as input to certtool. certtool
only allowed to specify 63-bit numbers in
template file or interactively (even though
it generated larger numbers in batch mode
by default).

This patch allows large numbers to be specified
as a hexadecimal string. Parsing of decimal numbers
larger than native integers would require adding
dependency on libgmp directly to certtool or
extending the API exposed by GnuTLS library with parsing
functions. Since most tools (including GnuTLS) display
serial numbers in hexadecimal, it is not worth the
trouble to support large decimal numbers.

Default values are unified between batch mode and
interactive input and their size is extended.

CA/Browser forum recommends CAs to include at least
64 bits of random data in the certificate serial
numbers in Baseline Requirements[1] section 7.1, but
gnutls adds only 32 bits. Some other
implementations generate default serial numbers
with more entropy as well, here is the current state
as of May 2018:

+----------------+-------------------------------+
| Implementation | Random bits in default serial |
+----------------+-------------------------------+
| OpenSSL [2]    | 159                           |
| CFSSL [3]      | 159                           |
| wolfSSL [4]    | 128                           |
| GnuTLS         | 32                            |
| Mbed TLS [5]   | 0 (defaults to 1)             |
+----------------+-------------------------------+

The 20 octet field size can fit numbers up to 159 bits
since the most significant bit must be zero as numbers
in DER encoding are in two's complement and the serial
and CRL numbers must be positive.

Default serial numbers are extended to full 159 bits
allowed by the field size and are completely random,
which matches other implementations.

CRL numbers have the same size requirements, but also
need to be monotonic (RFC 5280, section 5.2.3). That's
why timestamp is used in them. The timestamp portion
is extended from 31 bits to 39 bits as 31 bits will
overflow in year 2038. The rest of the available space
up to 159 bits allowed in the 20 octet limit is filled
with random bits.

Since the new CRL numbers are larger, the requirement for them
to be monotonically increasing is preserved when upgrading to a
newer version. This does not hold the other way around though,
so after using a newer version of certtool to generate a CRL
with default number and publishing it, it's not possible
to use older version anymore to generate subsequent CRLs.
Unfortunately, there is no easy workaround for users of older
certtool, since it is not possible to specify CRL numbers
greater than 63 bits manually prior to this change.
Users intending to downgrade to older version later are advised
to specify the CRL numbers in new version of certtool
manually with values they are smaller than what would get
generated by default in the old version.

grep does not recognize CRLF line endings generated
in tests using MinGW, so we need to convert those to
LF endings for $ in the regex to match test output
correctly.

datefudge 1.21 that is present in Fedora 26
image trims the timestamp to 32 bits. That bug was
fixed in datefudge 1.22 available in the Debian image,
so we check if datefudge behaves correctly
and skip the test that uses more than 32 bits if
datefudge is broken.

[1] https://cabforum.org/wp-content/uploads/CA-Browser-Forum-BR-1.4.2.pdf
[2] https://github.com/openssl/openssl/blob/6ebb49f3f9c9333611192561979bb799fa1eb76d/apps/apps.c#L1513
[3] https://github.com/cloudflare/cfssl/blob/5d63dbd981b5c408effbb58c442d54761ff94fbd/signer/local/local.go#L295
[4] https://github.com/wolfSSL/wolfssl/blob/d60b16c5b8c19cc61db4a5c3f5e085a7a158cd28/wolfcrypt/src/asn.c#L9791
[5] https://github.com/ARMmbed/mbedtls/blob/84a1107818aaddfd2abe4c5a3478cf84ab2e26b4/programs/x509/cert_write.c#L81

Signed-off-by: Martin Sucha <anty.sk+git@gmail.com>
8 years agoMerge branch 'tmp-prohibit-tls-dtls-mix' into 'master'
Nikos Mavrogiannopoulos [Fri, 18 May 2018 13:48:13 +0000 (13:48 +0000)] 
Merge branch 'tmp-prohibit-tls-dtls-mix' into 'master'

Added the notion of TLS-only and DTLS-only extensions

Closes #440

See merge request gnutls/gnutls!634

8 years agohandshake: do not send TLS extensions under DTLS and vice versa
Nikos Mavrogiannopoulos [Mon, 7 May 2018 07:52:32 +0000 (09:52 +0200)] 
handshake: do not send TLS extensions under DTLS and vice versa

That is, introduce the notion of TLS-only and DTLS-only extensions,
providing a framework to prevent sending extensions which are registered
for example for TLS 1.3, under DTLS and vice versa.

Resolves #440

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_ext_raw_parse: introduced GNUTLS_EXT_RAW_FLAG_DTLS_CLIENT_HELLO
Nikos Mavrogiannopoulos [Mon, 7 May 2018 09:51:41 +0000 (11:51 +0200)] 
gnutls_ext_raw_parse: introduced GNUTLS_EXT_RAW_FLAG_DTLS_CLIENT_HELLO

This allows parsing extensions from a DTLS client hello.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: fix serv location in testcompat-main-openssl
Nikos Mavrogiannopoulos [Wed, 16 May 2018 13:32:35 +0000 (15:32 +0200)] 
tests: fix serv location in testcompat-main-openssl

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests/suite: add missing file to dist
Andreas Metzler [Sun, 13 May 2018 12:39:14 +0000 (14:39 +0200)] 
tests/suite: add missing file to dist

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
8 years agoAllow running of test against installed gnutls-serv
Andreas Metzler [Sun, 13 May 2018 12:33:17 +0000 (14:33 +0200)] 
Allow running of test against installed gnutls-serv

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
8 years agognutls_certificate_set_retrieve_function3: updated documentation 628/head
Nikos Mavrogiannopoulos [Fri, 4 May 2018 12:55:21 +0000 (14:55 +0200)] 
gnutls_certificate_set_retrieve_function3: updated documentation

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Wed, 2 May 2018 12:30:24 +0000 (14:30 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopcert: added functionality to retrieve lists
Nikos Mavrogiannopoulos [Sun, 29 Apr 2018 13:16:35 +0000 (15:16 +0200)] 
pcert: added functionality to retrieve lists

That introduces gnutls_pcert_list_import_x509_file() and
gnutls_x509_crt_list_import_url().

Resolves #373

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: sanity-cpp: fixes for win32
Nikos Mavrogiannopoulos [Sat, 12 May 2018 08:10:28 +0000 (10:10 +0200)] 
tests: sanity-cpp: fixes for win32

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years ago.gitlab-ci.yml: bumped version of cache due to addition of CXXFLAGS
Nikos Mavrogiannopoulos [Sat, 12 May 2018 07:51:59 +0000 (09:51 +0200)] 
.gitlab-ci.yml: bumped version of cache due to addition of CXXFLAGS

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: fix failures in cxx example
Nikos Mavrogiannopoulos [Sat, 12 May 2018 07:04:28 +0000 (09:04 +0200)] 
tests: fix failures in cxx example

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agocxx: bring few modern functions, and allow to get the raw session
Nikos Mavrogiannopoulos [Sat, 12 May 2018 06:47:15 +0000 (08:47 +0200)] 
cxx: bring few modern functions, and allow to get the raw session

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoMerge branch 'master' into 'master'
Nikos Mavrogiannopoulos [Sat, 12 May 2018 06:55:32 +0000 (06:55 +0000)] 
Merge branch 'master' into 'master'

New C++ interfaces for passing flags while construction

Closes #438

See merge request gnutls/gnutls!637

8 years agoNew constructors for classes client_session() and server_session() provide passing...
Philippe Widmer [Thu, 10 May 2018 14:44:58 +0000 (16:44 +0200)] 
New constructors for classes client_session() and server_session() provide passing flags. Closes #438.

Signed-off-by: Philippe Widmer <pw@earthwave.ch>
8 years agotests: mini-record-timing: updated to work under newer gnutls [ci skip]
Nikos Mavrogiannopoulos [Thu, 10 May 2018 11:38:32 +0000 (13:38 +0200)] 
tests: mini-record-timing: updated to work under newer gnutls [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: key_update: improved error checking and increased timeout
Nikos Mavrogiannopoulos [Thu, 10 May 2018 03:49:07 +0000 (05:49 +0200)] 
tests: key_update: improved error checking and increased timeout

That is to avoid reaching the maximum number of key updates per second.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years ago.gitlab-ci.yml: moved fedora CI builds to F28
Nikos Mavrogiannopoulos [Sat, 5 May 2018 20:31:39 +0000 (22:31 +0200)] 
.gitlab-ci.yml: moved fedora CI builds to F28

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: testcompat-openssl: disable DSS ciphersuites under SSL3.0
Nikos Mavrogiannopoulos [Sat, 5 May 2018 21:21:16 +0000 (23:21 +0200)] 
tests: testcompat-openssl: disable DSS ciphersuites under SSL3.0

Previously if openssl wouldn't support DSS, we would only disable
DSS under TLS1.0 or later, not under SSL 3.0. This fixes interoperability
with Fedora28 openssl.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoMakefile.am: optimized the abi-check configure step
Nikos Mavrogiannopoulos [Mon, 7 May 2018 06:12:12 +0000 (08:12 +0200)] 
Makefile.am: optimized the abi-check configure step

Also ensured that the same build flags are applied in both builds
for ABI checking.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoseveral updates to address issues found by clang static analyzer
Nikos Mavrogiannopoulos [Sat, 5 May 2018 21:15:06 +0000 (23:15 +0200)] 
several updates to address issues found by clang static analyzer

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agonettle: fix casts which result to warnings in newer gcc
Nikos Mavrogiannopoulos [Sat, 5 May 2018 20:51:26 +0000 (22:51 +0200)] 
nettle: fix casts which result to warnings in newer gcc

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: updated for GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER from handshake
Nikos Mavrogiannopoulos [Mon, 7 May 2018 19:58:30 +0000 (21:58 +0200)] 
tests: updated for GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER from handshake

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agohandshake: use GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER consistently
Nikos Mavrogiannopoulos [Mon, 7 May 2018 19:49:16 +0000 (21:49 +0200)] 
handshake: use GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER consistently

Also treat GNUTLS_E_ILLEGAL_PARAMETER as a synonym if returned during
a connection.

Relates #442

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoCONTRIBUTING.md: documented status of C++ library [ci skip]
Nikos Mavrogiannopoulos [Mon, 7 May 2018 19:42:44 +0000 (21:42 +0200)] 
CONTRIBUTING.md: documented status of C++ library [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: cookie: fixed exit condition [ci skip]
Nikos Mavrogiannopoulos [Mon, 7 May 2018 08:50:30 +0000 (10:50 +0200)] 
tests: cookie: fixed exit condition [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc update [ci skip]
Nikos Mavrogiannopoulos [Mon, 7 May 2018 13:39:30 +0000 (15:39 +0200)] 
doc update [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years ago.gitlab-ci.yml: fixes in win32 builds
Nikos Mavrogiannopoulos [Mon, 7 May 2018 06:17:09 +0000 (08:17 +0200)] 
.gitlab-ci.yml: fixes in win32 builds

Relates #439

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agocerttool: honor --ask-pass when loading a private key
Nikos Mavrogiannopoulos [Fri, 4 May 2018 06:39:30 +0000 (08:39 +0200)] 
certtool: honor --ask-pass when loading a private key

This also improves the password prompt when the password requested
is not for a smart card.

Resolves: #436

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years ago.gitlab-ci.yml: Disable full test suite for cross builds
Michael Weiser [Fri, 27 Apr 2018 13:35:30 +0000 (15:35 +0200)] 
.gitlab-ci.yml: Disable full test suite for cross builds

Disable the full test suite for cross CI builds to speed them up.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
8 years ago.gitlab-ci.yml: Expire all build log artifacts
Michael Weiser [Wed, 25 Apr 2018 14:54:27 +0000 (16:54 +0200)] 
.gitlab-ci.yml: Expire all build log artifacts

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
8 years agoUse configured CC for pkg-config test
Michael Weiser [Wed, 28 Mar 2018 20:47:01 +0000 (22:47 +0200)] 
Use configured CC for pkg-config test

Using the configured compiler aids in running the test suite under qemu
or in a multlib scenario.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
8 years agoAdd Debian-based qemu cross CI targets
Michael Weiser [Mon, 19 Mar 2018 18:02:12 +0000 (19:02 +0100)] 
Add Debian-based qemu cross CI targets

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
8 years agoupdated-auto-generated files
Nikos Mavrogiannopoulos [Sat, 5 May 2018 20:38:56 +0000 (22:38 +0200)] 
updated-auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agofuzzer: added fresh TLS1.3 server trace
Nikos Mavrogiannopoulos [Sat, 5 May 2018 20:17:15 +0000 (22:17 +0200)] 
fuzzer: added fresh TLS1.3 server trace

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agognutls-serv: all skipping DTLS cookie request
Nikos Mavrogiannopoulos [Sat, 5 May 2018 19:59:13 +0000 (21:59 +0200)] 
gnutls-serv: all skipping DTLS cookie request

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agognutls-cli: corrected data written by server trace
Nikos Mavrogiannopoulos [Sat, 5 May 2018 19:45:56 +0000 (21:45 +0200)] 
gnutls-cli: corrected data written by server trace

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: post handshake auth: test more combinations
Nikos Mavrogiannopoulos [Thu, 3 May 2018 09:53:51 +0000 (11:53 +0200)] 
tests: post handshake auth: test more combinations

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopost_handshake_auth: send extension irrespective of certificates being present
Nikos Mavrogiannopoulos [Thu, 3 May 2018 09:48:46 +0000 (11:48 +0200)] 
post_handshake_auth: send extension irrespective of certificates being present

The feature does not necessarily require certificates to be present
and an empty cert can be presented. Furthermore, the certificates
can be set later on the credentials structure.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoMerge branch 'tmp-openssl-suite' into 'master'
Nikos Mavrogiannopoulos [Fri, 4 May 2018 10:29:10 +0000 (10:29 +0000)] 
Merge branch 'tmp-openssl-suite' into 'master'

Added testsuite for TLS1.3 interoperability with openssl

Closes #228 and #427

See merge request gnutls/gnutls!621

8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Thu, 3 May 2018 11:48:52 +0000 (13:48 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added interop tests with openssl under TLS1.3
Nikos Mavrogiannopoulos [Sun, 8 Apr 2018 16:38:47 +0000 (18:38 +0200)] 
tests: added interop tests with openssl under TLS1.3

This adds interoperability tests for:
 * PSK with elliptic curve DHE
 * RSA,RSA-PSS,secp256r1,ed25519 server certificate
 * RSA,RSA-PSS,secp256r1,ed25519 client certificate
 * X25519,SECP256R1 key share exchange
 * key share with HRR

Relates #328

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