]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
9 years agofuzz: documented location for OCSP-related reproducers
Nikos Mavrogiannopoulos [Thu, 15 Jun 2017 11:14:23 +0000 (13:14 +0200)] 
fuzz: documented location for OCSP-related reproducers

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoocsp: added sanity check in returned length
Nikos Mavrogiannopoulos [Thu, 15 Jun 2017 10:43:48 +0000 (12:43 +0200)] 
ocsp: added sanity check in returned length

This addresses:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1492

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc: added/modernized text on AEAD ciphers [ci skip]
Nikos Mavrogiannopoulos [Thu, 15 Jun 2017 08:37:53 +0000 (10:37 +0200)] 
doc: added/modernized text on AEAD ciphers [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc update
Nikos Mavrogiannopoulos [Thu, 15 Jun 2017 07:09:20 +0000 (09:09 +0200)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: improved duplicate extension test
Nikos Mavrogiannopoulos [Thu, 15 Jun 2017 07:06:49 +0000 (09:06 +0200)] 
tests: improved duplicate extension test

Instead of sending two duplicate extensions of which one is invalid,
send two valid ones instead. That way, we avoid the possibility of false
positives due to the validation code of the extension contents.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: verify that duplicate extensions are rejected
Nikos Mavrogiannopoulos [Wed, 14 Jun 2017 12:15:08 +0000 (14:15 +0200)] 
tests: verify that duplicate extensions are rejected

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoTLS extensions: added duplicate extension check on server side
Nikos Mavrogiannopoulos [Wed, 14 Jun 2017 11:09:44 +0000 (13:09 +0200)] 
TLS extensions: added duplicate extension check on server side

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_init: better naming for internal function
Nikos Mavrogiannopoulos [Wed, 14 Jun 2017 09:15:54 +0000 (11:15 +0200)] 
gnutls_init: better naming for internal function

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit test for overriding TLS extensions
Nikos Mavrogiannopoulos [Tue, 13 Jun 2017 06:08:56 +0000 (08:08 +0200)] 
tests: added unit test for overriding TLS extensions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoTLS extensions: mark each extension which cannot be overriden
Nikos Mavrogiannopoulos [Wed, 14 Jun 2017 09:11:34 +0000 (11:11 +0200)] 
TLS extensions: mark each extension which cannot be overriden

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoTLS extensions: combined the extension data and resumed data structures
Nikos Mavrogiannopoulos [Wed, 14 Jun 2017 09:02:49 +0000 (11:02 +0200)] 
TLS extensions: combined the extension data and resumed data structures

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoremoved type extension_priv_data_t
Nikos Mavrogiannopoulos [Mon, 12 Jun 2017 15:31:19 +0000 (17:31 +0200)] 
removed type extension_priv_data_t

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_int.h: groupped extension structures together
Nikos Mavrogiannopoulos [Tue, 13 Jun 2017 06:02:04 +0000 (08:02 +0200)] 
gnutls_int.h: groupped extension structures together

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoTLS extensions: several simplifications
Nikos Mavrogiannopoulos [Mon, 12 Jun 2017 12:19:23 +0000 (14:19 +0200)] 
TLS extensions: several simplifications

This allows extensions set by the application to override some
of the internal ones.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago.gitlab-ci.yml: FreeBSD system is no longer available; disabling for CI [ci skip]
Nikos Mavrogiannopoulos [Wed, 14 Jun 2017 13:53:13 +0000 (15:53 +0200)] 
.gitlab-ci.yml: FreeBSD system is no longer available; disabling for CI [ci skip]

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

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Fri, 9 Jun 2017 16:53:48 +0000 (18:53 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc: added reference to privkey export functions
Nikos Mavrogiannopoulos [Fri, 9 Jun 2017 14:37:48 +0000 (16:37 +0200)] 
doc: added reference to privkey export functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added basic unit tests for the export_*_raw2() functions
Nikos Mavrogiannopoulos [Fri, 9 Jun 2017 16:29:18 +0000 (18:29 +0200)] 
tests: added basic unit tests for the export_*_raw2() functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocorrected typo in x962 functions
Nikos Mavrogiannopoulos [Fri, 9 Jun 2017 16:17:34 +0000 (18:17 +0200)] 
corrected typo in x962 functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopkcs11: do not set leading zeros on integers
Nikos Mavrogiannopoulos [Fri, 9 Jun 2017 14:21:31 +0000 (16:21 +0200)] 
pkcs11: do not set leading zeros on integers

PKCS#11 defines integers as unsigned having most significant byte
first, e.g., 32768 = 0x80 0x00. This is interpreted literraly by
some HSMs which do not accept an integer with a leading zero.

Resolves: #215

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoIntroduced functions to export integers with no leading zero
Nikos Mavrogiannopoulos [Fri, 9 Jun 2017 14:20:05 +0000 (16:20 +0200)] 
Introduced functions to export integers with no leading zero

That is introduced the flag GNUTLS_EXPORT_FLAG_NO_LZ and:
 * gnutls_pubkey_export_rsa_raw2
 * gnutls_pubkey_export_dsa_raw2
 * gnutls_pubkey_export_ecc_raw2
 * gnutls_privkey_export_rsa_raw2
 * gnutls_privkey_export_dsa_raw2
 * gnutls_privkey_export_ecc_raw2

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agonettle: use older GMP macros for mpz_mod_2exp and mpz_div_2exp
Nikos Mavrogiannopoulos [Thu, 8 Jun 2017 13:03:17 +0000 (15:03 +0200)] 
nettle: use older GMP macros for mpz_mod_2exp and mpz_div_2exp

These ensure that compilation will succeed even when building with gmp-mini.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_ucs2_to_utf8: use void* as pointer type to avoid compiler assumptions on...
Nikos Mavrogiannopoulos [Thu, 8 Jun 2017 11:15:00 +0000 (13:15 +0200)] 
_gnutls_ucs2_to_utf8: use void* as pointer type to avoid compiler assumptions on alignment [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agociphersuites: removed unused function
Nikos Mavrogiannopoulos [Thu, 8 Jun 2017 11:06:19 +0000 (13:06 +0200)] 
ciphersuites: removed unused function

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agonettle/cipher: document that ctx_ptr is 16-byte aligned, and use void* to avoid compi...
Nikos Mavrogiannopoulos [Thu, 8 Jun 2017 11:00:25 +0000 (13:00 +0200)] 
nettle/cipher: document that ctx_ptr is 16-byte aligned, and use void* to avoid compiler assumptions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: corrected typo in strcmp() use
Nikos Mavrogiannopoulos [Thu, 8 Jun 2017 10:53:44 +0000 (12:53 +0200)] 
certtool: corrected typo in strcmp() use

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_x509_privkey_reinit: ensure fields will not be re-used
Nikos Mavrogiannopoulos [Thu, 8 Jun 2017 09:15:02 +0000 (11:15 +0200)] 
_gnutls_x509_privkey_reinit: ensure fields will not be re-used

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
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>