]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
8 years agotests: added signature tests for ECDSA-SECP256R1-SHA256
Nikos Mavrogiannopoulos [Wed, 12 Jul 2017 06:56:18 +0000 (08:56 +0200)] 
tests: added signature tests for ECDSA-SECP256R1-SHA256

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopriority: do not include signature algorithms that apply to different TLS version
Nikos Mavrogiannopoulos [Wed, 12 Jul 2017 07:19:16 +0000 (09:19 +0200)] 
priority: do not include signature algorithms that apply to different TLS version

That is, when a signature algorithm that is only applicable
to specific TLS protocol semantics (e.g., ECDSA-SECP256R1-SHA256)
is enabled, under TLS 1.2, it will result to no code points being
added. That prevents connection errors due to "wrong" code
points being added that do not correspond to a usable signature
algorithm under the protocol.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: updated for the new behavior of handshake
Nikos Mavrogiannopoulos [Tue, 11 Jul 2017 12:07:43 +0000 (14:07 +0200)] 
tests: updated for the new behavior of handshake

Previously at handshake we would negotiate a ciphersuite and certificate
and later figure out a signature algorithm. Now we negotiate all at once,
so we no longer reach situations where mid-way of handshake we figure we
have no signature algorithm to use. Update the test cases relying on that
behavior to account the new one.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopubkey: enforce TLS 1.3 signature restrictions on verification
Nikos Mavrogiannopoulos [Tue, 11 Jul 2017 09:09:51 +0000 (11:09 +0200)] 
pubkey: enforce TLS 1.3 signature restrictions on verification

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoext/signature: added TLS 1.3 signature algorithm negotiation
Nikos Mavrogiannopoulos [Mon, 10 Jul 2017 14:43:51 +0000 (16:43 +0200)] 
ext/signature: added TLS 1.3 signature algorithm negotiation

That patch adds the signature algorithms:
 - GNUTLS_SIGN_ECDSA_SECP256R1_SHA256
 - GNUTLS_SIGN_ECDSA_SECP384R1_SHA384
 - GNUTLS_SIGN_ECDSA_SECP521R1_SHA512

and enables them for the default TLS priority strings.
In addition it allows negotiating signature algorithms sharing
the same TLS IDs, but which have different semantics between TLS
versions (e.g., 6,4 maps to GNUTLS_SIGN_ECDSA_SHA512 under TLS 1.2
but to GNUTLS_SIGN_ECDSA_SECP521R1_SHA512 under TLS 1.3).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added unit test for TLS 1.3 version negotiation
Nikos Mavrogiannopoulos [Mon, 19 Jun 2017 13:20:00 +0000 (15:20 +0200)] 
tests: added unit test for TLS 1.3 version negotiation

This checks whether the Client Hello and Server Hello packets
contain the expected values.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: added support for negotiating version using extension
Nikos Mavrogiannopoulos [Mon, 19 Jun 2017 12:17:40 +0000 (14:17 +0200)] 
handshake: added support for negotiating version using extension

That is, introduced the TLS 1.3 supported_versions extension. It is currently
only being used if negotiating TLS 1.3 or later.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agohandshake: legacy version negotiation is not used for TLS 1.3
Nikos Mavrogiannopoulos [Mon, 19 Jun 2017 11:30:46 +0000 (13:30 +0200)] 
handshake: legacy version negotiation is not used for TLS 1.3

That is, ensure that the functions used for TLS 1.2 and earlier
negotiation cannot be used with TLS 1.3. That is because TLS 1.3
is negotiated using a TLS extension.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoAdded TLS 1.3 Hello message random generation
Nikos Mavrogiannopoulos [Mon, 19 Jun 2017 09:57:22 +0000 (11:57 +0200)] 
Added TLS 1.3 Hello message random generation

That is, added check for TLS 1.3 random value requirements in client side,
and generation according to TLS 1.3 requirements for server and
client side.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoRevert "priority: disable the enabled by default RSA-PSS signature algorithms"
Nikos Mavrogiannopoulos [Mon, 19 Feb 2018 13:57:55 +0000 (14:57 +0100)] 
Revert "priority: disable the enabled by default RSA-PSS signature algorithms"

This reverts commit ef44477127952c13e93d7ea88f7b549bf36602f5.

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

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agodoc update
Nikos Mavrogiannopoulos [Mon, 22 Jan 2018 10:52:19 +0000 (11:52 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: check gnutls_fips140_set_mode operation per thread
Nikos Mavrogiannopoulos [Tue, 30 Jan 2018 06:41:26 +0000 (07:41 +0100)] 
tests: check gnutls_fips140_set_mode operation per thread

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added unit test of gnutls_fips140_set_mode
Nikos Mavrogiannopoulos [Sun, 21 Jan 2018 14:49:42 +0000 (15:49 +0100)] 
tests: added unit test of gnutls_fips140_set_mode

Also ensure that 512-bit keys cannot be generated
in FIPS140-2 mode

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: gnutls_hmac_fast: explicitly enable MD5 use under FIPS140-2 mode
Nikos Mavrogiannopoulos [Mon, 22 Jan 2018 10:40:42 +0000 (11:40 +0100)] 
tests: gnutls_hmac_fast: explicitly enable MD5 use under FIPS140-2 mode

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: gc.c -> gnutls_hmac_fast.c
Nikos Mavrogiannopoulos [Thu, 21 Dec 2017 11:38:29 +0000 (12:38 +0100)] 
tests: gc.c -> gnutls_hmac_fast.c

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: documented gnutls_fips140_set_mode and gnutls_fips_mode_t
Nikos Mavrogiannopoulos [Mon, 22 Jan 2018 08:15:03 +0000 (09:15 +0100)] 
doc: documented gnutls_fips140_set_mode and gnutls_fips_mode_t

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agofips140: added function for applications to switch the FIPS140-2 mode
Nikos Mavrogiannopoulos [Sun, 21 Jan 2018 14:07:00 +0000 (15:07 +0100)] 
fips140: added function for applications to switch the FIPS140-2 mode

That would allow FIPS140-2 compliant applications to use forbidden
algorithms by switching to a lax FIPS140-2 mode.

Resolves #352
Resolves #353

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agofips140: enforcement of allowed ciphers moved to crypto-api.c and cipher_int.c
Nikos Mavrogiannopoulos [Sun, 21 Jan 2018 13:01:17 +0000 (14:01 +0100)] 
fips140: enforcement of allowed ciphers moved to crypto-api.c and cipher_int.c

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agofips140: enforcement of hash and MACs use moved to crypto-api.c and hash_int.c
Nikos Mavrogiannopoulos [Wed, 20 Dec 2017 14:36:59 +0000 (15:36 +0100)] 
fips140: enforcement of hash and MACs use moved to crypto-api.c and hash_int.c

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: srp: increased timeout to 40secs [ci skip]
Nikos Mavrogiannopoulos [Mon, 19 Feb 2018 07:38:35 +0000 (08:38 +0100)] 
tests: srp: increased timeout to 40secs [ci skip]

Since we increased the maximum parameters to 8k, ensure
that slower systems have enough time to complete the handshake.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: updates NEWS entry for 3.6.2 adding ABI changes [ci skip]
Nikos Mavrogiannopoulos [Sun, 18 Feb 2018 19:58:07 +0000 (20:58 +0100)] 
doc: updates NEWS entry for 3.6.2 adding ABI changes [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agolatex: introduced functionWarning macro
Nikos Mavrogiannopoulos [Fri, 16 Feb 2018 07:54:26 +0000 (08:54 +0100)] 
latex: introduced functionWarning macro

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agobumped version gnutls_3_6_2
Nikos Mavrogiannopoulos [Fri, 16 Feb 2018 07:27:56 +0000 (08:27 +0100)] 
bumped version

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: check whether gnutls_credentials_set() can be set in an hsk hook
Nikos Mavrogiannopoulos [Tue, 13 Feb 2018 15:34:09 +0000 (16:34 +0100)] 
tests: check whether gnutls_credentials_set() can be set in an hsk hook

This is useful when these are set during the handshake process
on the handshake hook before client hello is parsed.

Relates #382

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: documented how to set the credentials late in certain vhost scenarios
Nikos Mavrogiannopoulos [Tue, 13 Feb 2018 15:47:16 +0000 (16:47 +0100)] 
doc: documented how to set the credentials late in certain vhost scenarios

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: updated text on gnutls_handshake_set_hook_function
Nikos Mavrogiannopoulos [Tue, 13 Feb 2018 15:21:52 +0000 (16:21 +0100)] 
doc: updated text on gnutls_handshake_set_hook_function

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

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopriority: disable the enabled by default RSA-PSS signature algorithms
Nikos Mavrogiannopoulos [Mon, 12 Feb 2018 10:18:06 +0000 (11:18 +0100)] 
priority: disable the enabled by default RSA-PSS signature algorithms

They have been modified in the latest (yet unsupported) TLS 1.3
drafts, so prevent causes interoperability failures by keeping them
on.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: cipher-openssl-compat: extend to include CCM tests
Nikos Mavrogiannopoulos [Mon, 12 Feb 2018 08:20:17 +0000 (09:20 +0100)] 
tests: cipher-openssl-compat: extend to include CCM tests

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoImprove documentation of gnutls_x509_trust_list_iter_get_ca [ci skip]
Michael Catanzaro [Fri, 9 Feb 2018 16:22:24 +0000 (10:22 -0600)] 
Improve documentation of gnutls_x509_trust_list_iter_get_ca [ci skip]

The documentation is confusing because it implies that
gnutls_x509_trust_list_iter_deinit() should be called after using this
function, but in fact it is generally not necessary.

Also, there was a typo here ("usin").

Signed-off-by: Michael Catanzaro <mcatanzaro@igalia.com>
8 years ago.gitlab-ci.yml: run the fuzz testsuite under various CPU capabilities
Nikos Mavrogiannopoulos [Wed, 7 Feb 2018 17:59:39 +0000 (18:59 +0100)] 
.gitlab-ci.yml: run the fuzz testsuite under various CPU capabilities

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoaccelerated: make explicit key size check to all accelerated ciphers
Nikos Mavrogiannopoulos [Wed, 7 Feb 2018 08:24:18 +0000 (09:24 +0100)] 
accelerated: make explicit key size check to all accelerated ciphers

That is, do not rely on checks done on asm level, as they vary and
may change over updates. Also handle consistently invalid key sizes
by returning an error, and eliminate calls to abort().

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoaccelerated: check keysize in SSSE3 cipher setkey
Vitezslav Cizek [Tue, 6 Feb 2018 15:46:31 +0000 (16:46 +0100)] 
accelerated: check keysize in SSSE3 cipher setkey

aes_ssse3_cipher_setkey() accepted any key size,
which could lead to invalid memory access.

Such as with the oss-fuzz corpora file
fuzz/gnutls_pkcs8_key_parser_fuzzer.in/da59d34eacdf50a0019a457fb7c4916be48c99a5

Signed-off-by: Vitezslav Cizek <vcizek@suse.com>
8 years agop11tool: updated documentation [ci skip]
Nikos Mavrogiannopoulos [Thu, 8 Feb 2018 13:32:42 +0000 (14:32 +0100)] 
p11tool: updated documentation [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agonettle: use the nettle_get_secp API when available
Nikos Mavrogiannopoulos [Wed, 7 Feb 2018 10:34:36 +0000 (11:34 +0100)] 
nettle: use the nettle_get_secp API when available

Resolves #380

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agonettle base64_encode_raw: use cast to avoid warnings
Nikos Mavrogiannopoulos [Wed, 6 Dec 2017 08:46:41 +0000 (09:46 +0100)] 
nettle base64_encode_raw: use cast to avoid warnings

Nettle switched prototypes for base64_encode_raw() as follows:
-base64_encode_raw(uint8_t *dst, size_t length, const uint8_t *src);
+base64_encode_raw(char *dst, size_t length, const uint8_t *src);

That means we need to cast fist param to void if we want to avoid
warnings on different platforms.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoaccelerated: x86-common: do not use _xgetbv() with clang
Nikos Mavrogiannopoulos [Tue, 6 Feb 2018 13:40:59 +0000 (14:40 +0100)] 
accelerated: x86-common: do not use _xgetbv() with clang

Resolves #372

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoconfigure: treat solaris as ELF system
Nikos Mavrogiannopoulos [Tue, 6 Feb 2018 13:37:42 +0000 (14:37 +0100)] 
configure: treat solaris as ELF system

Resolves #376

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: repeat cipher test with multiple keys and nonces
Nikos Mavrogiannopoulos [Tue, 6 Feb 2018 03:03:45 +0000 (04:03 +0100)] 
tests: repeat cipher test with multiple keys and nonces

In addition include chacha20-poly1305 into the tests.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoaccelerated: aarch64: fix GCM counter increment
Nikos Mavrogiannopoulos [Tue, 6 Feb 2018 02:59:17 +0000 (03:59 +0100)] 
accelerated: aarch64: fix GCM counter increment

Ensure that we restrict the GCM counter to the 4 bytes assigned to it.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoaccelerated: fix use of SSSE3 vpaes_encrypt
Nikos Mavrogiannopoulos [Tue, 6 Feb 2018 03:39:39 +0000 (04:39 +0100)] 
accelerated: fix use of SSSE3 vpaes_encrypt

Previously we assumed that the nettle GCM internal functions
will use the provided ECB function for single block encryption.
Newer versions no longer operate that way. Ensure that we
are compatible with them.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoaccelerated: fix use of aesni_ecb_encrypt()
Nikos Mavrogiannopoulos [Mon, 5 Feb 2018 19:25:23 +0000 (20:25 +0100)] 
accelerated: fix use of aesni_ecb_encrypt()

Previously we assumed that the nettle GCM internal functions
will use the provided ECB function for single block encryption.
Newer versions no longer operate that way. Ensure that we
are compatible with them.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoserv: increase cache size used for resumption
Nikos Mavrogiannopoulos [Fri, 2 Feb 2018 14:49:48 +0000 (15:49 +0100)] 
serv: increase cache size used for resumption

That allows sessions with longer parameters to be able
to be resumed.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoCONTRIBUTING.md: check the issue closing as part of review [ci skip]
Nikos Mavrogiannopoulos [Fri, 2 Feb 2018 10:09:22 +0000 (11:09 +0100)] 
CONTRIBUTING.md: check the issue closing as part of review [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls-cli: no longer print certificate types or compression methods
Nikos Mavrogiannopoulos [Fri, 2 Feb 2018 09:35:11 +0000 (10:35 +0100)] 
gnutls-cli: no longer print certificate types or compression methods

We don't support any other compression methods than the null compression,
nor any other certificate types.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoInline version macros into its users.
Jay Foad [Sat, 27 Jan 2018 08:13:17 +0000 (09:13 +0100)] 
Inline version macros into its users.

This fixes a problem in _gnutls_version_is_supported() where we want to
use preprocessing directives in the loop body. Doing this within a macro
argument is undefined behaviour according to the C standard, and not
supported by the system compiler on AIX.

Signed-off-by: Jay Foad <jay.foad@gmail.com>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Fri, 26 Jan 2018 14:49:53 +0000 (15:49 +0100)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agocerttool: deprecated the --certificate-pubkey option
Nikos Mavrogiannopoulos [Fri, 26 Jan 2018 14:48:52 +0000 (15:48 +0100)] 
certtool: deprecated the --certificate-pubkey option

That option is duplicate since --pubkey-info can provide the same
information.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agocerttool: avoid duplicate deinitialization on --certificate-pubkey
Nikos Mavrogiannopoulos [Fri, 26 Jan 2018 14:44:21 +0000 (15:44 +0100)] 
certtool: avoid duplicate deinitialization on --certificate-pubkey

Resolves #368

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agodh: document why BER decoding rules are allows
Nikos Mavrogiannopoulos [Sun, 21 Jan 2018 11:25:10 +0000 (12:25 +0100)] 
dh: document why BER decoding rules are allows

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agopubkey: use the strict DER decoder for SubjectPublicKeyInfo
Nikos Mavrogiannopoulos [Sun, 21 Jan 2018 11:19:12 +0000 (12:19 +0100)] 
pubkey: use the strict DER decoder for SubjectPublicKeyInfo

Although there is no explicit RFC mentioning the SubjectPublicKeyInfo
encoding, this structure is a subset of the X.509 certificate's structure
and as such it is expected to be in DER form.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agopk: document need for the generic BER decoder
Nikos Mavrogiannopoulos [Sun, 21 Jan 2018 10:36:20 +0000 (11:36 +0100)] 
pk: document need for the generic BER decoder

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agodoc update
Nikos Mavrogiannopoulos [Wed, 17 Jan 2018 18:26:12 +0000 (19:26 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: check whether deletion of a certificate object works
Nikos Mavrogiannopoulos [Wed, 17 Jan 2018 18:25:36 +0000 (19:25 +0100)] 
tests: check whether deletion of a certificate object works

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agop11tool: corrected issue preventing the deletion of objects in batch mode
Nikos Mavrogiannopoulos [Wed, 17 Jan 2018 18:15:46 +0000 (19:15 +0100)] 
p11tool: corrected issue preventing the deletion of objects in batch mode

Previously initialization of PIN callbacks would only happen during listing
of objects, which happened only in non-batch mode.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agop11tool: corrected type affecting use of --only-urls
Nikos Mavrogiannopoulos [Wed, 17 Jan 2018 18:10:52 +0000 (19:10 +0100)] 
p11tool: corrected type affecting use of --only-urls

It would enable batch mode accidentally.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: pkcs11/tls-neg-pkcs11-key: updated for softhsm with PKCS#11 support
Nikos Mavrogiannopoulos [Fri, 19 Jan 2018 10:42:02 +0000 (11:42 +0100)] 
tests: pkcs11/tls-neg-pkcs11-key: updated for softhsm with PKCS#11 support

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoadded sub-section on selecting the right return value [ci skip]
Nikos Mavrogiannopoulos [Mon, 22 Jan 2018 08:06:25 +0000 (09:06 +0100)] 
added sub-section on selecting the right return value [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc update [ci skip]
Nikos Mavrogiannopoulos [Wed, 17 Jan 2018 16:35:54 +0000 (17:35 +0100)] 
doc update [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoexamples: use gnutls_certificate_set_x509_system_trust
Nikos Mavrogiannopoulos [Wed, 17 Jan 2018 07:38:13 +0000 (08:38 +0100)] 
examples: use gnutls_certificate_set_x509_system_trust

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agodoc update
Nikos Mavrogiannopoulos [Fri, 12 Jan 2018 15:14:23 +0000 (16:14 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: privkey-verify-broken: addressed uninitialized var use
Nikos Mavrogiannopoulos [Fri, 12 Jan 2018 12:23:03 +0000 (13:23 +0100)] 
tests: privkey-verify-broken: addressed uninitialized var use

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: check whether get_mtu() functions relate to the set values
Nikos Mavrogiannopoulos [Wed, 10 Jan 2018 14:41:50 +0000 (15:41 +0100)] 
tests: check whether get_mtu() functions relate to the set values

That is, verify that gnutls_dtls_set_data_mtu() value would be
reflected into gnutls_dtls_get_data_mtu(), as well as the
gnutls_dtls_set_mtu() to gnutls_dtls_get_mtu().

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added unit test for _gnutls_record_overhead()
Nikos Mavrogiannopoulos [Wed, 10 Jan 2018 14:35:36 +0000 (15:35 +0100)] 
tests: added unit test for _gnutls_record_overhead()

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agoDTLS: improved data MTU calculation under CBC ciphersuites
Nikos Mavrogiannopoulos [Fri, 12 Jan 2018 08:01:54 +0000 (09:01 +0100)] 
DTLS: improved data MTU calculation under CBC ciphersuites

The data MTU calculation under CBC ciphersuites takes into
account that the overhead of these ciphersuites is constant (IV +
hash + 1 byte padding), though the capacity varies due to the padding
block. That is, on 16-byte padding block, one padding byte is the
overhead but the rest 15 bytes are accounted for data MTU.

That also has the side effect that setting a data MTU using
gnutls_dtls_set_data_mtu(), is not definite, and the actual
MTU may be larger for these ciphersuites --i.e., the
return value of gnutls_dtls_get_data_mtu().

Resolves #360

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agofuzz: added reproducer for leak in gnutls_x509_crl_list_import
Nikos Mavrogiannopoulos [Wed, 10 Jan 2018 09:58:30 +0000 (10:58 +0100)] 
fuzz: added reproducer for leak in gnutls_x509_crl_list_import

That was detected by oss-fuzz in:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4930

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_x509_crt_list_import: eliminated memory leak
Nikos Mavrogiannopoulos [Wed, 10 Jan 2018 09:56:28 +0000 (10:56 +0100)] 
gnutls_x509_crt_list_import: eliminated memory leak

That leak would be triggered if GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEED
flag was used and the input data would exceed the maximum limit.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agolibtasn1: updated to latest libtasn1 master branch
Nikos Mavrogiannopoulos [Tue, 9 Jan 2018 10:31:45 +0000 (11:31 +0100)] 
libtasn1: updated to latest libtasn1 master branch

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls_pkcs12_key_parser_fuzzer.in: added reproducer for oss-fuzz #4890
Nikos Mavrogiannopoulos [Wed, 3 Jan 2018 15:41:36 +0000 (16:41 +0100)] 
gnutls_pkcs12_key_parser_fuzzer.in: added reproducer for oss-fuzz #4890

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc update [ci skip]
Nikos Mavrogiannopoulos [Sun, 7 Jan 2018 08:55:37 +0000 (09:55 +0100)] 
doc update [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agodoc: updated copyright year for manual
Nikos Mavrogiannopoulos [Wed, 3 Jan 2018 15:27:03 +0000 (16:27 +0100)] 
doc: updated copyright year for manual

That eliminates the 'make syntax-check' error.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: added reproducer for self-signed verification error
Nikos Mavrogiannopoulos [Sat, 30 Dec 2017 19:12:36 +0000 (20:12 +0100)] 
tests: added reproducer for self-signed verification error

Relates #347

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agox509/verify: when verifying against a self signed certificate ignore issuer
Nikos Mavrogiannopoulos [Sat, 30 Dec 2017 18:57:08 +0000 (19:57 +0100)] 
x509/verify: when verifying against a self signed certificate ignore issuer

That is, ignore issuer when checking the issuer's parameters strength. That
resolves the issue of marking self-signed certificates as with insecure
parameters during verification.

Resolves #347

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agognutls_pk_self_test: include ECDSA tests on GNUTLS_PK_EC
Nikos Mavrogiannopoulos [Wed, 20 Dec 2017 07:16:29 +0000 (08:16 +0100)] 
gnutls_pk_self_test: include ECDSA tests on GNUTLS_PK_EC

Previously when a request for a specific self check on GNUTLS_PK_EC
was done, only ECDH tests would be run. This change includes the ECDSA
tests as well (GNUTLS_PK_EC and GNUTLS_PK_ECDSA are an alias to each other).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: hash-large: increase parallelism to allow fast run in CI
Nikos Mavrogiannopoulos [Tue, 19 Dec 2017 15:40:59 +0000 (16:40 +0100)] 
tests: hash-large: increase parallelism to allow fast run in CI

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: reference gnutls_prf_rfc5705 instead of gnutls_prf
Nikos Mavrogiannopoulos [Fri, 8 Dec 2017 10:14:58 +0000 (11:14 +0100)] 
doc: reference gnutls_prf_rfc5705 instead of gnutls_prf

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: utils.h: forbid compilation with NDEBUG
Nikos Mavrogiannopoulos [Sun, 3 Dec 2017 10:34:32 +0000 (11:34 +0100)] 
tests: utils.h: forbid compilation with NDEBUG

This allows to rely on the assert() macro being functional on
the test suite.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: p11-kit-load.sh: verify that all modules are loaded after a private key operation
Nikos Mavrogiannopoulos [Sun, 3 Dec 2017 09:49:12 +0000 (10:49 +0100)] 
tests: p11-kit-load.sh: verify that all modules are loaded after a private key operation

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: enhanced pkcs11/list-tokens
Nikos Mavrogiannopoulos [Thu, 30 Nov 2017 14:08:22 +0000 (15:08 +0100)] 
tests: enhanced pkcs11/list-tokens

This not only creates a trust list with the system certificates, but
also attempts to verify a certificate, increasing the number of calls
to PKCS#11 verification API (and thus ensuring there are no calls
which may trigger the load of other modules).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopkcs11 verification: always use the GNUTLS_PKCS11_OBJ_FLAG_PRESENT_IN_TRUSTED_MODULE
Nikos Mavrogiannopoulos [Thu, 30 Nov 2017 13:31:07 +0000 (14:31 +0100)] 
pkcs11 verification: always use the GNUTLS_PKCS11_OBJ_FLAG_PRESENT_IN_TRUSTED_MODULE

That is, make sure that all our calls to PKCS#11 subsystem for verification
will only trigger the trust module initialization, and not the generic
PKCS#11 initialization.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopkcs11: simplify trusted module loading state
Nikos Mavrogiannopoulos [Thu, 30 Nov 2017 13:28:46 +0000 (14:28 +0100)] 
pkcs11: simplify trusted module loading state

That is always utilize the same flags (GNUTLS_PKCS11_OBJ_FLAG_PRESENT_IN_TRUSTED_MODULE)
to determine whether to initialize trusted modules only or
proceed with general initialization.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years ago_gnutls_pkcs11_check_init: improved transition between states
Nikos Mavrogiannopoulos [Thu, 30 Nov 2017 11:52:57 +0000 (12:52 +0100)] 
_gnutls_pkcs11_check_init: improved transition between states

The init_level_t for PKCS#11 modules, was incorrectly handled as a
linear state transition, causing few cases in the transition to be
incorrectly handled. Define precisely the state transitions and
enforce them in _gnutls_pkcs11_check_init.

That addresses a regression introduced by the previous state handling
addition, which made impossible to switch from the trusted state to
the all modules.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: corrected destructive/p11-kit-load.sh error checking
Nikos Mavrogiannopoulos [Thu, 30 Nov 2017 10:44:14 +0000 (11:44 +0100)] 
tests: corrected destructive/p11-kit-load.sh error checking

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agognutls-serv: fix double-free on inactivity timeout
Daiki Ueno [Fri, 1 Dec 2017 10:13:29 +0000 (11:13 +0100)] 
gnutls-serv: fix double-free on inactivity timeout

Previously, gnutls-serv --echo segfaulted when closing client
connection after inactivity timeout.  Here is the valgrind output:

==20246== Invalid free() / delete / delete[] / realloc()
==20246==    at 0x4C2FD18: free (vg_replace_malloc.c:530)
==20246==    by 0x405310: listener_free (serv.c:154)
==20246==    by 0x408B57: tcp_server (serv.c:1568)
==20246==    by 0x407DA6: main (serv.c:1231)
==20246==  Address 0x6ed4fe0 is 0 bytes inside a block of size 3 free'd
==20246==    at 0x4C2FD18: free (vg_replace_malloc.c:530)
==20246==    by 0x408A1D: tcp_server (serv.c:1548)
==20246==    by 0x407DA6: main (serv.c:1231)
==20246==  Block was alloc'd at
==20246==    at 0x4C2EB6B: malloc (vg_replace_malloc.c:299)
==20246==    by 0x6A64489: strdup (in /usr/lib64/libc-2.25.so)
==20246==    by 0x407310: get_response (serv.c:948)
==20246==    by 0x408840: tcp_server (serv.c:1492)
==20246==    by 0x407DA6: main (serv.c:1231)
==20246==

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years ago.dir-locals.el: new file
Daiki Ueno [Tue, 28 Nov 2017 14:45:59 +0000 (15:45 +0100)] 
.dir-locals.el: new file

This forces Emacs to use the Linux kernel coding style for all C code.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agobuild: remove m4 files pulled in by autopoint
Daiki Ueno [Tue, 28 Nov 2017 14:45:54 +0000 (15:45 +0100)] 
build: remove m4 files pulled in by autopoint

Having these files in the git repository causes unnecessary changes
after "make bootstrap".

Signed-off-by: Daiki Ueno <dueno@redhat.com>
8 years agognutls_aead_cipher_init: corrected potential memory leak
Nikos Mavrogiannopoulos [Wed, 29 Nov 2017 16:16:41 +0000 (17:16 +0100)] 
gnutls_aead_cipher_init: corrected potential memory leak

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agodoc: provided basic documentation of the FIPS140-2 mode [ci skip]
Nikos Mavrogiannopoulos [Tue, 28 Nov 2017 13:28:46 +0000 (14:28 +0100)] 
doc: provided basic documentation of the FIPS140-2 mode [ci skip]

Resolves #332

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: verify whether group remains the same after resumption
Nikos Mavrogiannopoulos [Mon, 27 Nov 2017 08:42:26 +0000 (09:42 +0100)] 
tests: verify whether group remains the same after resumption

Resolves #331

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years ago_gnutls_set_resumed_parameters: restore the group from resumed parameters
Nikos Mavrogiannopoulos [Mon, 27 Nov 2017 08:31:52 +0000 (09:31 +0100)] 
_gnutls_set_resumed_parameters: restore the group from resumed parameters

That allows resumed sessions to have the original group information such as
curve used for key exchange or FFDHE parameters.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: removed unnecessary assert
Nikos Mavrogiannopoulos [Wed, 27 Sep 2017 06:19:01 +0000 (08:19 +0200)] 
tests: removed unnecessary assert

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: delete temporary files
Nikos Mavrogiannopoulos [Tue, 10 Oct 2017 12:23:20 +0000 (14:23 +0200)] 
tests: delete temporary files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agosession state: use the right type for send_cert_req variable
Nikos Mavrogiannopoulos [Wed, 8 Nov 2017 10:47:22 +0000 (11:47 +0100)] 
session state: use the right type for send_cert_req variable

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agotests: client-fastopen: introduce child signal handler and delay prior to starting
Nikos Mavrogiannopoulos [Fri, 24 Nov 2017 07:17:40 +0000 (08:17 +0100)] 
tests: client-fastopen: introduce child signal handler and delay prior to starting

This addresses a hang issue on freebsd builds.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agopsktool: allow up to 512-byte keys
Nikos Mavrogiannopoulos [Wed, 22 Nov 2017 16:36:30 +0000 (17:36 +0100)] 
psktool: allow up to 512-byte keys

This aligns the psktool --help output with the psktool operation.

Suggested by Jack Lloyd.

Resolves #327

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
8 years agogetfuncs-map.pl: added gnutls_srp_8192_group* symbols to ignore list
Nikos Mavrogiannopoulos [Tue, 21 Nov 2017 19:26:43 +0000 (20:26 +0100)] 
getfuncs-map.pl: added gnutls_srp_8192_group* symbols to ignore list

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agoupdated auto-generated files
Nikos Mavrogiannopoulos [Tue, 21 Nov 2017 18:24:29 +0000 (19:24 +0100)] 
updated auto-generated files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agosrptool: --create-conf no longer includes 1024-bit parameters
Nikos Mavrogiannopoulos [Tue, 21 Nov 2017 18:17:01 +0000 (19:17 +0100)] 
srptool: --create-conf no longer includes 1024-bit parameters

In addition it includes the 8192-bit parameters, and
the default params used for a new user are the 2k ones.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
8 years agotests: updated SRP checks
Nikos Mavrogiannopoulos [Tue, 21 Nov 2017 12:23:21 +0000 (13:23 +0100)] 
tests: updated SRP checks

Test 1024, 1536, 2048, 3072, 4096 and 8192 bit parameters.
In addition, verify that parameters not in the SRP spec are
rejected by a gnutls client.

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