]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
8 years agosignatures: distinguish RSA-PSS signatures with RSA PKCS#1 1.5 certificates from...
Nikos Mavrogiannopoulos [Tue, 6 Mar 2018 14:09:50 +0000 (15:09 +0100)] 
signatures: distinguish RSA-PSS signatures with RSA PKCS#1 1.5 certificates from "pure"

This change enhances signature algorithms to have a private key algorithm
parameter. That is, to allow signature algorithms operating with a private
key of type X while the public key is of type Y. That is useful for the
RSA-PSS signatures which are of two types; one which is seen from servers
having PKCS#1 1.5 certificates, the other with RSA-PSS certificates, while
both utilize RSA-PSS private keys.

This is a draft-ietf-tls-tls13-23 change.

Resolves #400

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoServer hello format follows TLS1.2 format
Nikos Mavrogiannopoulos [Wed, 28 Feb 2018 11:41:40 +0000 (12:41 +0100)] 
Server hello format follows TLS1.2 format

Also version negotiation was moved to supported_versions extension,
and session ID is set by client following appendix D.4.

This is a draft-ietf-tls-tls13-22 change.

Resolves #393, #389, #397

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoRenumbered the key share extension to 51
Nikos Mavrogiannopoulos [Wed, 28 Feb 2018 10:38:53 +0000 (11:38 +0100)] 
Renumbered the key share extension to 51

This is a draft-ietf-tls-tls13-23 change.

Resolves #398

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agorecord: ignore any ChangeCipherSpec messages under TLS1.3 handshake
Nikos Mavrogiannopoulos [Thu, 22 Feb 2018 15:12:55 +0000 (16:12 +0100)] 
record: ignore any ChangeCipherSpec messages under TLS1.3 handshake

Also send ChangeCipherSpec messages under TLS1.3 handshake.

This is a draft-ietf-tls-tls13-22 change.

Resolves #395

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agorecord: send 0x0303 under TLS1.3
Nikos Mavrogiannopoulos [Thu, 22 Feb 2018 13:42:43 +0000 (14:42 +0100)] 
record: send 0x0303 under TLS1.3

This is a draft-ietf-tls-tls13-22 change.

Resolves #396

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agocryptodev: fix prototype of cryptodev_mac_fast [ci skip]
Nikos Mavrogiannopoulos [Thu, 8 Mar 2018 11:03:39 +0000 (12:03 +0100)] 
cryptodev: fix prototype of cryptodev_mac_fast [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agocryptodev: added missing macro [ci skip]
Nikos Mavrogiannopoulos [Wed, 7 Mar 2018 15:14:51 +0000 (16:14 +0100)] 
cryptodev: added missing macro [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoMerge branch 'tmp-fix-re-encoding' into 'master'
Nikos Mavrogiannopoulos [Mon, 5 Mar 2018 16:17:39 +0000 (16:17 +0000)] 
Merge branch 'tmp-fix-re-encoding' into 'master'

Avoid re-encoding of certificates

See merge request gnutls/gnutls!608

8 years agotests: added unit tests of gnutls_x509_crt_export
Nikos Mavrogiannopoulos [Mon, 5 Mar 2018 14:42:14 +0000 (15:42 +0100)] 
tests: added unit tests of gnutls_x509_crt_export

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc update
Nikos Mavrogiannopoulos [Fri, 2 Mar 2018 22:21:34 +0000 (23:21 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agognutls_x509_crt_export2: avoid re-encoding
Nikos Mavrogiannopoulos [Fri, 2 Mar 2018 22:09:11 +0000 (23:09 +0100)] 
gnutls_x509_crt_export2: avoid re-encoding

That prevents possible re-encoding issues in libtasn1 or ambiguously
formatted DER data, from affecting verbatim usage of certificates.

Relates #403

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: added reproducer with DER re-encoding error on client side
Nikos Mavrogiannopoulos [Fri, 2 Mar 2018 16:48:01 +0000 (17:48 +0100)] 
tests: added reproducer with DER re-encoding error on client side

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agocfg.mk: update-po rule uses commit -s
Nikos Mavrogiannopoulos [Sun, 4 Mar 2018 18:07:29 +0000 (19:07 +0100)] 
cfg.mk: update-po rule uses commit -s

This makes it produce a commit message which can be sent to
the repo (Signed-off-by is mandatory).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoSync with TP.
Nikos Mavrogiannopoulos [Sun, 4 Mar 2018 18:01:41 +0000 (19:01 +0100)] 
Sync with TP.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoCONTRIBUTING.md: added more info about gnulib
Nikos Mavrogiannopoulos [Sun, 4 Mar 2018 18:01:23 +0000 (19:01 +0100)] 
CONTRIBUTING.md: added more info about gnulib

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoMerge branch 'tmp-fuzzer-coverage' into 'master'
Nikos Mavrogiannopoulos [Sun, 4 Mar 2018 18:03:52 +0000 (18:03 +0000)] 
Merge branch 'tmp-fuzzer-coverage' into 'master'

Improve fuzzer coverage report creation

See merge request gnutls/gnutls!609

8 years agoImprove fuzzer coverage report creation
Tim Rühsen [Sat, 3 Mar 2018 17:42:20 +0000 (18:42 +0100)] 
Improve fuzzer coverage report creation

8 years agoMerge branch 'tmp-rsa-pss-fix' into 'master'
Nikos Mavrogiannopoulos [Sat, 3 Mar 2018 15:28:08 +0000 (15:28 +0000)] 
Merge branch 'tmp-rsa-pss-fix' into 'master'

_gnutls_find_rsa_pss_salt_size: add a validity check for salt size

Closes #402

See merge request gnutls/gnutls!607

8 years agopkcs11: set the modulus bits on RSA keys
Nikos Mavrogiannopoulos [Fri, 2 Mar 2018 22:40:43 +0000 (23:40 +0100)] 
pkcs11: set the modulus bits on RSA keys

That value is necessary when using RSA-PSS keys.

Relates #402

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agognutls_privkey_import_ext4: enhanced with GNUTLS_PRIVKEY_INFO_PK_ALGO_BITS flag
Nikos Mavrogiannopoulos [Fri, 2 Mar 2018 13:51:31 +0000 (14:51 +0100)] 
gnutls_privkey_import_ext4: enhanced with GNUTLS_PRIVKEY_INFO_PK_ALGO_BITS flag

That flag is utilized by the information function to obtain the
value of the parameters (e.g., modulus). That information is necessary
to safely handle RSA-PSS keys.

For RSA-PSS keys this is a regression since 3.6.0 where this API was
introduced, but as this change is necessary and 3.6.x is not yet marked
as stable, it should be acceptable.

Relates #402

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years ago_gnutls_find_rsa_pss_salt_size: add a validity check for salt size
Nikos Mavrogiannopoulos [Fri, 2 Mar 2018 10:18:12 +0000 (11:18 +0100)] 
_gnutls_find_rsa_pss_salt_size: add a validity check for salt size

That is, in order to reject invalid parameters.

Resolves #402

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: eliminated destructive tests
Nikos Mavrogiannopoulos [Fri, 2 Mar 2018 08:38:55 +0000 (09:38 +0100)] 
tests: eliminated destructive tests

That adds a dependency to p11-kit 0.23.10 for the test suite.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoconfigure: simplified nettle version check
Nikos Mavrogiannopoulos [Thu, 1 Mar 2018 15:38:29 +0000 (16:38 +0100)] 
configure: simplified nettle version check

Relates #401

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls-cli: do not ask any questions with --strict-tofu
Łukasz Stelmach [Tue, 27 Feb 2018 14:44:55 +0000 (15:44 +0100)] 
gnutls-cli: do not ask any questions with --strict-tofu

Signed-off-by: Łukasz Stelmach <stlman@poczta.fm>
8 years agoUpdate oss-fuzz corpora
Tim Rühsen [Tue, 27 Feb 2018 21:04:10 +0000 (22:04 +0100)] 
Update oss-fuzz corpora

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
8 years agodrbg-aes: use the new nettle APIs for AES
Nikos Mavrogiannopoulos [Thu, 22 Feb 2018 10:43:53 +0000 (11:43 +0100)] 
drbg-aes: use the new nettle APIs for AES

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoaccelerated: padlock: use the new nettle APIs
Nikos Mavrogiannopoulos [Thu, 22 Feb 2018 10:29:08 +0000 (11:29 +0100)] 
accelerated: padlock: use the new nettle APIs

Also remove any ifdefs for nettle (it is not conditionally compiled in),
and do not register accelerators for AES-192-CBC. That cipher is widely
ignored to bother.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc update
Nikos Mavrogiannopoulos [Mon, 26 Feb 2018 10:46:09 +0000 (11:46 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Mon, 26 Feb 2018 10:44:56 +0000 (11:44 +0100)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_ext_raw_parse: introduced function
Nikos Mavrogiannopoulos [Fri, 23 Feb 2018 08:55:50 +0000 (09:55 +0100)] 
gnutls_ext_raw_parse: introduced function

That function can be combined with callbacks like
gnutls_handshake_set_hook_function() for applications to
be able to process messages when necessary.

Resolves #382

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agofuzz: added TLS1.3 client and server traces [ci skip]
Nikos Mavrogiannopoulos [Wed, 21 Feb 2018 10:46:08 +0000 (11:46 +0100)] 
fuzz: added TLS1.3 client and server traces [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agofuzz: enable fuzzer target in afl examples and add missing script [ci skip]
Nikos Mavrogiannopoulos [Wed, 21 Feb 2018 10:21:36 +0000 (11:21 +0100)] 
fuzz: enable fuzzer target in afl examples and add missing script [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agofuzz: fixes in README file [ci skip]
Nikos Mavrogiannopoulos [Wed, 21 Feb 2018 10:20:31 +0000 (11:20 +0100)] 
fuzz: fixes in README file [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoupdated Since version in new function entries as well as map file versions
Nikos Mavrogiannopoulos [Mon, 19 Feb 2018 19:11:57 +0000 (20:11 +0100)] 
updated Since version in new function entries as well as map file versions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agofuzz: enable TLS1.3 in server and client fuzzers
Nikos Mavrogiannopoulos [Mon, 19 Feb 2018 16:17:45 +0000 (17:17 +0100)] 
fuzz: enable TLS1.3 in server and client fuzzers

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Mon, 19 Feb 2018 14:10:00 +0000 (15:10 +0100)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc update
Nikos Mavrogiannopoulos [Mon, 19 Feb 2018 14:02:36 +0000 (15:02 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agorecord: new gnutls_record_send2 function
Daiki Ueno [Tue, 23 Jan 2018 15:39:36 +0000 (16:39 +0100)] 
record: new gnutls_record_send2 function

This adds a new function gnutls_record_send2() which takes an extra
argument to specify the padding size of the record.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years ago_gnutls_record_overhead: count content type octet in plaintext
Daiki Ueno [Thu, 8 Feb 2018 12:24:46 +0000 (13:24 +0100)] 
_gnutls_record_overhead: count content type octet in plaintext

In TLS 1.3, TLSInnerPlaintext has the 'type' field followed by the
padding.  Exclude it from the overhead calculation.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agotests: check extended record padding work with TLS 1.3
Daiki Ueno [Wed, 3 Jan 2018 13:14:56 +0000 (14:14 +0100)] 
tests: check extended record padding work with TLS 1.3

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agorange: make length hiding always usable under TLS 1.3
Daiki Ueno [Thu, 21 Dec 2017 16:02:22 +0000 (17:02 +0100)] 
range: make length hiding always usable under TLS 1.3

This patch reintroduce the extended record padding mode removed in
commit 7df219f0.  Under TLS 1.3, the padding mode can be implemented
in the record protocol.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agotests: re-enable mini-record-range test
Daiki Ueno [Wed, 3 Jan 2018 13:10:22 +0000 (14:10 +0100)] 
tests: re-enable mini-record-range test

This test was previously disabled as part of NEW_PADDING extension
removal (commit 7df219f0).  Even though the extension is not usable,
gnutls_record_send_range() should work with the standard TLS block
cipher padding.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agodoc: fix mention of gnutls_record_send_range()
Daiki Ueno [Thu, 21 Dec 2017 14:53:30 +0000 (15:53 +0100)] 
doc: fix mention of gnutls_record_send_range()

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agopo: lib/x509/ocsp.c added to translatable files
Nikos Mavrogiannopoulos [Sat, 27 Jan 2018 15:38:14 +0000 (16:38 +0100)] 
po: lib/x509/ocsp.c added to translatable files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: corrected various typos
Nikos Mavrogiannopoulos [Thu, 4 Jan 2018 16:32:58 +0000 (17:32 +0100)] 
tests: corrected various typos

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: use 3.6.xx to be consistent with other version references
Nikos Mavrogiannopoulos [Thu, 4 Jan 2018 16:26:54 +0000 (17:26 +0100)] 
doc: use 3.6.xx to be consistent with other version references

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc update
Nikos Mavrogiannopoulos [Tue, 2 Jan 2018 11:44:15 +0000 (12:44 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: getfuncs.pl: distinguish between different typedef types
Nikos Mavrogiannopoulos [Wed, 13 Dec 2017 09:11:57 +0000 (10:11 +0100)] 
doc: getfuncs.pl: distinguish between different typedef types

That allows to properly distinguish a struct from a one liner
typedef.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agocheck_ocsp_response: print OCSP response actual error on debug log
Nikos Mavrogiannopoulos [Wed, 13 Dec 2017 07:00:38 +0000 (08:00 +0100)] 
check_ocsp_response: print OCSP response actual error on debug log

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agox509/cert: reorganized
Nikos Mavrogiannopoulos [Tue, 12 Dec 2017 13:55:29 +0000 (14:55 +0100)] 
x509/cert: reorganized

Split functionality related to certificate credentials and
session certificate handling in cert-cred.c and cert-session.c

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added unit test for gnutls_ocsp_resp_list_import2
Nikos Mavrogiannopoulos [Wed, 29 Nov 2017 15:19:56 +0000 (16:19 +0100)] 
tests: added unit test for gnutls_ocsp_resp_list_import2

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: updated
Nikos Mavrogiannopoulos [Wed, 18 Oct 2017 08:35:53 +0000 (10:35 +0200)] 
doc: updated

* document the new behavior of gnutls_certificate_set_ocsp_status_request_file
* updated text on OCSP stapled responses

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added ocsptool sanity check program
Nikos Mavrogiannopoulos [Tue, 21 Nov 2017 15:31:02 +0000 (16:31 +0100)] 
tests: added ocsptool sanity check program

This checks its functionality in loading and exporting PEM
and DER structures.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: enhanced OCSP tests
Nikos Mavrogiannopoulos [Mon, 16 Oct 2017 14:05:15 +0000 (16:05 +0200)] 
tests: enhanced OCSP tests

* Run tests under TLS1.2 and TLS1.3
* Verify whether multiple OCSP responses are received in client
  side, under TLS1.3.
* Verify that OCSP status responses can be sent by
  client under TLS1.3
* Verify operation of gnutls_certificate_retrieve_function3
* Verify operation when multiple OCSP responses by file are set

Resolves #307
Resolves #291

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agocert auth: use a single callback to call for OCSP
Nikos Mavrogiannopoulos [Tue, 12 Dec 2017 07:47:00 +0000 (08:47 +0100)] 
cert auth: use a single callback to call for OCSP

That is, when selecting the certificate to use, point to
the callback to use as well (whether it being the global or
a specific) one, for OCSP.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoocsp: introduced gnutls_certificate_get_ocsp_expiration()
Nikos Mavrogiannopoulos [Wed, 22 Nov 2017 09:32:04 +0000 (10:32 +0100)] 
ocsp: introduced gnutls_certificate_get_ocsp_expiration()

This is a function to allow obtaining the validity of the OCSP responses
already set in the credential structures.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoocsp: enhanced the OCSP response loading APIs
Nikos Mavrogiannopoulos [Fri, 8 Dec 2017 12:45:24 +0000 (13:45 +0100)] 
ocsp: enhanced the OCSP response loading APIs

Introduced gnutls_certificate_set_ocsp_status_request_file2() and
gnutls_certificate_set_ocsp_status_request_mem(). These functions
behave as the equivalent certificate loading functions and pre-load
the OCSP response provided as a file, either in DER or in PEM form.

In addition, ensure that if the server is provided a problematic OCSP
response, or the OCSP response is not renewed before it is invalid, we
will not provide it to the clients.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls-serv: allow loading multiple OCSP responses
Nikos Mavrogiannopoulos [Wed, 18 Oct 2017 09:26:55 +0000 (11:26 +0200)] 
gnutls-serv: allow loading multiple OCSP responses

That is, allow specifying multiple 'ocsp-response' options on
command line. In addition introduce the option 'ignore-ocsp-response-errors'
which will set the GNUTLS_CERTIFICATE_SKIP_OCSP_RESPONSE_CHECK flag
prior to importing the response.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agocert: introduced flag GNUTLS_CERTIFICATE_SKIP_OCSP_RESPONSE_CHECK
Nikos Mavrogiannopoulos [Wed, 18 Oct 2017 08:32:20 +0000 (10:32 +0200)] 
cert: introduced flag GNUTLS_CERTIFICATE_SKIP_OCSP_RESPONSE_CHECK

This allows reverting the new semantics of checking the loaded
OCSP response against the certificates present and return
to the 3.5.x semantics.

That option is also useful for debugging as it allows setting
an arbitrary response and checking gnutls' client behavior with that.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_certificate_set_ocsp_status_request_file: match input response to certificates
Nikos Mavrogiannopoulos [Thu, 7 Dec 2017 15:16:55 +0000 (16:16 +0100)] 
gnutls_certificate_set_ocsp_status_request_file: match input response to certificates

That is, iterate through the certificate chain to figure to which
certificate the response corresponds to, and assign it to it.
That allows for applications to re-use this function to set
multiple responses when available.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoocsp: moved non-extension related functions to ocsp-api.c
Nikos Mavrogiannopoulos [Wed, 6 Dec 2017 12:51:52 +0000 (13:51 +0100)] 
ocsp: moved non-extension related functions to ocsp-api.c

That keeps ext/status_response.c clear of items that are
not related with the extension handling.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_ocsp_status_request_get2: allow operation under TLS1.3 for server side
Nikos Mavrogiannopoulos [Tue, 17 Oct 2017 07:59:53 +0000 (09:59 +0200)] 
gnutls_ocsp_status_request_get2: allow operation under TLS1.3 for server side

Under TLS1.3 it is possible for both client and server to send the
status request extension in certificate message.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoselect_sign_algorithm: check KX type only on pre-TLS1.3
Nikos Mavrogiannopoulos [Tue, 17 Oct 2017 06:32:09 +0000 (08:32 +0200)] 
select_sign_algorithm: check KX type only on pre-TLS1.3

That, when selecting a certificate under TLS1.3, considers
the negotiated signature algorithms for compatibility with the
certificate to be selected.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agorename _gnutls_selected_certs_set -> selected_certs_set
Nikos Mavrogiannopoulos [Wed, 6 Dec 2017 12:45:21 +0000 (13:45 +0100)] 
rename _gnutls_selected_certs_set -> selected_certs_set

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoocsp: send all the OCSP responses under TLS1.3
Nikos Mavrogiannopoulos [Wed, 6 Dec 2017 12:32:28 +0000 (13:32 +0100)] 
ocsp: send all the OCSP responses under TLS1.3

That is, any responses set by the caller application (directly
or via a callback), will be sent to the peer.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agointroduced gnutls_certificate_retrieve_function3
Nikos Mavrogiannopoulos [Wed, 6 Dec 2017 12:18:16 +0000 (13:18 +0100)] 
introduced gnutls_certificate_retrieve_function3

That allows a certificate callback to provide OCSP responses in addition
to certificates. That also introduces a flags option which currently
accepts GNUTLS_CERT_RETR_DEINIT_ALL which allows the callback to
specify whether the provided data should be deinitialized.

To simplify the certificate callback code, all previous (now legacy)
callbacks are implemented as wrappers over the new callback function.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_ocsp_resp_list_import2: introduced
Nikos Mavrogiannopoulos [Wed, 29 Nov 2017 13:27:44 +0000 (14:27 +0100)] 
gnutls_ocsp_resp_list_import2: introduced

That is, introduced function to to import multiple OCSP PEM
responses into a list.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoocsptool: import and export OCSP responses in PEM format
Nikos Mavrogiannopoulos [Tue, 21 Nov 2017 15:20:48 +0000 (16:20 +0100)] 
ocsptool: import and export OCSP responses in PEM format

That also modifies the 'request-info' and 'response-info' commands
to check the 'outfile' parameter and if set, to store the corresponding
structure into that file. Currently for OCSP requests there is no
printing of PEM data.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoocsp: introduced gnutls_ocsp_resp_import2 and gnutls_ocsp_resp_export2
Nikos Mavrogiannopoulos [Tue, 21 Nov 2017 13:59:31 +0000 (14:59 +0100)] 
ocsp: introduced gnutls_ocsp_resp_import2 and gnutls_ocsp_resp_export2

These allow importing and exporting an OCSP response to PEM format,
in addition to DER.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years ago_gnutls_x509_cert_verify_peers: verify all received OCSP responses
Nikos Mavrogiannopoulos [Fri, 13 Oct 2017 07:36:38 +0000 (09:36 +0200)] 
_gnutls_x509_cert_verify_peers: verify all received OCSP responses

That is, when verifying the server's certificate, take into account
all present OCSP responses.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_ocsp_status_request_get2: added function
Nikos Mavrogiannopoulos [Fri, 13 Oct 2017 07:31:58 +0000 (09:31 +0200)] 
gnutls_ocsp_status_request_get2: added function

The function extends gnutls_ocsp_status_request_get() to
retrieve more than a single responses.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotls13/certificate: parse OCSP status response and save responses in auth info struct
Nikos Mavrogiannopoulos [Tue, 10 Oct 2017 08:21:19 +0000 (10:21 +0200)] 
tls13/certificate: parse OCSP status response and save responses in auth info struct

That provides support of OCSP status response under TLS 1.3.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoext/status_request: allow more than a single OCSP response to be received
Nikos Mavrogiannopoulos [Tue, 10 Oct 2017 09:14:19 +0000 (11:14 +0200)] 
ext/status_request: allow more than a single OCSP response to be received

That change allows for arbitrary number of OCSP responses
which is required in TLS1.3. The received list is now stored
in auth structure, and thus packed with it on resumption data.
The status response extension data, are now only used on server
side, when temporarily storing the OCSP response to send.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years ago_gnutls_copy_certificate_auth_info: simplified and avoid multiple allocations
Nikos Mavrogiannopoulos [Tue, 10 Oct 2017 07:59:17 +0000 (09:59 +0200)] 
_gnutls_copy_certificate_auth_info: simplified and avoid multiple allocations

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: updated to account for HMAC-SHA384 and CAMELLIA removal
Nikos Mavrogiannopoulos [Tue, 19 Dec 2017 15:16:29 +0000 (16:16 +0100)] 
tests: updated to account for HMAC-SHA384 and CAMELLIA removal

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopriorities: provide a more consistent "story" for default cipher settings
Nikos Mavrogiannopoulos [Tue, 19 Dec 2017 15:00:45 +0000 (16:00 +0100)] 
priorities: provide a more consistent "story" for default cipher settings

Current settings in NORMAL priorities which were affected:
 * Enabled ciphers:
  - AES-GCM
  - CHACHA20-POLY1305
  - AES-CCM
  - AES-CBC

 * Enabled signature algorithms:
  - RSA-SHA256
  - RSA-PSS-SHA256
  - ECDSA-SHA256 / ECDSA-SECP256R1-SHA256
  - EDDSA-ED25519
  - RSA-SHA384
  - RSA-PSS-SHA384
  - ECDSA-SHA384 / ECDSA-SECP384R1-SHA384
  - RSA-SHA512
  - RSA-PSS-SHA512
  - ECDSA-SHA512 / ECDSA-SECP521R1-SHA512
  - RSA-SHA1
  - ECDSA-SHA1

Removed:
 * Ciphersuites utilizing HMAC-SHA384. That MAC is only used on "legacy"
   type of ciphersuites, and doesn't provide any advantage over HMAC-SHA256.
 * Ciphersuites utilizing CAMELLIA were removed. TLS1.3 doesn't define any
   CAMELLIA ciphersuites, and thus provide consistent defaults across
   protocols.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agocertificate request: corrected parsing of signature algorithms
Nikos Mavrogiannopoulos [Tue, 17 Oct 2017 07:27:36 +0000 (09:27 +0200)] 
certificate request: corrected parsing of signature algorithms

That fixes an issue in TLS 1.3 certificate request message parsing.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotlsfuzzer: updated to latest master
Nikos Mavrogiannopoulos [Mon, 4 Dec 2017 17:22:54 +0000 (18:22 +0100)] 
tlsfuzzer: updated to latest master

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agodoc: documented hsk_flags "lifetime" and its reset
Nikos Mavrogiannopoulos [Sat, 9 Dec 2017 10:23:24 +0000 (11:23 +0100)] 
doc: documented hsk_flags "lifetime" and its reset

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agosession state: TLS1.2 and TLS1.3 state is stored as union
Nikos Mavrogiannopoulos [Wed, 8 Nov 2017 12:13:31 +0000 (13:13 +0100)] 
session state: TLS1.2 and TLS1.3 state is stored as union

That is, to reduce memory usage as these protocol cannot be used
in parallel.

Relates: #281

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agosession state: organized key exchange keys into structures
Nikos Mavrogiannopoulos [Wed, 8 Nov 2017 12:08:02 +0000 (13:08 +0100)] 
session state: organized key exchange keys into structures

That is, with the view of separating the data needed for
TLS1.2 and earlier and TLS1.3.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agorecord state: avoid memory allocations for stored keys
Nikos Mavrogiannopoulos [Tue, 7 Nov 2017 15:52:21 +0000 (16:52 +0100)] 
record state: avoid memory allocations for stored keys

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: ffdhe flags merged with handshake flags
Nikos Mavrogiannopoulos [Tue, 7 Nov 2017 15:25:31 +0000 (16:25 +0100)] 
handshake: ffdhe flags merged with handshake flags

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: false start flag merged with hsk_flags
Nikos Mavrogiannopoulos [Tue, 7 Nov 2017 15:09:12 +0000 (16:09 +0100)] 
handshake: false start flag merged with hsk_flags

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: use hsk_flags in TLS1.2 and TLS1.3
Nikos Mavrogiannopoulos [Tue, 7 Nov 2017 14:36:01 +0000 (15:36 +0100)] 
handshake: use hsk_flags in TLS1.2 and TLS1.3

The flags provide a more transparent view of the received
and expected messages.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: added text on TLS1.3 rekey and reauthentication
Nikos Mavrogiannopoulos [Tue, 5 Dec 2017 08:01:56 +0000 (09:01 +0100)] 
doc: added text on TLS1.3 rekey and reauthentication

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Mon, 4 Dec 2017 16:45:11 +0000 (17:45 +0100)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: re-enabled post-handshake auth tests
Nikos Mavrogiannopoulos [Thu, 2 Nov 2017 14:30:43 +0000 (15:30 +0100)] 
tests: re-enabled post-handshake auth tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: added support for post-handshake authentication
Nikos Mavrogiannopoulos [Thu, 2 Nov 2017 14:19:10 +0000 (15:19 +0100)] 
handshake: added support for post-handshake authentication

That is:
 * introduced a gnutls_init() flag for clients to enable post-handshake
   authentication
 * introduced gnutls_reauth() function, to be called by servers to request
   authentication, and by clients to perform authentication

Resolves #562

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_record_set_state: use const for seq_number
Nikos Mavrogiannopoulos [Tue, 21 Nov 2017 10:12:14 +0000 (11:12 +0100)] 
gnutls_record_set_state: use const for seq_number

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added test suite on key limits
Nikos Mavrogiannopoulos [Mon, 20 Nov 2017 15:56:12 +0000 (16:56 +0100)] 
tests: added test suite on key limits

This checks whether key update occurs for the expected ciphersuites.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_record_get_state: doc update
Nikos Mavrogiannopoulos [Mon, 20 Nov 2017 15:52:58 +0000 (16:52 +0100)] 
gnutls_record_get_state: doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoIntroduce key usage limits under TLS1.3
Nikos Mavrogiannopoulos [Mon, 20 Nov 2017 15:01:29 +0000 (16:01 +0100)] 
Introduce key usage limits under TLS1.3

That introduces a transparent key update for sending key after
the safety limit is reached.

Resolves #130

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Mon, 20 Nov 2017 12:08:18 +0000 (13:08 +0100)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: removed unused variables and introduced temporal vars in macros
Nikos Mavrogiannopoulos [Mon, 30 Oct 2017 07:59:17 +0000 (08:59 +0100)] 
tests: removed unused variables and introduced temporal vars in macros

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: check gnutls_rehandshake() and gnutls_handshake() under TLS1.3
Nikos Mavrogiannopoulos [Mon, 30 Oct 2017 07:51:06 +0000 (08:51 +0100)] 
tests: check gnutls_rehandshake() and gnutls_handshake() under TLS1.3

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_*handshake: wrap gnutls_session_key_update under TLS 1.3
Nikos Mavrogiannopoulos [Sat, 28 Oct 2017 10:38:52 +0000 (12:38 +0200)] 
gnutls_*handshake: wrap gnutls_session_key_update under TLS 1.3

The semantics of the gnutls_handshake() and gnutls_rehandshake() functions
were tied to TLS 1.2 and earlier behavior. This patch attempts to merge
the two different semantics as follows:

TLS1.2:
 * gnutls_rehandshake: sends a hello request message (asks the peer for a re-handshake)
                       in server side; invalid to be called in client side.

 * gnutls_handshake: performs a re-handshake in either client or server side;
                     in server side it is expected to be called after
                     gnutls_rehandshake().

TLS1.3:
 * gnutls_rehandshake: in server side sends a key update and asks the peer to re-key
                       as well; remains invalid to be called in client side.

 * gnutls_handshake: sends a key update and asks the peer to re-key as well;
                     in client side; is a no-op when called in server side.

Relates #131

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: added unit tests with TLS1.3 key update
Nikos Mavrogiannopoulos [Thu, 19 Oct 2017 14:45:18 +0000 (16:45 +0200)] 
tests: added unit tests with TLS1.3 key update

Relates #131

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: introduced gnutls_session_key_update()
Nikos Mavrogiannopoulos [Thu, 19 Oct 2017 14:27:30 +0000 (16:27 +0200)] 
handshake: introduced gnutls_session_key_update()

This function allows updating keys of the session and notifying
the peer.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: added TLS1.3 passive key update
Nikos Mavrogiannopoulos [Thu, 19 Oct 2017 12:52:03 +0000 (14:52 +0200)] 
handshake: added TLS1.3 passive key update

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