]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
9 years agocerttool: improved error message when public key cannot be figured [ci skip]
Nikos Mavrogiannopoulos [Thu, 8 Jun 2017 07:25:32 +0000 (09:25 +0200)] 
certtool: improved error message when public key cannot be figured [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoupdated auto-generated files for new signing API
Nikos Mavrogiannopoulos [Tue, 6 Jun 2017 14:05:37 +0000 (16:05 +0200)] 
updated auto-generated files for new signing API

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agohandshake: simplify handshake by using the new signing API
Nikos Mavrogiannopoulos [Tue, 6 Jun 2017 14:00:41 +0000 (16:00 +0200)] 
handshake: simplify handshake by using the new signing API

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: introduced unit tests of the new signing API
Nikos Mavrogiannopoulos [Tue, 6 Jun 2017 11:38:05 +0000 (13:38 +0200)] 
tests: introduced unit tests of the new signing API

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoabstract API: introduced new signing functions
Nikos Mavrogiannopoulos [Tue, 30 May 2017 13:39:52 +0000 (15:39 +0200)] 
abstract API: introduced new signing functions

That is, the gnutls_privkey_sign_data2() and gnutls_privkey_sign_hash2().
The new functions perform signing with input the signature algorithm instead
of the hash algorithm; that allows to use algorithms where the hash algorithm
is not used, or the public key algorithm may be different than the key's.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopkix: removed unused definition
Nikos Mavrogiannopoulos [Wed, 7 Jun 2017 09:18:07 +0000 (11:18 +0200)] 
pkix: removed unused definition

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_privkey_st: removed unused element
Nikos Mavrogiannopoulos [Tue, 6 Jun 2017 14:04:53 +0000 (16:04 +0200)] 
gnutls_privkey_st: removed unused element

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_session_get_desc: improved ciphersuite description
Nikos Mavrogiannopoulos [Tue, 6 Jun 2017 08:34:33 +0000 (10:34 +0200)] 
gnutls_session_get_desc: improved ciphersuite description

That is, separated the key exchange from the signature algorithm
used by the server, and list them in different fields.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: key-import-export: use cert-common.h
Nikos Mavrogiannopoulos [Fri, 2 Jun 2017 09:16:45 +0000 (11:16 +0200)] 
tests: key-import-export: use cert-common.h

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: simplified CPPFLAGS of tests using internal gnutls funcs
Nikos Mavrogiannopoulos [Fri, 2 Jun 2017 15:04:45 +0000 (17:04 +0200)] 
tests: simplified CPPFLAGS of tests using internal gnutls funcs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: key-exchange: added error checking in gnutls_certificate_set_x509_key_mem
Nikos Mavrogiannopoulos [Tue, 6 Jun 2017 10:54:24 +0000 (12:54 +0200)] 
tests: key-exchange: added error checking in gnutls_certificate_set_x509_key_mem

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_check_key_cert_match: account for RSA and RSA-PSS mismatches
Nikos Mavrogiannopoulos [Tue, 6 Jun 2017 08:58:33 +0000 (10:58 +0200)] 
_gnutls_check_key_cert_match: account for RSA and RSA-PSS mismatches

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: fix DER export with --p7-info
Nikos Mavrogiannopoulos [Tue, 6 Jun 2017 07:49:09 +0000 (09:49 +0200)] 
certtool: fix DER export with --p7-info

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Mon, 5 Jun 2017 11:21:38 +0000 (13:21 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc update
Nikos Mavrogiannopoulos [Mon, 5 Jun 2017 08:01:07 +0000 (10:01 +0200)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopsktool: minor documentation updates
Nikos Mavrogiannopoulos [Mon, 5 Jun 2017 07:59:49 +0000 (09:59 +0200)] 
psktool: minor documentation updates

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added basic functionality check for psktool
Nikos Mavrogiannopoulos [Mon, 5 Jun 2017 07:52:53 +0000 (09:52 +0200)] 
tests: added basic functionality check for psktool

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopsktool: increased default key size to 256-bits
Nikos Mavrogiannopoulos [Mon, 5 Jun 2017 07:50:07 +0000 (09:50 +0200)] 
psktool: increased default key size to 256-bits

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopsktool: do not assume any default key file
Nikos Mavrogiannopoulos [Mon, 5 Jun 2017 07:39:49 +0000 (09:39 +0200)] 
psktool: do not assume any default key file

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoclarify documentation and arguments for psktool
Daniel Kahn Gillmor [Wed, 31 May 2017 16:58:58 +0000 (12:58 -0400)] 
clarify documentation and arguments for psktool

 * psktool's -p argument should really be short for --pskfile, not
   --passwd.  there is no passwd involved.

 * the example documentation switches names halfway through, which is
   confusing.

 * there is no prompt for a password.  do not mention it in the
   example.

9 years agotests: added unit test to verify that certificates with non-DER strict time fields...
Nikos Mavrogiannopoulos [Mon, 29 May 2017 07:22:44 +0000 (09:22 +0200)] 
tests: added unit test to verify that certificates with non-DER strict time fields are accepted

Also removed the old strict compliance DER test.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoTolerate DER time encoding errors
Nikos Mavrogiannopoulos [Mon, 29 May 2017 07:15:27 +0000 (09:15 +0200)] 
Tolerate DER time encoding errors

It seems that openssl generated certificates may contain invalid
formatted times, and gnutls will no longer parse them. Ignore such
formatting errors when DER decoding.

We should reconsider this in the future (#207)

Resolves #196

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: enhanced OID tests with OIDs for SHA3
Nikos Mavrogiannopoulos [Mon, 5 Jun 2017 08:24:04 +0000 (10:24 +0200)] 
tests: enhanced OID tests with OIDs for SHA3

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: enhanced OID tests with OIDs for RSA-PSS
Nikos Mavrogiannopoulos [Mon, 5 Jun 2017 08:21:54 +0000 (10:21 +0200)] 
tests: enhanced OID tests with OIDs for RSA-PSS

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago.gitlab-ci.yml: added aarch64 build based on Debian
Nikos Mavrogiannopoulos [Sun, 4 Jun 2017 11:56:04 +0000 (13:56 +0200)] 
.gitlab-ci.yml: added aarch64 build based on Debian

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years ago_gnutls_PRF: was made inline function
Nikos Mavrogiannopoulos [Wed, 31 May 2017 12:55:19 +0000 (14:55 +0200)] 
_gnutls_PRF: was made inline function

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added low-level unit tests on TLS 1.0 and 1.2 PRFs
Nikos Mavrogiannopoulos [Wed, 31 May 2017 12:29:10 +0000 (14:29 +0200)] 
tests: added low-level unit tests on TLS 1.0 and 1.2 PRFs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoprf: implement the TLS 1.0 and 1.2 PRFs using nettle
Nikos Mavrogiannopoulos [Wed, 31 May 2017 11:52:03 +0000 (13:52 +0200)] 
prf: implement the TLS 1.0 and 1.2 PRFs using nettle

That simplifies the existing PRF code and moves it in the
crypto-backend component.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc: refer to the site for commercial support options
Nikos Mavrogiannopoulos [Wed, 31 May 2017 10:00:26 +0000 (12:00 +0200)] 
doc: refer to the site for commercial support options

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: mini-record-retvals: include AES-CBC tests
Nikos Mavrogiannopoulos [Wed, 31 May 2017 09:29:08 +0000 (11:29 +0200)] 
tests: mini-record-retvals: include AES-CBC tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: eliminated build warnings
Nikos Mavrogiannopoulos [Wed, 31 May 2017 09:36:30 +0000 (11:36 +0200)] 
tests: eliminated build warnings

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: combined tables of sign-verify tests
Nikos Mavrogiannopoulos [Wed, 31 May 2017 06:55:54 +0000 (08:55 +0200)] 
tests: combined tables of sign-verify tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoOnly accept known public key algorithms in the GNUTLS_PRIVKEY_EXT private keys
Nikos Mavrogiannopoulos [Tue, 30 May 2017 17:54:48 +0000 (19:54 +0200)] 
Only accept known public key algorithms in the GNUTLS_PRIVKEY_EXT private keys

The reason is that this API, assumes very low level primitives which
are not available for the newer RSA-PSS private keys.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years ago_gnutls_privkey_*_sign_params: added support for GNUTLS_PRIVKEY_EXT keys
Nikos Mavrogiannopoulos [Tue, 30 May 2017 17:42:36 +0000 (19:42 +0200)] 
_gnutls_privkey_*_sign_params: added support for GNUTLS_PRIVKEY_EXT keys

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotests: added basic test on "external" keys with gnutls_privkey_import_ext2()
Nikos Mavrogiannopoulos [Tue, 30 May 2017 17:25:11 +0000 (19:25 +0200)] 
tests: added basic test on "external" keys with gnutls_privkey_import_ext2()

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agognutls_x509_privkey_sign_data: wrap over gnutls_privkey_sign_data()
Nikos Mavrogiannopoulos [Tue, 30 May 2017 14:53:14 +0000 (16:53 +0200)] 
gnutls_x509_privkey_sign_data: wrap over gnutls_privkey_sign_data()

That will allow this function to operate with the new key types.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit tests for the gnutls_x509_* sign/verify APIs
Nikos Mavrogiannopoulos [Tue, 30 May 2017 14:43:28 +0000 (16:43 +0200)] 
tests: added unit tests for the gnutls_x509_* sign/verify APIs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added tests signature validation using the sign/verify_data APIs
Nikos Mavrogiannopoulos [Mon, 29 May 2017 13:23:21 +0000 (15:23 +0200)] 
tests: added tests signature validation using the sign/verify_data APIs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoSeparated use of GNUTLS_PRIVKEY_FLAG_PROVABLE and GNUTLS_PRIVKEY_SIGN_FLAG_REPRODUCIBLE
Nikos Mavrogiannopoulos [Tue, 30 May 2017 14:24:05 +0000 (16:24 +0200)] 
Separated use of GNUTLS_PRIVKEY_FLAG_PROVABLE and GNUTLS_PRIVKEY_SIGN_FLAG_REPRODUCIBLE

For simplicity, rename GNUTLS_PRIVKEY_SIGN_FLAG_REPRODUCIBLE to GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_privkey_find_sign_params: renamed and simplified
Nikos Mavrogiannopoulos [Tue, 30 May 2017 14:19:25 +0000 (16:19 +0200)] 
_gnutls_privkey_find_sign_params: renamed and simplified

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_privkey_sign_hash: removed duplicate code
Nikos Mavrogiannopoulos [Tue, 30 May 2017 13:40:40 +0000 (15:40 +0200)] 
gnutls_privkey_sign_hash: removed duplicate code

The same code was available in _gnutls_privkey_find_sign_params().

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoGNUTLS_E_INSUFFICIENT_SECURITY: moved to fatal errors
Nikos Mavrogiannopoulos [Tue, 30 May 2017 08:47:12 +0000 (10:47 +0200)] 
GNUTLS_E_INSUFFICIENT_SECURITY: moved to fatal errors

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotls-sig: re-organize and simplify the TLS signature generation and verification
Nikos Mavrogiannopoulos [Mon, 29 May 2017 14:22:27 +0000 (16:22 +0200)] 
tls-sig: re-organize and simplify the TLS signature generation and verification

That makes sure that the high level APIs are used when possible, and
separate the TLS 1.2 from other code paths. This will allow supporting
signature schemes like EdDSA and others.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: modify tests to allow signatures with SHA1
Nikos Mavrogiannopoulos [Tue, 30 May 2017 08:59:53 +0000 (10:59 +0200)] 
tests: modify tests to allow signatures with SHA1

There were several tests that were utilizing SHA1 signatures but were
not failing due to the bug in gnutls_pubkey_verify_hash2().

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_pubkey_verify_hash2: do not allow GNUTLS_VERIFY_USE_TLS1_RSA with non-RSA...
Nikos Mavrogiannopoulos [Wed, 31 May 2017 08:12:31 +0000 (10:12 +0200)] 
gnutls_pubkey_verify_hash2: do not allow GNUTLS_VERIFY_USE_TLS1_RSA with non-RSA keys

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_pubkey_verify_hash2: check for broken signature algorithms
Nikos Mavrogiannopoulos [Tue, 30 May 2017 08:42:27 +0000 (10:42 +0200)] 
gnutls_pubkey_verify_hash2: check for broken signature algorithms

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_pubkey_verify_data2: do not utilize GNUTLS_VERIFY_USE_RSA_PSS
Nikos Mavrogiannopoulos [Tue, 30 May 2017 08:13:16 +0000 (10:13 +0200)] 
gnutls_pubkey_verify_data2: do not utilize GNUTLS_VERIFY_USE_RSA_PSS

This flag is not required for verification since the signature algorithm
is sufficient to detect RSA-PSS without requiring any flags.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: do not utilize GNUTLS_VERIFY_USE_RSA_PSS
Nikos Mavrogiannopoulos [Tue, 30 May 2017 08:36:59 +0000 (10:36 +0200)] 
tests: do not utilize GNUTLS_VERIFY_USE_RSA_PSS

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: do not ask for password when exporting to PKCS#8 implicitly
Nikos Mavrogiannopoulos [Mon, 29 May 2017 06:55:47 +0000 (08:55 +0200)] 
certtool: do not ask for password when exporting to PKCS#8 implicitly

Previously --generate-privkey wouldn't ask for password unless --pkcs8
was explicitly given. Keep that behavior, and do not ask for any password
even if we need to export to PKCS#8 for some key types. Always require
the --pkcs8 option to encrypt with password.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Mon, 29 May 2017 06:43:14 +0000 (08:43 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc: mention RSA-PSS-SHA* signature algorithms
Nikos Mavrogiannopoulos [Mon, 29 May 2017 06:37:03 +0000 (08:37 +0200)] 
doc: mention RSA-PSS-SHA* signature algorithms

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: replaced rsa-pss-sign with sign-params option
Nikos Mavrogiannopoulos [Mon, 29 May 2017 06:33:44 +0000 (08:33 +0200)] 
certtool: replaced rsa-pss-sign with sign-params option

This option could accomodate future enhancements/additions in
certificate signining.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: better documentation on rsa-pss-sign
Nikos Mavrogiannopoulos [Mon, 29 May 2017 06:26:41 +0000 (08:26 +0200)] 
certtool: better documentation on rsa-pss-sign

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoreplaced MAX_SIGNATURE_ALGORITHMS macro with MAX_ALGOS
Nikos Mavrogiannopoulos [Fri, 26 May 2017 11:30:18 +0000 (13:30 +0200)] 
replaced MAX_SIGNATURE_ALGORITHMS macro with MAX_ALGOS

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit test for gnutls_sign_supports_pk_algorithm()
Nikos Mavrogiannopoulos [Fri, 26 May 2017 11:19:08 +0000 (13:19 +0200)] 
tests: added unit test for gnutls_sign_supports_pk_algorithm()

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotls-fuzzer: ignore the incomplete RSA-PSS tests
Nikos Mavrogiannopoulos [Fri, 26 May 2017 08:44:41 +0000 (10:44 +0200)] 
tls-fuzzer: ignore the incomplete RSA-PSS tests

These tests fail because tls-fuzzer currently does not properly implement
RSA-PSS.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: verify that generated RSA-PSS keys can be read with certtool -k
Nikos Mavrogiannopoulos [Fri, 26 May 2017 08:06:34 +0000 (10:06 +0200)] 
tests: verify that generated RSA-PSS keys can be read with certtool -k

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: use PKCS#8 format for generated RSA-PSS keys
Nikos Mavrogiannopoulos [Fri, 26 May 2017 08:01:04 +0000 (10:01 +0200)] 
certtool: use PKCS#8 format for generated RSA-PSS keys

An RSA-PSS key has additional parameters which cannot be stored
in the "standard" PKCS#1 format. For that when asked to generate
an RSA-PSS key, we export to the PKCS#8 form.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc update
Nikos Mavrogiannopoulos [Fri, 26 May 2017 07:52:33 +0000 (09:52 +0200)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: x509sign-verify: include ECDSA and RSA-PSS key tests
Nikos Mavrogiannopoulos [Fri, 26 May 2017 06:57:11 +0000 (08:57 +0200)] 
tests: x509sign-verify: include ECDSA and RSA-PSS key tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: the test-certificate-verify-malformed check now passes
Nikos Mavrogiannopoulos [Fri, 26 May 2017 06:22:07 +0000 (08:22 +0200)] 
tlsfuzzer: the test-certificate-verify-malformed check now passes

Previously it was expecting a different alert code than gnutls returned.
Now gnutls returns the expected alert code (GNUTLS_A_DECRYPT_ERROR)
on malformed signatures.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoalert: map GNUTLS_E_PK_SIG_VERIFY_FAILED to GNUTLS_A_DECRYPT_ERROR
Nikos Mavrogiannopoulos [Thu, 25 May 2017 14:35:18 +0000 (16:35 +0200)] 
alert: map GNUTLS_E_PK_SIG_VERIFY_FAILED to GNUTLS_A_DECRYPT_ERROR

This makes server respond with GNUTLS_A_DECRYPT_ERROR on malformed signatures,
which is the expected behavior. Hinted by Hubert Kario.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoIncreased the maximum number of signature algorithms
Nikos Mavrogiannopoulos [Thu, 25 May 2017 14:18:25 +0000 (16:18 +0200)] 
Increased the maximum number of signature algorithms

That allows including all the existing signatures including DSA.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agox509sign-verify: corrected test to perform RSA tests on RSA keys
Nikos Mavrogiannopoulos [Thu, 25 May 2017 12:30:17 +0000 (14:30 +0200)] 
x509sign-verify: corrected test to perform RSA tests on RSA keys

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added tests for RSA-PSS key exchange under TLS 1.2
Nikos Mavrogiannopoulos [Thu, 25 May 2017 12:01:53 +0000 (14:01 +0200)] 
tests: added tests for RSA-PSS key exchange under TLS 1.2

That includes tests with RSA and RSA-PSS server and client certificates.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopublickey: map RSA ciphersuites to GNUTLS_PK_RSA_PSS
Nikos Mavrogiannopoulos [Thu, 25 May 2017 12:53:43 +0000 (14:53 +0200)] 
publickey: map RSA ciphersuites to GNUTLS_PK_RSA_PSS

That is in addition to GNUTLS_PK_RSA

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoRework KX -> PK mappings
Dmitry Eremin-Solenikov [Wed, 30 Nov 2016 03:40:39 +0000 (06:40 +0300)] 
Rework KX -> PK mappings

GOST VKO and PSS keys would support several public keys, so change
the previous 1:1 kx->pk mapping into 1:many.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added TLS 1.2 tests with RSA-PSS signatures on RSA certificates
Nikos Mavrogiannopoulos [Thu, 25 May 2017 10:45:08 +0000 (12:45 +0200)] 
tests: added TLS 1.2 tests with RSA-PSS signatures on RSA certificates

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_privkey_sign_hash: use the GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS flag
Nikos Mavrogiannopoulos [Thu, 25 May 2017 09:50:38 +0000 (11:50 +0200)] 
gnutls_privkey_sign_hash: use the GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS flag

That is, the privkey_sign_hash() function was made static (no users other
than the same file), and gnutls_privkey_sign_hash will take into account
the GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS, if specified.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotls-sig: sign with RSA-PSS when requested by negotiated signature algorithm
Nikos Mavrogiannopoulos [Thu, 25 May 2017 09:33:49 +0000 (11:33 +0200)] 
tls-sig: sign with RSA-PSS when requested by negotiated signature algorithm

That is, when signing a TLS message, take into account the
negotiated signature algorithm, in addition to the hash algorithm
to decide which flags to pass to gnutls_privkey_sign_hash(). This
allows signing the handshake messages with RSA-PSS even when an RSA
key is present.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopriority: enabled RSA-PSS signatures by default
Nikos Mavrogiannopoulos [Thu, 25 May 2017 09:19:12 +0000 (11:19 +0200)] 
priority: enabled RSA-PSS signatures by default

They are prioritized low on the list to reduce compatibility
issues in case they are wrongly implemented in gnutls or in the
peer implementation. To be revised when more elaborate compatibility
tests are made.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoext/signature: accept compatible algorithms with PK
Nikos Mavrogiannopoulos [Thu, 25 May 2017 09:13:23 +0000 (11:13 +0200)] 
ext/signature: accept compatible algorithms with PK

That is instead of using a 1-1 mapping of signature algorithms
to public key algorithms, use gnutls_sign_supports_pk_algorithm()
to determine whether algorithms match. That way we can allow
GNUTLS_SIGN_RSA_PSS_SHA256 under GNUTLS_PK_RSA and GNUTLS_PK_RSA_PSS
keys.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_pubkey_verify_hash2: corrected operation with RSA-PSS keys
Nikos Mavrogiannopoulos [Thu, 25 May 2017 09:12:33 +0000 (11:12 +0200)] 
gnutls_pubkey_verify_hash2: corrected operation with RSA-PSS keys

That is, do not check the flag GNUTLS_VERIFY_USE_RSA_PSS, as we
already have enough information to determine whether an RSA-PSS
signature is used (the sign algorithm). Also return the code
GNUTLS_E_INCOMPATIBLE_SIG_WITH_KEY when a signature algorithm
incompatible with the public key is encountered.

In addition, fixed few misplacements of GNUTLS_PK_RSA_PSS in switch
cases.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoIntroduced gnutls_sign_supports_pk_algorithm()
Nikos Mavrogiannopoulos [Thu, 25 May 2017 08:48:30 +0000 (10:48 +0200)] 
Introduced gnutls_sign_supports_pk_algorithm()

This function allows to test whether a combination of public key
algorithm and signature algorithm are supported. This is introduced
for RSA-PSS signatures which can be generated by a GNUTLS_PK_RSA key
or by a GNUTLS_PK_RSA_PSS key.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agox509: implement RSA-PSS signature scheme
Daiki Ueno [Thu, 16 Mar 2017 10:38:58 +0000 (11:38 +0100)] 
x509: implement RSA-PSS signature scheme

This patch enables RSA-PSS signature scheme in the X.509 functions and
certtool.

When creating RSA-PSS signature, there are 3 different scenarios:

a. both a private key and a certificate are RSA-PSS
b. the private key is RSA, while the certificate is RSA-PSS
c. both the private key and the certificate are RSA

For (a) and (b), the RSA-PSS parameters are read from the certificate.
Any conflicts in parameters between the private key and the certificate
are reported as an error.

For (c), the sign functions, such as gnutls_x509_crt_privkey_sign() or
gnutls_privkey_sign_data(), shall be instructed to generate an RSA-PSS
signature.  This can be done with the new flag
GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS.

Verification is similar to signing, except for the case (c), use the
flag GNUTLS_VERIFY_USE_RSA_PSS instead of
GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS.

From the command line, certtool has a couple of new options: --rsa-pss
and --rsa-pss-sign.  The --rsa-pss option indicates that the generated
private key or certificate is restricted to RSA-PSS, while the
--rsa-pss-sign option indicates that the generated certificate is signed
with RSA-PSS.

For simplicity, there is no means of choosing arbitrary salt length.
When it is not given by a private key or a certificate, it is
automatically calculated from the underlying hash algorithm and the
RSA modulus bits.

[minor naming changes by nmav]

Signed-off-by: Daiki Ueno <dueno@redhat.com>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agofuzz: added RSA-PSS certificate
Nikos Mavrogiannopoulos [Thu, 25 May 2017 08:19:22 +0000 (10:19 +0200)] 
fuzz: added RSA-PSS certificate

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agobuild: import files from Nettle for RSA-PSS
Daiki Ueno [Fri, 31 Mar 2017 12:36:46 +0000 (14:36 +0200)] 
build: import files from Nettle for RSA-PSS

Signed-off-by: Daiki Ueno <dueno@redhat.com>
9 years agolibtasn1: updated to 4.11
Nikos Mavrogiannopoulos [Sat, 27 May 2017 05:29:44 +0000 (07:29 +0200)] 
libtasn1: updated to 4.11

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Thu, 25 May 2017 13:10:17 +0000 (15:10 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit tests for gnutls_de/encode_rs_value
Nikos Mavrogiannopoulos [Thu, 25 May 2017 07:39:10 +0000 (09:39 +0200)] 
tests: added unit tests for gnutls_de/encode_rs_value

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopk: exported gnutls_decode_rs_value() and gnutls_encode_rs_value()
Nikos Mavrogiannopoulos [Thu, 25 May 2017 06:38:43 +0000 (08:38 +0200)] 
pk: exported gnutls_decode_rs_value() and gnutls_encode_rs_value()

These functions allow encoding to and from a Dss-Sig-Value.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: skip x86-specific tests when not in x86
Nikos Mavrogiannopoulos [Fri, 26 May 2017 10:43:21 +0000 (12:43 +0200)] 
tests: skip x86-specific tests when not in x86

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Fri, 26 May 2017 08:56:30 +0000 (10:56 +0200)] 
updated auto-generated files

9 years agotests: tls-fuzzer: corrected unlocking at tls-fuzzer-cert.sh
Nikos Mavrogiannopoulos [Fri, 26 May 2017 08:18:09 +0000 (10:18 +0200)] 
tests: tls-fuzzer: corrected unlocking at tls-fuzzer-cert.sh

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoexamples: made a comment that getpass() output needs to be sanitized
Nikos Mavrogiannopoulos [Fri, 26 May 2017 08:42:28 +0000 (10:42 +0200)] 
examples: made a comment that getpass() output needs to be sanitized

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: avoid printing legacy options in --help
Nikos Mavrogiannopoulos [Fri, 26 May 2017 08:13:05 +0000 (10:13 +0200)] 
certtool: avoid printing legacy options in --help

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoMakefile: improved code coverage extraction from lcov output
Nikos Mavrogiannopoulos [Wed, 24 May 2017 15:34:31 +0000 (17:34 +0200)] 
Makefile: improved code coverage extraction from lcov output

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoconfigure: warn when building as static library [ci skip]
Nikos Mavrogiannopoulos [Wed, 24 May 2017 13:48:31 +0000 (15:48 +0200)] 
configure: warn when building as static library [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_ocsp_status_request_enable_client: removed support for problematic parameters
Nikos Mavrogiannopoulos [Wed, 24 May 2017 12:01:56 +0000 (14:01 +0200)] 
gnutls_ocsp_status_request_enable_client: removed support for problematic parameters

Removed support for responder_id and extensions parameters. These
had very difficult semantics to use and the underlying implementation
had encoding errors, meaning there was no interoperation with other
clients. Given that issue it means there are no applications depending on
these parameters; ignore these parameters completely and no longer send
either responder_id or extensions.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_ocsp_status_request_enable_client: documented requirements for parameters
Nikos Mavrogiannopoulos [Wed, 24 May 2017 09:48:24 +0000 (11:48 +0200)] 
gnutls_ocsp_status_request_enable_client: documented requirements for parameters

That is, the fact that extensions and responder_id parameters must be
allocated, and are assigned to the session.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoext/status_request: Removed the parsing of responder IDs from client extension
Nikos Mavrogiannopoulos [Wed, 24 May 2017 09:38:16 +0000 (11:38 +0200)] 
ext/status_request: Removed the parsing of responder IDs from client extension

These values were never used by gnutls, nor were accessible to applications,
and as such there is not reason to parse them.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoext/status_request: ensure response IDs are properly deinitialized
Nikos Mavrogiannopoulos [Wed, 24 May 2017 08:46:03 +0000 (10:46 +0200)] 
ext/status_request: ensure response IDs are properly deinitialized

That is, do not attempt to loop through the array if there is no array
allocated.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: enabled ocsp stapling test
Nikos Mavrogiannopoulos [Wed, 24 May 2017 08:28:28 +0000 (10:28 +0200)] 
tlsfuzzer: enabled ocsp stapling test

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: updated to latest version
Nikos Mavrogiannopoulos [Wed, 24 May 2017 08:17:09 +0000 (10:17 +0200)] 
tlsfuzzer: updated to latest version

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoself-tests: limit compatibility API checks to vectors with plaintext
Nikos Mavrogiannopoulos [Tue, 23 May 2017 07:26:10 +0000 (09:26 +0200)] 
self-tests: limit compatibility API checks to vectors with plaintext

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotests: on cipher override do not run the compatibility checks
Nikos Mavrogiannopoulos [Mon, 22 May 2017 14:43:38 +0000 (16:43 +0200)] 
tests: on cipher override do not run the compatibility checks

That is, because we introduce a cipher using the new AEAD API which
does not provide compatibility hooks.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoself-tests: introduced flag GNUTLS_SELF_TEST_FLAG_NO_COMPAT
Nikos Mavrogiannopoulos [Mon, 22 May 2017 14:41:48 +0000 (16:41 +0200)] 
self-tests: introduced flag GNUTLS_SELF_TEST_FLAG_NO_COMPAT

This allows skipping the compatibility APIs when running self tests.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoself-tests: all parameter was replaced by flags
Nikos Mavrogiannopoulos [Mon, 22 May 2017 14:39:14 +0000 (16:39 +0200)] 
self-tests: all parameter was replaced by flags

This allows to introduce more options than just check all
ciphers.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoaarch64: fix AES-GCM in-place encryption and decryption
Nikos Mavrogiannopoulos [Mon, 22 May 2017 12:41:56 +0000 (14:41 +0200)] 
aarch64: fix AES-GCM in-place encryption and decryption

Resolves #204

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocrypto: self-tests: enhance to include compatibility APIs
Nikos Mavrogiannopoulos [Mon, 22 May 2017 09:54:25 +0000 (11:54 +0200)] 
crypto: self-tests: enhance to include compatibility APIs

That is, run the compatibility gnutls_cipher_* APIs on self tests
for AEAD ciphers in addition to the AEAD API.

Relates #204

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