]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
9 years ago_gnutls_privkey_update_spki_params: use GNUTLS_E_CONSTRAINT_ERROR on mismatch of...
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 13:07:42 +0000 (15:07 +0200)] 
_gnutls_privkey_update_spki_params: use GNUTLS_E_CONSTRAINT_ERROR on mismatch of hash

That is a more specific error code for hash mismatch between
public key information and signature. In addition only override
the salt size, if it is set to zero without the proper flags.

That prevents the update function from setting an invalid (lower)
than the expected size.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocert-tests: use .tmp suffix for all tests
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 13:00:17 +0000 (15:00 +0200)] 
cert-tests: use .tmp suffix for all tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: allow specifying RSA-PSS parameters for key generation
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 12:43:15 +0000 (14:43 +0200)] 
certtool: allow specifying RSA-PSS parameters for key generation

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_x509_write_rsa_pss_params: refuse to write RSA-PSS parameters we cannot use
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 12:56:36 +0000 (14:56 +0200)] 
_gnutls_x509_write_rsa_pss_params: refuse to write RSA-PSS parameters we cannot use

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: group together common options
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 12:30:03 +0000 (14:30 +0200)] 
certtool: group together common options

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: modified to account new errors
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 11:41:46 +0000 (13:41 +0200)] 
tests: modified to account new errors

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_x509_*_get_signature_algorithm: simplified error handling
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 15:58:06 +0000 (17:58 +0200)] 
gnutls_x509_*_get_signature_algorithm: simplified error handling

These functions were documented to return a negative error code
on failure, as well as GNUTLS_SIGN_UNKNOWN on unknown algorithms.
Simplify them by only returning GNUTLS_SIGN_UNKNOWN on all error
conditions.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_x509_get_signature_algorithm: return negative error code on unknown algorithm
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 11:24:52 +0000 (13:24 +0200)] 
_gnutls_x509_get_signature_algorithm: return negative error code on unknown algorithm

This allows internal callers to quickly fail on errors.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocompare_sig_algorithm: modify to work even for certs with unsupported signature algorithm
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 11:40:31 +0000 (13:40 +0200)] 
compare_sig_algorithm: modify to work even for certs with unsupported signature algorithm

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopubkey_verify_hashed_data: simplified and made static
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 07:20:22 +0000 (09:20 +0200)] 
pubkey_verify_hashed_data: simplified and made static

That also removes its ability to operate with the 'unknown'
signature algorithm, and forces the TLS 1.0 key exchange to
supply the right algorithm or flags.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopubkey_verify_data: accept signature entry instead of PK and hash
Nikos Mavrogiannopoulos [Wed, 26 Jul 2017 07:16:03 +0000 (09:16 +0200)] 
pubkey_verify_data: accept signature entry instead of PK and hash

That aligns better with current callers which know the signature
algorithm in use.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoNEWS: documented the SPKI handling functions
Nikos Mavrogiannopoulos [Thu, 27 Jul 2017 15:00:00 +0000 (17:00 +0200)] 
NEWS: documented the SPKI handling functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added RSA and RSA PSS key unit tests
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 11:42:12 +0000 (13:42 +0200)] 
tests: added RSA and RSA PSS key unit tests

That is test:
 1. Whether RSA-PSS keys will refuse to sign with incompatible signature
 2. Whether RSA-PSS public keys cannot be used for encryption
 3. Whether RSA-PSS keys cannot be used for signing with PKCS#1 1.5
 4. Whether an RSA key can be converted to an RSA-PSS one with the public APIs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: do not print error on missing RSA-PSS parameters on key
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 14:52:18 +0000 (16:52 +0200)] 
certtool: do not print error on missing RSA-PSS parameters on key

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoAdded convention for missing SubjectPublicKeyInfo params field
Nikos Mavrogiannopoulos [Thu, 27 Jul 2017 14:53:57 +0000 (16:53 +0200)] 
Added convention for missing SubjectPublicKeyInfo params field

That is, when that field is missing, the spki_st structure field
pk will be set to GNUTLS_PK_UNKNOWN. In that case other fields
are undefined.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago*set_spki(): return error on incompatible algorithms
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 12:01:48 +0000 (14:01 +0200)] 
*set_spki(): return error on incompatible algorithms

In addition update the public key algorithm field in the
respective structure.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_x509_privkey_generate2: do not hardcode the RSA-PSS hash to SHA256
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 14:33:26 +0000 (16:33 +0200)] 
gnutls_x509_privkey_generate2: do not hardcode the RSA-PSS hash to SHA256

Instead use _gnutls_pk_bits_to_sha_hash() to set an appropriate hash
for the number of bits of the key. This matches better the "intention"
of RSA-PSS or tying the security parameter with the salt and hash.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_decode_pkcs8_rsa_pss_key: ensure we set the PSS PK identifier
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 12:14:49 +0000 (14:14 +0200)] 
_decode_pkcs8_rsa_pss_key: ensure we set the PSS PK identifier

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocleanup: removed duplicate parameter in gnutls_pubkey_st
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 11:38:34 +0000 (13:38 +0200)] 
cleanup: removed duplicate parameter in gnutls_pubkey_st

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_x509_privkey_int: eliminated duplicate pk_algorithm field
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 11:28:44 +0000 (13:28 +0200)] 
gnutls_x509_privkey_int: eliminated duplicate pk_algorithm field

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocleanup: removed unnecessary/duplicate parameters in _dsa_q_to_hash
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 11:34:50 +0000 (13:34 +0200)] 
cleanup: removed unnecessary/duplicate parameters in _dsa_q_to_hash

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocleanup: removed unnecessary/duplicate parameters in functions
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 11:18:05 +0000 (13:18 +0200)] 
cleanup: removed unnecessary/duplicate parameters in functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocleanup: removed unnecessary/duplicate parameters in functions
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 11:12:19 +0000 (13:12 +0200)] 
cleanup: removed unnecessary/duplicate parameters in functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoabstract.h: added functions to read and write SPKI information
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 10:01:52 +0000 (12:01 +0200)] 
abstract.h: added functions to read and write SPKI information

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_x509_privkey_set_spki: introduced function to update SPKI on a key
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 09:48:58 +0000 (11:48 +0200)] 
gnutls_x509_privkey_set_spki: introduced function to update SPKI on a key

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit test for the SPKI related functions
Nikos Mavrogiannopoulos [Mon, 24 Jul 2017 14:35:50 +0000 (16:35 +0200)] 
tests: added unit test for the SPKI related functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agox509.h: Renamed SPKI related functions
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 09:37:04 +0000 (11:37 +0200)] 
x509.h: Renamed SPKI related functions

This better reflects their purpose as providers of information
for subject public key. In addition use 'const' for fields that
should be left intact.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: introduced RSA-PSS key exchange with a key fixed to rsa-pss with sha256
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 07:43:05 +0000 (09:43 +0200)] 
tests: introduced RSA-PSS key exchange with a key fixed to rsa-pss with sha256

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_pubkey_compatible_with_sig: enforce RSA-PSS requirements
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 08:06:10 +0000 (10:06 +0200)] 
_gnutls_pubkey_compatible_with_sig: enforce RSA-PSS requirements

That is require that parameters in an RSA-PSS key which has them
explicitly set, are respected with regards to signature algorithm
negotiation.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: eagain-common.h: remove superfluous information
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 07:39:32 +0000 (09:39 +0200)] 
tests: eagain-common.h: remove superfluous information

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: renamed tests for uniformity
Nikos Mavrogiannopoulos [Wed, 12 Jul 2017 06:49:30 +0000 (08:49 +0200)] 
tests: renamed tests for uniformity

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit test for RSA-PSS signing over PKCS#11
Nikos Mavrogiannopoulos [Mon, 24 Jul 2017 14:15:15 +0000 (16:15 +0200)] 
tests: added unit test for RSA-PSS signing over PKCS#11

This requires a softhsm with support for RSA_PKCS_PSS mechanism.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_pubkey_verify*: use common function to set RSA-PSS parameters
Nikos Mavrogiannopoulos [Mon, 24 Jul 2017 14:05:36 +0000 (16:05 +0200)] 
gnutls_pubkey_verify*: use common function to set RSA-PSS parameters

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopkcs11: added support for signatures with RSA-PSS
Nikos Mavrogiannopoulos [Mon, 24 Jul 2017 09:21:34 +0000 (11:21 +0200)] 
pkcs11: added support for signatures with RSA-PSS

Relates #209

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_pk_params_st: renamed sign field to spki
Nikos Mavrogiannopoulos [Tue, 25 Jul 2017 08:16:40 +0000 (10:16 +0200)] 
gnutls_pk_params_st: renamed sign field to spki

The name "sign" was ambiguous with regard to its intented
use, as it could refer to digital signature parameters
which was not exactly the case. That field contains parameters
present in the subject public key info (SPKI), which could
be used in a digital signature, but not necessarily.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoClarified the purpose of the spki params related functions
Nikos Mavrogiannopoulos [Mon, 24 Jul 2017 08:12:54 +0000 (10:12 +0200)] 
Clarified the purpose of the spki params related functions

_gnutls_privkey_get_sign_params was renamed to _gnutls_privkey_get_spki_params,
_gnutls_privkey_update_sign_params to _gnutls_privkey_update_spki_params,
and the dig entry of gnutls_x509_spki_st was renamed to rsa_pss_dig.

The reason is that there could be a confusion on the purpose of
the 'dig' entry, as it could be assumed to be the signature's hash
algorithm in the general case. That could not be because the SPKI
parameters do not contain it for any other algorithm than RSA-PSS.
As such, make a logical separation from SPKI reading functions
with the signature reading functions and try to use the
gnutls_sign_entry_st when signature information is required.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoPass the signature algorithm lower in the verification stack
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 21:56:20 +0000 (23:56 +0200)] 
Pass the signature algorithm lower in the verification stack

This will allow enhancing the back-ends (PKCS#11 and ext) for
signing with the new signature algorithms like RSA-PSS and Ed25519.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agofuzz: introduced mem.h with common callbacks for mem access
Nikos Mavrogiannopoulos [Thu, 3 Aug 2017 05:46:11 +0000 (07:46 +0200)] 
fuzz: introduced mem.h with common callbacks for mem access

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Thu, 3 Aug 2017 05:38:13 +0000 (07:38 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agofuzz: added SRP server and client fuzzers
Nikos Mavrogiannopoulos [Mon, 31 Jul 2017 08:50:52 +0000 (10:50 +0200)] 
fuzz: added SRP server and client fuzzers

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agofuzz: introduced psk.h common header
Nikos Mavrogiannopoulos [Sun, 30 Jul 2017 01:01:08 +0000 (03:01 +0200)] 
fuzz: introduced psk.h common header

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agofuzz: added PSK server fuzzer
Nikos Mavrogiannopoulos [Sun, 30 Jul 2017 00:48:11 +0000 (02:48 +0200)] 
fuzz: added PSK server fuzzer

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agofuzz: added PSK client fuzzer
Nikos Mavrogiannopoulos [Sun, 30 Jul 2017 00:30:43 +0000 (02:30 +0200)] 
fuzz: added PSK client fuzzer

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agognutls-cli: introduced options to save client and server traces
Nikos Mavrogiannopoulos [Sun, 30 Jul 2017 00:12:19 +0000 (02:12 +0200)] 
gnutls-cli: introduced options to save client and server traces

This allows to easier obtain traces for use in fuzzers.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agofuzz: ported libidn2's main.c taking advantage of afl-clang-fast
Nikos Mavrogiannopoulos [Sat, 29 Jul 2017 23:45:22 +0000 (01:45 +0200)] 
fuzz: ported libidn2's main.c taking advantage of afl-clang-fast

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agognutls_system_recv_timeout: doc update
Nikos Mavrogiannopoulos [Sat, 29 Jul 2017 23:55:43 +0000 (01:55 +0200)] 
gnutls_system_recv_timeout: doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotlsfuzzer: enabled EC tests for x25519
Nikos Mavrogiannopoulos [Wed, 2 Aug 2017 18:52:57 +0000 (20:52 +0200)] 
tlsfuzzer: enabled EC tests for x25519

That includes tests for default curve.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotlsfuzzer: enabled test for ECDHE without the supported groups/EC extension
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 13:18:38 +0000 (15:18 +0200)] 
tlsfuzzer: enabled test for ECDHE without the supported groups/EC extension

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoSet a default supported curve
Nikos Mavrogiannopoulos [Wed, 2 Aug 2017 15:25:17 +0000 (17:25 +0200)] 
Set a default supported curve

RFC4492 and draft-ietf-tls-rfc4492bis-17 mention:
"A client that proposes ECC cipher suites may choose not to include these
extensions.  In this case, the server is free to choose any one of
the elliptic curves or point formats listed in Section 5."

As such, we set a default curve to be used in the case the
server encounters a handshake with no supported groups/curves
extension.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: removed duplicate tests
Nikos Mavrogiannopoulos [Wed, 2 Aug 2017 10:58:48 +0000 (12:58 +0200)] 
tlsfuzzer: removed duplicate tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: fixed comment fields
Nikos Mavrogiannopoulos [Wed, 2 Aug 2017 10:55:24 +0000 (12:55 +0200)] 
tlsfuzzer: fixed comment fields

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc update
Nikos Mavrogiannopoulos [Tue, 11 Jul 2017 06:02:56 +0000 (08:02 +0200)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Mon, 24 Jul 2017 06:39:00 +0000 (08:39 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls-cli: use FFDHE3072 parameters for benchmarking
Nikos Mavrogiannopoulos [Tue, 18 Jul 2017 06:13:00 +0000 (08:13 +0200)] 
gnutls-cli: use FFDHE3072 parameters for benchmarking

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_figure_dh_params: do not use have_ffdhe flag
Nikos Mavrogiannopoulos [Tue, 1 Aug 2017 08:21:37 +0000 (10:21 +0200)] 
_gnutls_figure_dh_params: do not use have_ffdhe flag

This flag is intended to indicate whether the peer has advertized
at least one FFDHE group, and not whether we have negotiated FFDHE.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit test for group listings in priority structure
Nikos Mavrogiannopoulos [Mon, 10 Jul 2017 10:23:55 +0000 (12:23 +0200)] 
tests: added unit test for group listings in priority structure

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: updated cipher-listings.sh for the new groups listing
Nikos Mavrogiannopoulos [Mon, 10 Jul 2017 10:05:01 +0000 (12:05 +0200)] 
tests: updated cipher-listings.sh for the new groups listing

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc: documented the use of RFC7919 and groups
Nikos Mavrogiannopoulos [Mon, 10 Jul 2017 09:46:03 +0000 (11:46 +0200)] 
doc: documented the use of RFC7919 and groups

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: enabled RFC7919 FFDHE tests
Nikos Mavrogiannopoulos [Mon, 3 Jul 2017 08:44:14 +0000 (10:44 +0200)] 
tlsfuzzer: enabled RFC7919 FFDHE tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: enhanced server key exchange tests with explicit DH param setting
Nikos Mavrogiannopoulos [Mon, 3 Jul 2017 07:09:27 +0000 (09:09 +0200)] 
tests: enhanced server key exchange tests with explicit DH param setting

That is, not only check the DH parameter setting using the known_dh_params()
functions, but also with the explicit setting --set_server_dh_params().

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: updated for post-RFC7919 behavior of library
Nikos Mavrogiannopoulos [Fri, 30 Jun 2017 14:17:12 +0000 (16:17 +0200)] 
tests: updated for post-RFC7919 behavior of library

That is, it is no longer necessary to set DH parameters on a
credentials structure, and thus previously expected to fail
connections may succeed even without DH parameters.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added RFC7919 FFDHE unit tests
Nikos Mavrogiannopoulos [Fri, 30 Jun 2017 13:54:27 +0000 (15:54 +0200)] 
tests: added RFC7919 FFDHE unit tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocli,serv: do not print any information on compression
Nikos Mavrogiannopoulos [Fri, 30 Jun 2017 13:37:00 +0000 (15:37 +0200)] 
cli,serv: do not print any information on compression

Compression is always NULL.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocli,serv: no longer print parameters when FFDHE groups are used
Nikos Mavrogiannopoulos [Fri, 30 Jun 2017 13:32:58 +0000 (15:32 +0200)] 
cli,serv: no longer print parameters when FFDHE groups are used

The negotiated RFC7919 group is now printed as part of the Description string,
and there is no reason to print more information on parameters defined by
the protocol.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls-cli: print the supported groups instead of curves
Nikos Mavrogiannopoulos [Mon, 10 Jul 2017 09:57:51 +0000 (11:57 +0200)] 
gnutls-cli: print the supported groups instead of curves

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_priority_ecc_curve_list: avoid including groups into elliptic curves list
Nikos Mavrogiannopoulos [Mon, 10 Jul 2017 10:02:13 +0000 (12:02 +0200)] 
gnutls_priority_ecc_curve_list: avoid including groups into elliptic curves list

This provides a mostly-compatible behavior of gnutls_priority_ecc_curve_list()
in order to avoid keeping additional information for elliptic curves in the
priority cache. This approach will always return the supported curves, if the set
groups are prioritized with the elliptic curve variants set first. This
is the default in the built-in priorities, and to most common setups.

Items which are non-valid curves will not be returned.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agohandshake: moved group negotiation after ciphersuite selection
Nikos Mavrogiannopoulos [Wed, 2 Aug 2017 06:42:37 +0000 (08:42 +0200)] 
handshake: moved group negotiation after ciphersuite selection

This allows to cope with situations where the peer prioritizes a
supported group which doesn't map to a supported ciphersuite.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agosecurity_parameters: ease access to group information by keeping pointer to it
Nikos Mavrogiannopoulos [Fri, 14 Jul 2017 08:35:58 +0000 (10:35 +0200)] 
security_parameters: ease access to group information by keeping pointer to it

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agosecurity_parameters: simplified contents by keeping pointer to cipher_suite_entry_st
Nikos Mavrogiannopoulos [Fri, 14 Jul 2017 08:15:23 +0000 (10:15 +0200)] 
security_parameters: simplified contents by keeping pointer to cipher_suite_entry_st

That, in addition to simplifying the contents, it allows faster access
to ciphersuite's properties.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoTLS: introduced support for RFC7919 groups
Nikos Mavrogiannopoulos [Tue, 27 Jun 2017 13:36:04 +0000 (15:36 +0200)] 
TLS: introduced support for RFC7919 groups

That replaces the EC curve extension negotiation with
the negotiated groups extensions, introduces handling
for groups as priority strings, as well as using and
checking of RFC7919 DH parameters once negotiated.

Resolves: #37

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 14:03:35 +0000 (16:03 +0200)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls-cli: use gnutls_priority_set
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 12:21:32 +0000 (14:21 +0200)] 
gnutls-cli: use gnutls_priority_set

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: modified gnutls_priority_set2() tests for gnutls_priority_set()
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 12:20:26 +0000 (14:20 +0200)] 
tests: modified gnutls_priority_set2() tests for gnutls_priority_set()

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_priority_set: use reference counting
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 10:09:49 +0000 (12:09 +0200)] 
gnutls_priority_set: use reference counting

That eliminates the need for gnutls_priority_set2() which is now
removed.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoIntroduced atomic.h to simplify handling of atomic integers
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 09:43:27 +0000 (11:43 +0200)] 
Introduced atomic.h to simplify handling of atomic integers

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoRevert "Documented use gnutls_priority_set2()."
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 09:22:31 +0000 (11:22 +0200)] 
Revert "Documented use gnutls_priority_set2()."

This reverts commit b4aed16ee30f76211c13b075149bb87c012f9bf6.

9 years agotlsfuzzer: enabled test-ecdsa-sig-flexibility.py
Nikos Mavrogiannopoulos [Fri, 21 Jul 2017 08:54:13 +0000 (10:54 +0200)] 
tlsfuzzer: enabled test-ecdsa-sig-flexibility.py

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

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc update
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 12:48:33 +0000 (14:48 +0200)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoalgorithms/mac: marked RIPEMD160 as insecure for certificates
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 12:43:20 +0000 (14:43 +0200)] 
algorithms/mac: marked RIPEMD160 as insecure for certificates

This is an algorithm which is not really used in Internet PKI
and due to that has seen no public cryptanalysis. As such
we disable it for certificate verification to prevent it from
being used as an attack vector.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: partially reverted SHA1 broken tests
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 11:26:46 +0000 (13:26 +0200)] 
tests: partially reverted SHA1 broken tests

SHA1 is now considered broken only for certificates, hence
OCSP or raw signing tests no longer need to use GNUTLS_VERIFY_ALLOW_BROKEN
in the cases where certificate verification is not performed.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agox509/verify: reject SHA1 in signature algorithms for certificate verification
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 11:18:10 +0000 (13:18 +0200)] 
x509/verify: reject SHA1 in signature algorithms for certificate verification

That is, we now use gnutls_sign_is_secure2() with GNUTLS_SIGN_FLAG_SECURE_FOR_CERTS
flag for checking the validity of the signature algorithm, when
verifying signatures in certificates.

Resolves #229

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit tests for gnutls_sign_is_secure2()
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 11:16:07 +0000 (13:16 +0200)] 
tests: added unit tests for gnutls_sign_is_secure2()

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_sign_is_secure2: introduced
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 10:41:47 +0000 (12:41 +0200)] 
gnutls_sign_is_secure2: introduced

This function exports the ability to check the validity of
a signature algorithm for signing certificates.

That also introduces the flag GNUTLS_SIGN_FLAG_SECURE_FOR_CERTS
which when specified will cause the function to return whether
the algorithm is secure for signing certificates.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_digest_is_secure_for_certs: introduced
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 10:40:34 +0000 (12:40 +0200)] 
_gnutls_digest_is_secure_for_certs: introduced

This is a macro to allow checking the security of a hash algorithm
with respect to signing certificates.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agomac: re-organized the hash algorithms table
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 10:17:40 +0000 (12:17 +0200)] 
mac: re-organized the hash algorithms table

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added reproducer with ed25519 private key
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 14:28:15 +0000 (16:28 +0200)] 
tests: added reproducer with ed25519 private key

Found with oss-fuzz:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2689

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoEnsure that public key parameters are initialized on import
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 14:43:18 +0000 (16:43 +0200)] 
Ensure that public key parameters are initialized on import

Previously we depended on initialization during the _init()
call, however, there can be cases where this re-initialization
is needed (e.g., on multiple tries to load a key).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_decode_pkcs8_eddsa_key: ensure that the key size read matches the curve size
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 14:49:11 +0000 (16:49 +0200)] 
_decode_pkcs8_eddsa_key: ensure that the key size read matches the curve size

That is, in the newly introduced ed25519 keys we didn't check
whether the input size in the PKCS#8 file matched the curve
size.

Found using oss-fuzz:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2689

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: enabled SNI and other tests from master
Nikos Mavrogiannopoulos [Tue, 18 Jul 2017 14:40:11 +0000 (16:40 +0200)] 
tlsfuzzer: enabled SNI and other tests from master

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: updated to reflect the fact that invalid dns names are rejected
Nikos Mavrogiannopoulos [Thu, 20 Jul 2017 06:22:10 +0000 (08:22 +0200)] 
tests: updated to reflect the fact that invalid dns names are rejected

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoserver_name: several simplifications of the code base
Nikos Mavrogiannopoulos [Tue, 18 Jul 2017 14:32:07 +0000 (16:32 +0200)] 
server_name: several simplifications of the code base

The existing code was written with the intention of supporting multiple
server names, however that was never happened, and this extension is
currently only used for DNS server names. Remove unneeded extensibility.

In addition, removed conversion of client provided server name (DNS) to
IDNA. Clients not providing valid names are violating the spec and
that conversion step not only wastes resources, but increases
the attack surface of a server.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoserver_name: be strict in decoding errors
Nikos Mavrogiannopoulos [Tue, 18 Jul 2017 14:11:05 +0000 (16:11 +0200)] 
server_name: be strict in decoding errors

That is, return error when a malformed extension is seen.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: enabled RSA-PSS checks on certificate verify
Nikos Mavrogiannopoulos [Tue, 18 Jul 2017 09:23:11 +0000 (11:23 +0200)] 
tlsfuzzer: enabled RSA-PSS checks on certificate verify

Relates: #208

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotlsfuzzer: enabled test-extended-master-secret-extension.py
Nikos Mavrogiannopoulos [Tue, 18 Jul 2017 09:16:09 +0000 (11:16 +0200)] 
tlsfuzzer: enabled test-extended-master-secret-extension.py

That allows testing the extended master secret behavior.

Resolves: #231

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoext_master_secret: return proper error code on decoding error
Nikos Mavrogiannopoulos [Tue, 18 Jul 2017 08:59:23 +0000 (10:59 +0200)] 
ext_master_secret: return proper error code on decoding error

Proper meaning that it maps to the alert 'decode error' rather
than illegal parameter. According to tlsfuzzer the former is more
suitable.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls-cli: re-use priorities for both client and server on benchmarks
Nikos Mavrogiannopoulos [Tue, 18 Jul 2017 06:07:24 +0000 (08:07 +0200)] 
gnutls-cli: re-use priorities for both client and server on benchmarks

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls-cli: re-use priorities when measuring performance
Nikos Mavrogiannopoulos [Mon, 17 Jul 2017 17:14:33 +0000 (19:14 +0200)] 
gnutls-cli: re-use priorities when measuring performance

This avoids measuring cache misses due to priority processing time.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotests: enhanced SSL3.0 openssl detection in testcompat-openssl
Nikos Mavrogiannopoulos [Mon, 17 Jul 2017 12:06:50 +0000 (14:06 +0200)] 
tests: enhanced SSL3.0 openssl detection in testcompat-openssl

That disables SSL 3.0 testing in openssl versions which cannot negotiated
it (see https://bugzilla.redhat.com/show_bug.cgi?id=1471783 for rationale)
and corrects a typo in the variable name and printed message.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago.gitlab-ci.yml: document that the x86 build is our openssl 1.0.x compat testing as...
Nikos Mavrogiannopoulos [Mon, 17 Jul 2017 09:57:41 +0000 (11:57 +0200)] 
.gitlab-ci.yml: document that the x86 build is our openssl 1.0.x compat testing as well

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