]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
9 years agotests: keygen -> privkey-keygen
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 12:47:09 +0000 (13:47 +0100)] 
tests: keygen -> privkey-keygen

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_check_key_cert_match: allow broken sigs
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 12:20:02 +0000 (13:20 +0100)] 
_gnutls_check_key_cert_match: allow broken sigs

That ensures that when loading a certificate pair with SHA1, when
SHA1 is disabled will not cause the server to fail to load.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago.gitignore: more files to ignore
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 12:14:24 +0000 (13:14 +0100)] 
.gitignore: more files to ignore

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoUse a common function to decide acceptable signatures
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 12:12:07 +0000 (13:12 +0100)] 
Use a common function to decide acceptable signatures

That is, ensure that results from all verification functions,
including gnutls_pubkey_verify_data2(), will be consistent with
SHA1 and other algorithms deprecation.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocheck_ocsp_response: utilize the same flags as in certificate verification
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 12:01:51 +0000 (13:01 +0100)] 
check_ocsp_response: utilize the same flags as in certificate verification

That ensures that overrides like using broken algorithms are considered
in OCSP validation.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoextensions: print the name/type of any unexpected extension
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 13:34:37 +0000 (14:34 +0100)] 
extensions: print the name/type of any unexpected extension

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added script to check pkg-config operation
Nikos Mavrogiannopoulos [Sat, 18 Mar 2017 17:12:55 +0000 (18:12 +0100)] 
tests: added script to check pkg-config operation

That is, whether the generated gnutls.pc will function for
compiling and linking.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agognutls.pc: don't pass the libtool vars to Libs.private
Nikos Mavrogiannopoulos [Sat, 18 Mar 2017 16:56:42 +0000 (17:56 +0100)] 
gnutls.pc: don't pass the libtool vars to Libs.private

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotests: improved tls-rehandshake tests
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 09:11:54 +0000 (10:11 +0100)] 
tests: improved tls-rehandshake tests

Used common definitions from cert-common.h for certificates,
and improved error detection in tls-rehandshake-cert-2.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: check whether a rehandshake without a cert works
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 08:42:59 +0000 (09:42 +0100)] 
tests: check whether a rehandshake without a cert works

That is, check whether if on initial handshake the server requests
a certificate, but on the following rehandshake he doesn't, whether
the client behaves as expected. This tests:
1f685db853db6e48c77c6dbde0cdf716a7303baa

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agohandshake: reset cert request state on handshake init
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 08:36:18 +0000 (09:36 +0100)] 
handshake: reset cert request state on handshake init

That addresses a bug which on client side on case of an initial
handshake with a client certificate, we continue to send this
certificate even if on rehandshake we were not requested with on.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoRevert "nettle/rnd: use gettime() instead of gnutls_time()"
Nikos Mavrogiannopoulos [Tue, 21 Mar 2017 06:59:37 +0000 (07:59 +0100)] 
Revert "nettle/rnd: use gettime() instead of gnutls_time()"

This reverts commit c4842a21f65c7fc9a27932eb1792b1fc9e65f722.
The time() syscall is also implemented as syscall() and is in
fact performing better than gettime().

9 years agoREADME.md: corrected typo [ci skip]
Nikos Mavrogiannopoulos [Mon, 20 Mar 2017 22:00:06 +0000 (23:00 +0100)] 
README.md: corrected typo [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agonettle/rnd: use gettime() instead of gnutls_time()
Nikos Mavrogiannopoulos [Mon, 20 Mar 2017 15:31:42 +0000 (16:31 +0100)] 
nettle/rnd: use gettime() instead of gnutls_time()

The gnulib gettime() maps to gettimeofday() or clock_gettime()
which are both implemented as fast system calls - see vdso(7)-
and as such are available without a switch to kernel mode.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc: updated RNG documentation to reflect the previous changes
Nikos Mavrogiannopoulos [Mon, 20 Mar 2017 12:29:42 +0000 (13:29 +0100)] 
doc: updated RNG documentation to reflect the previous changes

9 years agonettle/rnd: re-seed both key and nonce levels based on time
Nikos Mavrogiannopoulos [Mon, 20 Mar 2017 12:23:39 +0000 (13:23 +0100)] 
nettle/rnd: re-seed both key and nonce levels based on time

The time(0) is quite cheap on modern operating systems, and thus we
can rely on it to provide improved assurance in the output randomness.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agonettle/pk: use nonce level for RSA padding
Nikos Mavrogiannopoulos [Mon, 20 Mar 2017 12:13:11 +0000 (13:13 +0100)] 
nettle/pk: use nonce level for RSA padding

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoREADME.md: corrected link for coverage in master [ci skip]
Nikos Mavrogiannopoulos [Sat, 18 Mar 2017 18:26:02 +0000 (19:26 +0100)] 
README.md: corrected link for coverage in master [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agoAvoid deprecation warnings when including gnutls/abstract.h
Martin Storsjo [Fri, 17 Mar 2017 21:33:01 +0000 (23:33 +0200)] 
Avoid deprecation warnings when including gnutls/abstract.h

Since ac3de8f5, when all openpgp functionality was deprecated, a
library user including gnutls/abstract.h gets warnings about
deprecated declarations, like this:

gnutls/openpgp.h:328:10: warning: â€˜gnutls_openpgp_recv_key_func’ is deprecated [-Wdeprecated-declarations]
          gnutls_openpgp_recv_key_func func) _GNUTLS_GCC_ATTR_DEPRECATED;

This warning is emitted since the gnutls_openpgp_set_recv_key_function
prototype uses the deprecated typedef gnutls_openpgp_recv_key_func.

By omitting the deprecation attribute from this individual
typedef, we avoid the spurious warnings in calling code which just
includes gnutls/abstract.h without actually using anything related
to openpgp.

Signed-off-by: Martin Storsjo <martin@martin.st>
9 years agognutls.h: added definitions to obtain the maximum element in several enumerations
Nikos Mavrogiannopoulos [Fri, 17 Mar 2017 09:47:33 +0000 (10:47 +0100)] 
gnutls.h: added definitions to obtain the maximum element in several enumerations

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added basic unit tests for several string functions of libs
Nikos Mavrogiannopoulos [Thu, 16 Mar 2017 13:29:10 +0000 (14:29 +0100)] 
tests: added basic unit tests for several string functions of libs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc update
Nikos Mavrogiannopoulos [Fri, 24 Feb 2017 08:44:55 +0000 (09:44 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: certtool-crl-decoding: ignore lines warning about SHA1 deprecation
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 21:51:57 +0000 (22:51 +0100)] 
tests: certtool-crl-decoding: ignore lines warning about SHA1 deprecation

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotests: check the flag GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 16:17:32 +0000 (17:17 +0100)] 
tests: check the flag GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1

In addition verify whether the GNUTLS_VERIFY_ALLOW_BROKEN flag
works when MD5 is present.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoIntroduced flag GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 16:13:48 +0000 (17:13 +0100)] 
Introduced flag GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1

This allows performing a verification with only SHA1 allowed
from the broken algorithms. This can be used to fine-tune
verification in case default verification fails, to detect
whether the failed algorithm was SHA1.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoIntroduced the %VERIFY_ALLOW_BROKEN priority string option
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 16:06:47 +0000 (17:06 +0100)] 
Introduced the %VERIFY_ALLOW_BROKEN priority string option

This allows enabling broken signature algorithms in certificate verification.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoAllow reverting the SHA1 ban as a signature algorithm
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 16:00:22 +0000 (17:00 +0100)] 
Allow reverting the SHA1 ban as a signature algorithm

This allows distributors to decide not to ban SHA1. This
option may be removed in the future.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agop11tool: test-sign operation using SHA256 instead of SHA1
Nikos Mavrogiannopoulos [Fri, 24 Feb 2017 11:36:46 +0000 (12:36 +0100)] 
p11tool: test-sign operation using SHA256 instead of SHA1

This avoids the errors returned from the verification functions due to
SHA1 usage.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: updated to account SHA1 move to broken set
Nikos Mavrogiannopoulos [Fri, 24 Feb 2017 08:42:26 +0000 (09:42 +0100)] 
tests: updated to account SHA1 move to broken set

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoalgorithms: tag SHA1 as insecure algorithm
Nikos Mavrogiannopoulos [Fri, 24 Feb 2017 07:35:34 +0000 (08:35 +0100)] 
algorithms: tag SHA1 as insecure algorithm

Although SHA1 was considered to be risky to use the past few years,
there has been no demonstration of breakage. As of 2017-2-23 there has
been a demonstrated collision in SHA1, and even though the attack was
a costly one, it provided the incentive to should move SHA1 into
the broken hashes list together with MD5 and MD2.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoREADME.md: updated coverage links [ci skip]
Nikos Mavrogiannopoulos [Thu, 16 Mar 2017 13:02:05 +0000 (14:02 +0100)] 
README.md: updated coverage links [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: removed unneeded ifdef in tlsext-decoding.c
Nikos Mavrogiannopoulos [Thu, 16 Mar 2017 07:25:52 +0000 (08:25 +0100)] 
tests: removed unneeded ifdef in tlsext-decoding.c

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc: updated RNG design
Nikos Mavrogiannopoulos [Thu, 16 Mar 2017 08:04:24 +0000 (09:04 +0100)] 
doc: updated RNG design

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agonettle/rnd: introduced time limit for key generator
Nikos Mavrogiannopoulos [Wed, 15 Mar 2017 13:21:43 +0000 (14:21 +0100)] 
nettle/rnd: introduced time limit for key generator

That is, force re-key of the KEY and RANDOM PRNG after 2 hours
of operation, irrespective of the amount of data having been output.
At the same time, increase limits for key and nonce generators,
to prevent a large amount of system calls in busy servers.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago_gnutls_pk_generate_keys: separate between ephemeral and long-term keys
Nikos Mavrogiannopoulos [Wed, 15 Mar 2017 14:11:14 +0000 (15:11 +0100)] 
_gnutls_pk_generate_keys: separate between ephemeral and long-term keys

That allows using the faster generator for ephemeral keys.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agonettle/pk: use the nonce level for digital signatures
Nikos Mavrogiannopoulos [Wed, 15 Mar 2017 13:46:54 +0000 (14:46 +0100)] 
nettle/pk: use the nonce level for digital signatures

That is, we do not really require high quality secret data for the generation
of signatures. A better approach would be to switch to predictable signatures (RFC6979).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago.gitlab-ci.yml: limit submodule update to avoid fetch
Nikos Mavrogiannopoulos [Wed, 15 Mar 2017 21:06:59 +0000 (22:06 +0100)] 
.gitlab-ci.yml: limit submodule update to avoid fetch

This should reduce both the bandwidth and the time of the fetch.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agoFix a typo in a variable name in an m4 script
Martin Storsjo [Wed, 15 Mar 2017 21:32:12 +0000 (23:32 +0200)] 
Fix a typo in a variable name in an m4 script

Signed-off-by: Martin Storsjo <martin@martin.st>
9 years agobuild: disable valgrind tests by default
Alon Bar-Lev [Tue, 14 Mar 2017 17:27:49 +0000 (19:27 +0200)] 
build: disable valgrind tests by default

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
9 years ago.gitlab-ci.yml: ubsan build utilizes -Werror for the library
Nikos Mavrogiannopoulos [Wed, 15 Mar 2017 04:17:37 +0000 (05:17 +0100)] 
.gitlab-ci.yml: ubsan build utilizes -Werror for the library

That brings back the -Werror for building, after its removal from
clang-analyzer build.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years ago.gitlab-ci.yml: remove -Werror compilation from scan-build
Nikos Mavrogiannopoulos [Tue, 14 Mar 2017 15:43:34 +0000 (16:43 +0100)] 
.gitlab-ci.yml: remove -Werror compilation from scan-build

When we pass '--status-bugs' to the command in combination with
'-Werror' in CFLAGS it has the following side effects. In a failed
due to Werror build, scan-build fails to find any issues, and
marks the run as successfully completed. Hence, removes the -Werror
from clang-analyzer.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agobuild: tests: resolve as-needed issue with seccomp
Alon Bar-Lev [Mon, 13 Mar 2017 18:47:02 +0000 (20:47 +0200)] 
build: tests: resolve as-needed issue with seccomp

Incorrect ordering of -lseccomp:
<snip>
-Wl,--as-needed ../lib/.libs/libgnutls.so -lseccomp ./.libs/libutils.a
./.libs/libutils.a(seccomp.o): In function seccomp_init'
seccomp.c:(.text+0x2b): undefined reference to `seccomp_init'
<snip>

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
9 years agofuzz: Corrected default options in fuzz scripts [ci skip]
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 22:27:14 +0000 (23:27 +0100)] 
fuzz: Corrected default options in fuzz scripts [ci skip]

This change assumes that afl-fuzz (and not libfuzzer) will be used
by default.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agognutls_pkcs11_privkey_init: document limitation on created object [ci skip]
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 19:13:49 +0000 (20:13 +0100)] 
gnutls_pkcs11_privkey_init: document limitation on created object [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agopkcs11: re-open privkey session handle on CKR_SESSION_HANDLE_INVALID
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 14:21:40 +0000 (15:21 +0100)] 
pkcs11: re-open privkey session handle on CKR_SESSION_HANDLE_INVALID

When initializing a private key operation, attempt to re-open the key
if CKR_SESSION_HANDLE_INVALID is received.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: pkcs11-mock lib: check object session sanity prior to using it
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 14:15:31 +0000 (15:15 +0100)] 
tests: pkcs11-mock lib: check object session sanity prior to using it

This avoids crashes when the object is used after a fork but prior
to the session being re-established.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added an OCSP response parsing coverage test
Nikos Mavrogiannopoulos [Thu, 9 Mar 2017 10:21:50 +0000 (11:21 +0100)] 
tests: added an OCSP response parsing coverage test

This inputs a large set of valid and invalid OCSP files
in the OCSP parser with the intention to stress test its
error checking, and prevent regressions.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added a certificate parsing coverage test
Nikos Mavrogiannopoulos [Thu, 9 Mar 2017 07:14:32 +0000 (08:14 +0100)] 
tests: added a certificate parsing coverage test

This inputs a large set of valid and invalid certificates in
the certificate parser with the intention to stress test its
error checking, and prevent regressions.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago.gitignore: more files to ignore
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 08:39:03 +0000 (09:39 +0100)] 
.gitignore: more files to ignore

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit tests for gnutls_pkcs11_token_get_mechanism
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 08:33:29 +0000 (09:33 +0100)] 
tests: added unit tests for gnutls_pkcs11_token_get_mechanism

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: included unit test for gnutls_pkcs11_obj_export
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 08:28:25 +0000 (09:28 +0100)] 
tests: included unit test for gnutls_pkcs11_obj_export

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit test for gnutls_pkcs11_reinit()
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 08:23:37 +0000 (09:23 +0100)] 
tests: added unit test for gnutls_pkcs11_reinit()

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added unit tests for gnutls_pkcs11_obj_get_info
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 08:17:42 +0000 (09:17 +0100)] 
tests: added unit tests for gnutls_pkcs11_obj_get_info

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agodoc update
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 08:17:07 +0000 (09:17 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_pkcs11_obj_get_info: don't include the terminator into output size
Nikos Mavrogiannopoulos [Mon, 13 Mar 2017 08:14:15 +0000 (09:14 +0100)] 
gnutls_pkcs11_obj_get_info: don't include the terminator into output size

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: cert-tests: openpgp-certs: align test redirection
Alon Bar-Lev [Mon, 13 Mar 2017 09:32:07 +0000 (11:32 +0200)] 
tests: cert-tests: openpgp-certs: align test redirection

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
9 years agotests: suppressions.valgrind: supress fillin_rpath
Alon Bar-Lev [Mon, 13 Mar 2017 08:45:08 +0000 (10:45 +0200)] 
tests: suppressions.valgrind: supress fillin_rpath

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
9 years agotests: remove unused suppressions.valgrind
Alon Bar-Lev [Mon, 13 Mar 2017 09:30:41 +0000 (11:30 +0200)] 
tests: remove unused suppressions.valgrind

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
9 years agolib: unconditionally enable the self-check functions
Nikos Mavrogiannopoulos [Sun, 12 Mar 2017 13:48:19 +0000 (14:48 +0100)] 
lib: unconditionally enable the self-check functions

These functions were previously made available only in FIPS140-2
mode. Enabling them unconditionally allows applications to directly
utilize that functionality for testing the gnutls library.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotests: added unit test for gnutls_pkcs11_get_pin_function
Nikos Mavrogiannopoulos [Sun, 12 Mar 2017 13:43:00 +0000 (14:43 +0100)] 
tests: added unit test for gnutls_pkcs11_get_pin_function

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotests: moved ocsp-tests to main directory
Nikos Mavrogiannopoulos [Sun, 12 Mar 2017 13:29:14 +0000 (14:29 +0100)] 
tests: moved ocsp-tests to main directory

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agopkcs11: re-open private key session inside a locked section
Nikos Mavrogiannopoulos [Fri, 10 Mar 2017 16:37:10 +0000 (17:37 +0100)] 
pkcs11: re-open private key session inside a locked section

This prevents clashes when the same operation is carried in other
threads.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopkcs11: introduced locks to PKCS#11 private key structure
Nikos Mavrogiannopoulos [Fri, 10 Mar 2017 16:12:50 +0000 (17:12 +0100)] 
pkcs11: introduced locks to PKCS#11 private key structure

This allows to run PKCS#11 private key operations such as signing
and decryption in parallel.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: introduced check for parallel operation (signatures) in PKCS#11 mode
Nikos Mavrogiannopoulos [Fri, 10 Mar 2017 16:04:20 +0000 (17:04 +0100)] 
tests: introduced check for parallel operation (signatures) in PKCS#11 mode

That is, verify that parallel signatures using a single gnutls_pkcs11_privkey_t
context work.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: scripts: suppress which errors
Alon Bar-Lev [Sun, 12 Mar 2017 13:05:41 +0000 (15:05 +0200)] 
tests: scripts: suppress which errors

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
9 years agopkcs11: during scan, leave the provider loop asap
Nikos Mavrogiannopoulos [Sat, 11 Mar 2017 11:08:21 +0000 (12:08 +0100)] 
pkcs11: during scan, leave the provider loop asap

This optimizes access when multiple provider modules are available,
by avoiding scanning irrelevant ones.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agoDo not attempt to parse a 32-bit integer if a packet is not 4 bytes.
Alex Gaynor [Sat, 11 Mar 2017 15:28:50 +0000 (10:28 -0500)] 
Do not attempt to parse a 32-bit integer if a packet is not 4 bytes.

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

Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
9 years agofuzz: document how to run AFL [ci skip]
Nikos Mavrogiannopoulos [Thu, 9 Mar 2017 14:50:24 +0000 (15:50 +0100)] 
fuzz: document how to run AFL [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agofuzz: added initial corpus for the OCSP request parser
Nikos Mavrogiannopoulos [Thu, 9 Mar 2017 09:57:28 +0000 (10:57 +0100)] 
fuzz: added initial corpus for the OCSP request parser

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agofuzz: added initial corpus for OCSP response parser
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 16:09:59 +0000 (17:09 +0100)] 
fuzz: added initial corpus for OCSP response parser

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agofuzz: added OCSP structure parsers
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 16:01:59 +0000 (17:01 +0100)] 
fuzz: added OCSP structure parsers

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agofuzz: increased minimized set of X.509 certificates
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 15:51:39 +0000 (16:51 +0100)] 
fuzz: increased minimized set of X.509 certificates

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoPKCS8/PKCS12: enforce a maximum number of iterations
Nikos Mavrogiannopoulos [Thu, 9 Mar 2017 11:57:41 +0000 (12:57 +0100)] 
PKCS8/PKCS12: enforce a maximum number of iterations

This prevents denial of service through very large iteration
counts. Issue found via oss-fuzz:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=434

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoDo not attempt to parse a 32-bit integer if a packet is not 4 bytes.
Alex Gaynor [Wed, 8 Mar 2017 19:52:38 +0000 (14:52 -0500)] 
Do not attempt to parse a 32-bit integer if a packet is not 4 bytes.

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

Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
9 years agoRevert ".gitlab-ci.yml: include coverage statistics of FIPS140-2 code"
Nikos Mavrogiannopoulos [Thu, 9 Mar 2017 10:25:54 +0000 (11:25 +0100)] 
Revert ".gitlab-ci.yml: include coverage statistics of FIPS140-2 code"

This reverts commit 603772688c4e37dae437b4cede12e25b9dd9f678.
The commit introduced a long wait for the coverage build without
and significant benefit (the extend of the FIPS140 code is limited
to have any impact on the overall coverage).

9 years agosysrng-linux: define _rnd_get_system_entropy unconditionally
Nikos Mavrogiannopoulos [Thu, 9 Mar 2017 09:52:59 +0000 (10:52 +0100)] 
sysrng-linux: define _rnd_get_system_entropy unconditionally

This fixes compilation in systems without getrandom().

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: dtls-stress: use X.509 certificates instead of openpgp
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 15:00:02 +0000 (16:00 +0100)] 
tests: dtls-stress: use X.509 certificates instead of openpgp

This will allow the test tool to operate even after openpgp certificates
are deprecated.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years ago.gitlab-ci.yml: added build without openpgp support
Nikos Mavrogiannopoulos [Tue, 7 Mar 2017 21:52:31 +0000 (22:52 +0100)] 
.gitlab-ci.yml: added build without openpgp support

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agodoc update
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 10:32:31 +0000 (11:32 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoAdded openpgp stub file
Nikos Mavrogiannopoulos [Tue, 7 Mar 2017 21:36:16 +0000 (22:36 +0100)] 
Added openpgp stub file

That allows disabling openpgp authentication and at the same time
retaining ABI compatibility with versions including openpgp.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agodoc update
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 14:00:06 +0000 (15:00 +0100)] 
doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: split PKCS#12 encoding from decoding tests
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 13:58:14 +0000 (14:58 +0100)] 
tests: split PKCS#12 encoding from decoding tests

Enhanced PKCS#12 encoding tests, with the encoding of a file
which contains a cert, a key and a CRL.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added PKCS#12 file decoding containing a CRL
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 13:47:20 +0000 (14:47 +0100)] 
tests: added PKCS#12 file decoding containing a CRL

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agocerttool: enhance to allow writing CRLs in PKCS#12 files
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 13:40:15 +0000 (14:40 +0100)] 
certtool: enhance to allow writing CRLs in PKCS#12 files

In addition fallback to DER when --load-crl fails importing a PEM
encoded CRL due to PEM issues.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added CRL decoding unit tests using certtool
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 13:21:30 +0000 (14:21 +0100)] 
tests: added CRL decoding unit tests using certtool

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: enhanced basic tests in CRL parsing
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 13:04:32 +0000 (14:04 +0100)] 
tests: enhanced basic tests in CRL parsing

That tests gnutls_x509_crl_get_crt_serial().

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agoRewritten gnutls_x509_rdn_get() and gnutls_x509_rdn_get2()
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 12:50:55 +0000 (13:50 +0100)] 
Rewritten gnutls_x509_rdn_get() and gnutls_x509_rdn_get2()

The new code re-uses the gnutls_x509_dn APIs instead of re-implementing.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: added checks for the old DN decoding functions
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 12:43:36 +0000 (13:43 +0100)] 
tests: added checks for the old DN decoding functions

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: do not run tests which require openpgp when it is disabled
Nikos Mavrogiannopoulos [Tue, 7 Mar 2017 21:39:20 +0000 (22:39 +0100)] 
tests: do not run tests which require openpgp when it is disabled

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years ago.gitlab-ci.yml: include coverage html output as artifact
Nikos Mavrogiannopoulos [Tue, 7 Mar 2017 21:47:55 +0000 (22:47 +0100)] 
.gitlab-ci.yml: include coverage html output as artifact

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agotests: x509-verify: print the keys on failure
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 12:22:59 +0000 (13:22 +0100)] 
tests: x509-verify: print the keys on failure

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agognutls_privkey_export_x509: doc update
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 12:17:15 +0000 (13:17 +0100)] 
gnutls_privkey_export_x509: doc update

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: split sign-verify test to RSA and ECDSA parts
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 12:07:08 +0000 (13:07 +0100)] 
tests: split sign-verify test to RSA and ECDSA parts

This allows parallelist and also helps identifying easier the
culprit on an error.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: adjusted for the removal of HMAC-MD5
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 10:52:25 +0000 (11:52 +0100)] 
tests: adjusted for the removal of HMAC-MD5

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agopriority: do not enable HMAC-MD5 by default
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 10:48:28 +0000 (11:48 +0100)] 
priority: do not enable HMAC-MD5 by default

While HMAC-MD5 is not yet broken, it is not used by any non-broken
or non-NULL ciphersuites (is only used with NULL and RC4), and as there
is not plan to introduce new ciphersuites with that MAC algorithm, there
is no point to include it in the default set of allowed algorithms.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: converted FIPS140-2 mode checks in Makefiles to run-time in scripts
Nikos Mavrogiannopoulos [Tue, 7 Mar 2017 22:10:43 +0000 (23:10 +0100)] 
tests: converted FIPS140-2 mode checks in Makefiles to run-time in scripts

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agognutls.h: introduced GNUTLS_E_TLS_PACKET_DECODING_ERROR [ci skip]
Nikos Mavrogiannopoulos [Wed, 8 Mar 2017 09:48:40 +0000 (10:48 +0100)] 
gnutls.h: introduced GNUTLS_E_TLS_PACKET_DECODING_ERROR [ci skip]

This is an alias to GNUTLS_E_UNEXPECTED_PACKET_LENGTH. That
allows distinguishing the alert from GNUTLS_E_RECORD_OVERFLOW.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
9 years agotests: crq: ignore lines for Security Level
Nikos Mavrogiannopoulos [Tue, 7 Mar 2017 20:53:51 +0000 (21:53 +0100)] 
tests: crq: ignore lines for Security Level

This allows running the test under FIPS140-2 mode.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agoax_code_coverage.m4: updated
Nikos Mavrogiannopoulos [Tue, 7 Mar 2017 20:39:12 +0000 (21:39 +0100)] 
ax_code_coverage.m4: updated

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years ago.gitlab-ci.yml: initialize submodules where needed (for tlsfuzzer run)
Nikos Mavrogiannopoulos [Mon, 6 Mar 2017 22:21:33 +0000 (23:21 +0100)] 
.gitlab-ci.yml: initialize submodules where needed (for tlsfuzzer run)

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>