]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
6 years agoMerge branch 'improve_fips_selftests' into 'master'
Nikos Mavrogiannopoulos [Wed, 18 Mar 2020 09:51:52 +0000 (09:51 +0000)] 
Merge branch 'improve_fips_selftests' into 'master'

Improve FIPS signatures self-tests

See merge request gnutls/gnutls!1206

6 years agoValidate EC_PARAMS for EdDSA keys
Jakub Jelen [Wed, 11 Mar 2020 17:31:49 +0000 (18:31 +0100)] 
Validate EC_PARAMS for EdDSA keys

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
6 years agopubkey: Validate input parameters in pubkey_import_ecc_raw
Jakub Jelen [Fri, 6 Mar 2020 12:41:25 +0000 (13:41 +0100)] 
pubkey: Validate input parameters in pubkey_import_ecc_raw

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
6 years agotests: Verify writing and reading of ECDSA public keys from PKCS#11
Jakub Jelen [Fri, 28 Feb 2020 17:50:53 +0000 (18:50 +0100)] 
tests: Verify writing and reading of ECDSA public keys from PKCS#11

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
6 years agotests: Verify writing and reading of EdDSA public keys
Jakub Jelen [Fri, 28 Feb 2020 17:45:14 +0000 (18:45 +0100)] 
tests: Verify writing and reading of EdDSA public keys

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
6 years agopkcs11_write: Copy data to avoid double-free crashes and properly encode EC_POINT...
Jakub Jelen [Fri, 28 Feb 2020 17:40:42 +0000 (18:40 +0100)] 
pkcs11_write: Copy data to avoid double-free crashes and properly encode EC_POINT attribute

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
6 years ago.lgtm.yml: work around issues in LGTM system
Nikos Mavrogiannopoulos [Sat, 14 Mar 2020 22:15:45 +0000 (23:15 +0100)] 
.lgtm.yml: work around issues in LGTM system

This disables dependency tracking and removes the gnulib
tests to work-around a failure build gl/.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agobootstrap.conf: do not bring tests in gnulib clones (src/unistring)
Nikos Mavrogiannopoulos [Thu, 12 Mar 2020 19:46:58 +0000 (20:46 +0100)] 
bootstrap.conf: do not bring tests in gnulib clones (src/unistring)

These tests are not being run, and they can cause issues as
in !1208.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years ago.lgtm.yml: no longer bring nettle from master
Nikos Mavrogiannopoulos [Sat, 14 Mar 2020 21:39:05 +0000 (22:39 +0100)] 
.lgtm.yml: no longer bring nettle from master

The system used has already a sufficiently recent version.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agocrypto-selftests-pk.c: Use deterministic signatures in test_known_sig()
Anderson Toshiyuki Sasaki [Thu, 4 Apr 2019 13:45:02 +0000 (15:45 +0200)] 
crypto-selftests-pk.c: Use deterministic signatures in test_known_sig()

Use deterministic signatures for ECDSA and DSA in test_known_sig().  Do
not call test_known_sig() for non-deterministic algorithms.  Do not run
PK_TEST() for algorithms tested with PK_KNOWN_TEST().

The deterministic algorithms are used if in FIPS-140 POST or if FIPS-140
mode is disabled.  When called explicitly with FIPS-140 mode enabled,
the pairwise-consistency test (PK_TEST()) is used instead.

test_known_sig() was modified to support only deterministic algorithms.
The "deterministic" parameter was replaced with the "flags" parameter
through which the flags to be used in gnutls_privkey_sign_data() are
passed.

The hard-coded values for the ECDSA and DSA signatures were replaced
with the values corresponding to the deterministic signatures to be used
in known answer tests.  The unused values for GOST signatures were
removed.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agocrypto-selftests-pk.c: Use specified key in test_sig()
Anderson Toshiyuki Sasaki [Thu, 5 Mar 2020 14:54:06 +0000 (15:54 +0100)] 
crypto-selftests-pk.c: Use specified key in test_sig()

Previously, test_sig() would use the same key regardless the value
provided in bits parameter.  The changes introduced make test_sig() to
choose the key according to the value provided in bits.

For RSA, only 2048 bits key is available for testing.  The calls were
adjusted accordingly.

Introduced 2048 bits DSA key in test_sig().  Removed unused 512 bits
key, leaving only the 2048 bits key available.

For GOST, use the same keys for test_sig() and test_known_sig().  Remove
the unused keys.

Reorder constant values and change variables names for better
readability.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agotests/sign-is-secure: fix off-by-one error
Daiki Ueno [Mon, 16 Mar 2020 10:09:29 +0000 (11:09 +0100)] 
tests/sign-is-secure: fix off-by-one error

Reported by Peter Dettman in:
https://gitlab.com/gnutls/gnutls/-/issues/128#note_304892538

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoalgorithms: properly calculate hash strength for Ed448
Daiki Ueno [Mon, 16 Mar 2020 10:03:41 +0000 (11:03 +0100)] 
algorithms: properly calculate hash strength for Ed448

The Ed448 signature scheme internally uses XOF (SHAKE256) as the hash
function with 114-octet output.  According to FIPS-202, the strength
against collisions is calculated as:

  min(114*8/2, 256) = 256

Reported by Peter Dettman in:
https://gitlab.com/gnutls/gnutls/-/issues/128#note_304892538

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'x509-version' into 'master'
Dmitry Baryshkov [Sun, 15 Mar 2020 10:03:11 +0000 (10:03 +0000)] 
Merge branch 'x509-version' into 'master'

lib/x509: use common routine for parsing data version

See merge request gnutls/gnutls!1209

6 years agolib/x509: use common routine for parsing data version
Dmitry Baryshkov [Thu, 12 Mar 2020 09:56:37 +0000 (12:56 +0300)] 
lib/x509: use common routine for parsing data version

OSS Fuzzer noted an issue in parsing (incorrect) CRL files with
zero-length version field. Certificate parser does not have this issue,
while CRL and OCSP Request and Response parsers shows this problem. To
remove code duplication extract common function and use it from all four
parsers.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agocrypto-selftests-pk.c: Fix PK_KNOWN_TEST and PK_TEST
Anderson Toshiyuki Sasaki [Thu, 4 Apr 2019 15:22:04 +0000 (17:22 +0200)] 
crypto-selftests-pk.c: Fix PK_KNOWN_TEST and PK_TEST

Previously, when multiple tests where declared in sequence using one of
the macros, only the first test would be executed.  This happened
because a check for the GNUTLS_SELF_TEST_FLAG_ALL was embedded in the
macro.  To allow more than one test to be executed in sequence, the
check for the flag was removed from both macros.

To keep the previous behaviour (execute only the first test) the check
for the flag was moved to be after the first test, except for RSA since
the RSA encryption test must be executed in FIPS mode.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agocrypto-selftests-pk.c: Move hardcoded values to the top
Anderson Toshiyuki Sasaki [Wed, 3 Apr 2019 11:40:04 +0000 (13:40 +0200)] 
crypto-selftests-pk.c: Move hardcoded values to the top

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
6 years agoMerge branch 'fix-crq-ext' into 'master'
Dmitry Baryshkov [Wed, 11 Mar 2020 09:21:12 +0000 (09:21 +0000)] 
Merge branch 'fix-crq-ext' into 'master'

x509: drop endless loop in print_extensions

See merge request gnutls/gnutls!1205

6 years agoMerge branch 'tmp-static-assert' into 'master'
Daiki Ueno [Wed, 11 Mar 2020 09:20:03 +0000 (09:20 +0000)] 
Merge branch 'tmp-static-assert' into 'master'

lib: use static assertion to check enum values

See merge request gnutls/gnutls!1201

6 years agox509: apply same fix to print_crq
Dmitry Baryshkov [Tue, 10 Mar 2020 19:42:02 +0000 (22:42 +0300)] 
x509: apply same fix to print_crq

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agox509: apply same fix to print_crl
Dmitry Baryshkov [Tue, 10 Mar 2020 19:41:54 +0000 (22:41 +0300)] 
x509: apply same fix to print_crl

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agox509: drop endless loop in print_extensions
Dmitry Baryshkov [Tue, 10 Mar 2020 09:12:36 +0000 (12:12 +0300)] 
x509: drop endless loop in print_extensions

If crq is malformed in extensions part, print_extensions() might loop
endlessly because gnutls_x509_crq_get_extension_info would return
unhandled GNUTLS_ASN1_DER_ERROR looping over extension index, rather
than bailing out. Fix this by handling this error code properly. Found
thanks to oss-fuzz.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agolib: use static assertion to check enum values
Daiki Ueno [Sat, 29 Feb 2020 16:01:10 +0000 (17:01 +0100)] 
lib: use static assertion to check enum values

We previously had checks of enum values with '#if', such as below:

 #define GNUTLS_EXTENSION_MAX_VALUE 31

 typedef enum extensions_t {
         ...
         GNUTLS_EXTENSION_MAX /* not real extension - used for iterators */
 } extensions_t;

 /* we must provide at least 16 extensions for users to register */
 #if GNUTLS_EXTENSION_MAX_VALUE - GNUTLS_EXTENSION_MAX < 16
 # error not enough extension types
 #endif

This doesn't work as expected; because GNUTLS_EXTENSION_MAX is not
defined as a preprocessor macro, it always expands to 0.  To properly
do this check, we need to use static assert as provided as the
'verify' macro in gnulib.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agohello_ext: use 64-bit integer to track extensions
Daiki Ueno [Sun, 1 Mar 2020 09:16:08 +0000 (10:16 +0100)] 
hello_ext: use 64-bit integer to track extensions

We currently have 26 predefined extensions, allowing the user to
define 5 extra as tested in tests/handshake-large-packet.c.  However,
if we introduce one more, session->internals.used_exts exceeds.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'fix-issuer-sign-tool' into 'master'
Dmitry Baryshkov [Tue, 10 Mar 2020 09:19:26 +0000 (09:19 +0000)] 
Merge branch 'fix-issuer-sign-tool' into 'master'

lib/x509/output.c: remove occasioinal memory leak in print_issuer_sign_tool()

See merge request gnutls/gnutls!1203

6 years agoMerge branch 'crl-crq-fuzz' into 'master'
Dmitry Baryshkov [Mon, 9 Mar 2020 18:28:44 +0000 (18:28 +0000)] 
Merge branch 'crl-crq-fuzz' into 'master'

fuzz: add simple x509 certificate requests fuzzer

Closes #903

See merge request gnutls/gnutls!1204

6 years agofuzz: add simple x509 certificate requests and revocation lists fuzzers
Dmitry Baryshkov [Fri, 6 Mar 2020 22:05:45 +0000 (01:05 +0300)] 
fuzz: add simple x509 certificate requests and revocation lists fuzzers

Add x509 certificate requests and certificate revocation lists fuzzers.
Use data from tests/cert-tests as a starting seed for the corpora.

Fixes #903

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'tmp-releases' into 'master'
Nikos Mavrogiannopoulos [Mon, 9 Mar 2020 14:12:52 +0000 (14:12 +0000)] 
Merge branch 'tmp-releases' into 'master'

RELEASES.md: describe the release process [ci skip]

See merge request gnutls/gnutls!1202

6 years agolib/x509/output.c: remove occasioinal memory leak in print_issuer_sign_tool()
Dmitry Baryshkov [Fri, 6 Mar 2020 22:09:55 +0000 (01:09 +0300)] 
lib/x509/output.c: remove occasioinal memory leak in print_issuer_sign_tool()

Remove memory leak in error handling in print_issuer_sign_tool() by
moving asn1_delete_structure to the end of the function.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'tmp-gen-suppressions' into 'master'
Nikos Mavrogiannopoulos [Fri, 6 Mar 2020 19:58:48 +0000 (19:58 +0000)] 
Merge branch 'tmp-gen-suppressions' into 'master'

Let valgrind suggest suppression rules on any issue it finds

See merge request gnutls/gnutls!1195

6 years agoRELEASES.md: describe the release process
Nikos Mavrogiannopoulos [Mon, 2 Mar 2020 19:28:21 +0000 (20:28 +0100)] 
RELEASES.md: describe the release process

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoAdd support for loading EdDSA keys from PKCS#11 and using them
Jakub Jelen [Fri, 28 Feb 2020 15:18:58 +0000 (16:18 +0100)] 
Add support for loading EdDSA keys from PKCS#11 and using them

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
6 years agoMerge branch 'tmp-keylog-func' into 'master'
Daiki Ueno [Thu, 27 Feb 2020 10:47:44 +0000 (10:47 +0000)] 
Merge branch 'tmp-keylog-func' into 'master'

keylogfile: simplify the callback mechanism

See merge request gnutls/gnutls!1196

6 years agoMerge branch 'macosx-aarch64-accel' into 'master'
Nikos Mavrogiannopoulos [Tue, 25 Feb 2020 18:37:58 +0000 (18:37 +0000)] 
Merge branch 'macosx-aarch64-accel' into 'master'

Adding missing macosx directory for aarch64 acceleration

See merge request gnutls/gnutls!1198

6 years agoAdding missing macosx directory for aarch64 acceleration
Ross Nicholson [Sun, 23 Feb 2020 07:55:43 +0000 (07:55 +0000)] 
Adding missing macosx directory for aarch64 acceleration

Signed-off-by: Ross Nicholson <phunkyfish@gmail.com>
6 years agokeylogfile: simplify the callback mechanism
Daiki Ueno [Fri, 21 Feb 2020 15:38:29 +0000 (16:38 +0100)] 
keylogfile: simplify the callback mechanism

This partially reverts commit 97117556 with a simpler interface.  The
original intention of having the callback mechanism was to reuse it
for monitoring QUIC encryption changes.  However, it turned out to be
insufficient because such changes must be emitted after a new epoch is
ready.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoAdd valgrind suppression for fun:decode_complex_string.isra.0
Tim Rühsen [Fri, 21 Feb 2020 12:14:48 +0000 (13:14 +0100)] 
Add valgrind suppression for fun:decode_complex_string.isra.0

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoAdd --gen-suppressions=all to valgrind to iautomatically generate suppression rules
Tim Rühsen [Fri, 21 Feb 2020 12:14:03 +0000 (13:14 +0100)] 
Add --gen-suppressions=all to valgrind to iautomatically generate suppression rules

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoMerge branch 'pbkdf2' into 'master'
Dmitry Baryshkov [Fri, 21 Feb 2020 11:13:47 +0000 (11:13 +0000)] 
Merge branch 'pbkdf2' into 'master'

lib: drop unused pbkdf2 helpers

See merge request gnutls/gnutls!1194

6 years agolib: drop unused pbkdf2 helpers
Dmitry Baryshkov [Tue, 18 Feb 2020 11:35:37 +0000 (14:35 +0300)] 
lib: drop unused pbkdf2 helpers

Updated pbkdf2 API in GnuTLS removed the need for PBKDF2 helpers, drop
them now.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'tmp-travis-bison' into 'master'
Nikos Mavrogiannopoulos [Tue, 11 Feb 2020 10:24:49 +0000 (10:24 +0000)] 
Merge branch 'tmp-travis-bison' into 'master'

TravisCI: Add bison

See merge request gnutls/gnutls!1192

6 years agoMerge branch 'wip-save-ocsp-multi' into 'master'
Tim Rühsen [Sun, 9 Feb 2020 14:59:00 +0000 (14:59 +0000)] 
Merge branch 'wip-save-ocsp-multi' into 'master'

Add option to store all stapled OCSP responses to gnutls-cli

See merge request gnutls/gnutls!1189

6 years agognutls-cli: Add option to store all stapled OCSP responses
Fiona Klute [Sat, 8 Feb 2020 22:47:17 +0000 (23:47 +0100)] 
gnutls-cli: Add option to store all stapled OCSP responses

Note that there's a small modification to the behavior of the existing
--ocsp-save option: If there is no stapled OCSP response the output
file is still created and will be empty.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
6 years agoTravisCI: Add bison [skip ci]
Tim Rühsen [Sat, 8 Feb 2020 17:04:27 +0000 (18:04 +0100)] 
TravisCI: Add bison [skip ci]

The latest gnulib needs a newer bison than TravisCI OSX has.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoMerge branch 'tmp-lgtm' into 'master'
Tim Rühsen [Sat, 8 Feb 2020 16:59:35 +0000 (16:59 +0000)] 
Merge branch 'tmp-lgtm' into 'master'

.lgtm.yml: Fix --disable-documentation to --disable-doc [skip ci]

See merge request gnutls/gnutls!1191

6 years agoMerge branch 'tmp-keylog-hook' into 'master'
Daiki Ueno [Fri, 7 Feb 2020 19:54:33 +0000 (19:54 +0000)] 
Merge branch 'tmp-keylog-hook' into 'master'

keylogfile: generalize with a callback

Closes #852

See merge request gnutls/gnutls!1184

6 years agokeylogfile: generalize with a callback
Daiki Ueno [Sun, 2 Feb 2020 07:13:50 +0000 (08:13 +0100)] 
keylogfile: generalize with a callback

This refactors the keylogfile mechanism by adding a callback to get
notified when a new secret is derived and installed.  That way,
consumers can implement custom logging feature per session, which is
particularly useful in QUIC implementation.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years ago.lgtm.yml: Fix --disable-documentation to --disable-doc [skip ci]
Tim Rühsen [Fri, 7 Feb 2020 15:55:11 +0000 (16:55 +0100)] 
.lgtm.yml: Fix --disable-documentation to --disable-doc [skip ci]

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoMerge branch 'tmp-gnulib-update' into 'master'
Tim Rühsen [Fri, 7 Feb 2020 08:40:27 +0000 (08:40 +0000)] 
Merge branch 'tmp-gnulib-update' into 'master'

Update gnulib to fix building on OSX 10.9

Closes #926

See merge request gnutls/gnutls!1190

6 years agocfg.mk: Exclude sc_prohibit_gnu_make_extensions from syntax-check
Tim Rühsen [Thu, 6 Feb 2020 15:48:48 +0000 (16:48 +0100)] 
cfg.mk: Exclude sc_prohibit_gnu_make_extensions from syntax-check

This new gnulib check does not work with GNU awk 5.0.1 and GNU make 4.2.1.

References:
https://lists.gnu.org/archive/html/bug-gnulib/2019-05/msg00095.html
https://lists.gnu.org/archive/html/bug-gnulib/2019-06/msg00040.html
https://lists.gnu.org/archive/html/bug-gnulib/2019-07/msg00046.html

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoUpdate gnulib to fix building on OSX 10.9
Tim Rühsen [Thu, 6 Feb 2020 14:52:50 +0000 (15:52 +0100)] 
Update gnulib to fix building on OSX 10.9

Fixes #926

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoMerge branch 'openssl-min1.2' into 'master'
Tim Rühsen [Thu, 6 Feb 2020 14:00:54 +0000 (14:00 +0000)] 
Merge branch 'openssl-min1.2' into 'master'

testcompat-openssl: improve testing against secured OpenSSL versions.

See merge request gnutls/gnutls!1168

6 years agotestcompat-openssl: improve testing against secured OpenSSL versions.
Dimitri John Ledkov [Tue, 14 Jan 2020 15:14:59 +0000 (15:14 +0000)] 
testcompat-openssl: improve testing against secured OpenSSL versions.

In Debian, and soon Ubuntu, OpenSSL is compiled with SECLEVEL=2 and
requiring minimum TLSv1.2. However, smaller hashes/keys/versions are
allowed if one enables SECLEVEL=1. Do so when testing pre v1.2 algos,
and thus enabling testing more compatability combinations.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
6 years agoMerge branch 'gost28147' into 'master'
Dmitry Baryshkov [Wed, 5 Feb 2020 17:34:17 +0000 (17:34 +0000)] 
Merge branch 'gost28147' into 'master'

nettle/gost: gost28147: require calling set_param before set_key

See merge request gnutls/gnutls!1188

6 years agonettle/gost: gost28147: require calling set_param before set_key
Dmitry Baryshkov [Wed, 5 Feb 2020 13:06:30 +0000 (16:06 +0300)] 
nettle/gost: gost28147: require calling set_param before set_key

Require selecting parameter set before setting the key. There is no need
to provide default setting, if a param is always selected anyway.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'tmp-kdf-api' into 'master'
Daiki Ueno [Tue, 4 Feb 2020 10:43:48 +0000 (10:43 +0000)] 
Merge branch 'tmp-kdf-api' into 'master'

crypto-api: add generic crypto functions for KDF

Closes #851 and #813

See merge request gnutls/gnutls!1186

6 years agotests: skip pkcs12-gost under GNUTLS_FORCE_FIPS_MODE
Daiki Ueno [Mon, 3 Feb 2020 04:18:29 +0000 (05:18 +0100)] 
tests: skip pkcs12-gost under GNUTLS_FORCE_FIPS_MODE

The MAC algorithm used in the PBKDF2 is actually prohibited in the
FIPS mode and previously there wasn't a check for that.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoprivkey_pkcs8: remove unused #include <nettle/pbkdf2.h>
Daiki Ueno [Sun, 2 Feb 2020 16:58:56 +0000 (17:58 +0100)] 
privkey_pkcs8: remove unused #include <nettle/pbkdf2.h>

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agopkcs7-crypt: refactor using gnutls_pbkdf2
Daiki Ueno [Sun, 2 Feb 2020 16:57:37 +0000 (17:57 +0100)] 
pkcs7-crypt: refactor using gnutls_pbkdf2

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agopkcs12: refactor using gnutls_pbkdf2
Daiki Ueno [Sun, 2 Feb 2020 15:15:51 +0000 (16:15 +0100)] 
pkcs12: refactor using gnutls_pbkdf2

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agosecrets: refactor using gnutls_hkdf_{extract,expand}
Daiki Ueno [Sun, 2 Feb 2020 15:00:56 +0000 (16:00 +0100)] 
secrets: refactor using gnutls_hkdf_{extract,expand}

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agocrypto-api: add generic crypto functions for KDF
Daiki Ueno [Sun, 2 Feb 2020 13:44:05 +0000 (14:44 +0100)] 
crypto-api: add generic crypto functions for KDF

This exposes HKDF and PBKDF2 functions from the library.  Instead of
defining a single KDF interface as in PKCS #11, this patch defines 3
distinct functions for HKDF-Extract, HKDF-Expand, and PBKDF2
derivation, so that we can take advantage of compile time checking of
necesssary parameters.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agoMerge branch 'mcatanzaro/session-pack-leak' into 'master'
Daiki Ueno [Sun, 2 Feb 2020 18:16:14 +0000 (18:16 +0000)] 
Merge branch 'mcatanzaro/session-pack-leak' into 'master'

session_pack: fix leak in error path

See merge request gnutls/gnutls!1185

6 years agosession_pack: fix leak in error path
Michael Catanzaro [Sun, 2 Feb 2020 15:47:25 +0000 (09:47 -0600)] 
session_pack: fix leak in error path

If called at the wrong time, it allocates the buffer sb and forgets to
clear it.

Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
6 years ago.mailmap: map Dmitry's email to a single name [ci skip]
Nikos Mavrogiannopoulos [Sat, 1 Feb 2020 22:09:01 +0000 (23:09 +0100)] 
.mailmap: map Dmitry's email to a single name [ci skip]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoNEWS: fixed issue number for 448 3.6.12 gnutls_3_6_12
Nikos Mavrogiannopoulos [Sat, 1 Feb 2020 22:02:55 +0000 (23:02 +0100)] 
NEWS: fixed issue number for 448

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoNEWS: refactored for release
Nikos Mavrogiannopoulos [Sat, 1 Feb 2020 21:54:13 +0000 (22:54 +0100)] 
NEWS: refactored for release

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agohooks.m4: bumped so-version
Nikos Mavrogiannopoulos [Sat, 1 Feb 2020 21:44:41 +0000 (22:44 +0100)] 
hooks.m4: bumped so-version

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoMerge branch 'nettle-master-gostdsa' into 'master'
Nikos Mavrogiannopoulos [Fri, 31 Jan 2020 07:49:09 +0000 (07:49 +0000)] 
Merge branch 'nettle-master-gostdsa' into 'master'

nettle/gost: support use GOST DSA support from master branch

See merge request gnutls/gnutls!1183

6 years agonettle/gost: support use GOST DSA support from master branch
Dmitry Baryshkov [Wed, 29 Jan 2020 17:00:53 +0000 (20:00 +0300)] 
nettle/gost: support use GOST DSA support from master branch

Use GOST DSA and GOST curves provided by Nettle's master branch.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'fix-pkcs12-iter' into 'master'
Dmitry Baryshkov [Tue, 28 Jan 2020 14:39:57 +0000 (14:39 +0000)] 
Merge branch 'fix-pkcs12-iter' into 'master'

pkcs12: do not go try calculating pbkdf2 with 0 iterations

See merge request gnutls/gnutls!1182

6 years agopkcs12: do not go try calculating pbkdf2 with 0 iterations
Dmitry Baryshkov [Tue, 28 Jan 2020 10:05:14 +0000 (13:05 +0300)] 
pkcs12: do not go try calculating pbkdf2 with 0 iterations

Nettle will abort on a call to pbkdf2 if iterations is 0. Add check to
GnuTLS PKCS12 GOST code to check that iter is not 0.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agoMerge branch 'localthreads' into 'master'
Tim Rühsen [Tue, 28 Jan 2020 09:47:06 +0000 (09:47 +0000)] 
Merge branch 'localthreads' into 'master'

add support for local threads with studio and ibm compilers

See merge request gnutls/gnutls!1181

6 years agoadd support for local threads with studio and ibm compilers
Bjoern Jacke [Mon, 27 Jan 2020 18:40:53 +0000 (19:40 +0100)] 
add support for local threads with studio and ibm compilers

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
6 years agoMerge branch 'tmp-20200126-bashismintest' into 'master'
Tim Rühsen [Mon, 27 Jan 2020 08:39:22 +0000 (08:39 +0000)] 
Merge branch 'tmp-20200126-bashismintest' into 'master'

Avoid pushd/popd bashism in testsuite

See merge request gnutls/gnutls!1180

6 years agotlsfuzzer: optimized tests for CI and enabled x448
Nikos Mavrogiannopoulos [Sun, 26 Jan 2020 20:45:29 +0000 (21:45 +0100)] 
tlsfuzzer: optimized tests for CI and enabled x448

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agotlsfuzzer: fix test-tls13-large-number-of-extensions.py
Nikos Mavrogiannopoulos [Sun, 26 Jan 2020 20:32:18 +0000 (21:32 +0100)] 
tlsfuzzer: fix test-tls13-large-number-of-extensions.py

This test requires a TLS-1.3-only server as its tests clash with
extensions supported by a TLS-1.2 server. Ensure that the extensions
that overlap with TLS-1.2 are not manipulated as we don't have
a pure TLS-1.3-only implementation.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoGOSTR341194: mark as insecure for digital signatures
Nikos Mavrogiannopoulos [Tue, 21 Jan 2020 09:32:59 +0000 (10:32 +0100)] 
GOSTR341194: mark as insecure for digital signatures

Although there are no practical attacks known on the algorithm, the practical
strength of the algorithm is weaker than the theoritical. In addition this algorithm
is already considered legacy, and as such mark it as insecure for digital
signatures to reduce the attack surface.

Relates: #909

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
6 years agoAvoid pushd/popd bashism in testsuite
Andreas Metzler [Sun, 26 Jan 2020 17:39:18 +0000 (18:39 +0100)] 
Avoid pushd/popd bashism in testsuite

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
6 years agoMerge branch 'tmp-ci-make-j' into 'master'
Tim Rühsen [Sun, 26 Jan 2020 15:22:51 +0000 (15:22 +0000)] 
Merge branch 'tmp-ci-make-j' into 'master'

Use 'make -j' with higher values for CI builds and tests

Closes #897

See merge request gnutls/gnutls!1154

6 years agotests/key-material-dtls.c: Try again on GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED
Tim Rühsen [Mon, 20 Jan 2020 10:48:50 +0000 (11:48 +0100)] 
tests/key-material-dtls.c: Try again on GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED

This fixes issues on the CI cross-runners with 'make -jN', N > 1.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoUse make with crafted -j for CI builds and tests
Tim Rühsen [Sat, 4 Jan 2020 13:37:46 +0000 (14:37 +0100)] 
Use make with crafted -j for CI builds and tests

This speeds up the Gitlab CI runners. E.g. measured timings of the
Debian.x86_64 runner show ~40% speedup (down from 38 to 23 minutes).

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agoMerge branch 'tmp-update-tlsfuzzer' into 'master'
Nikos Mavrogiannopoulos [Sun, 26 Jan 2020 12:37:38 +0000 (12:37 +0000)] 
Merge branch 'tmp-update-tlsfuzzer' into 'master'

tlsfuzzer: updated to latest upstream

Closes #907

See merge request gnutls/gnutls!1179

6 years agotests: updated tlsfuzzer tests to latest version
Nikos Mavrogiannopoulos [Sat, 25 Jan 2020 21:28:32 +0000 (22:28 +0100)] 
tests: updated tlsfuzzer tests to latest version

This adds new tests, reduces running time, and removes test-tls13-obsolete-curves.py.
The latter introduced too pendantic tests on curves we don't implement,
and requires significant changes to passing with limited benefit. For example
it requires the server to error on mismatching entries (and we simply ignore
them). As its value is low (we do not target to be a reference implementation
for testing broken clients), it was removed.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agokey shares: avoid using internal errors
Nikos Mavrogiannopoulos [Sat, 25 Jan 2020 21:02:48 +0000 (22:02 +0100)] 
key shares: avoid using internal errors

On unknown curves or illegal parameters, make sure we return the
right error code which will translate to the appropriate alert.

Resolves: #907

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoMerge branch 'tmp-fuzzers-update' into 'master'
Nikos Mavrogiannopoulos [Sat, 25 Jan 2020 12:34:04 +0000 (12:34 +0000)] 
Merge branch 'tmp-fuzzers-update' into 'master'

fuzz: update ed448 fuzzer traces and other fuzz improvements

See merge request gnutls/gnutls!1177

6 years agoMerge branch 'tmp-gl-lgpl2' into 'master'
Tim Rühsen [Sat, 25 Jan 2020 12:06:36 +0000 (12:06 +0000)] 
Merge branch 'tmp-gl-lgpl2' into 'master'

Create files in gl/ licenced lgpl2+ instead of lgpl3+

See merge request gnutls/gnutls!1178

6 years agofuzz: fixed Ed448 fuzzer traces
Nikos Mavrogiannopoulos [Fri, 24 Jan 2020 22:12:07 +0000 (23:12 +0100)] 
fuzz: fixed Ed448 fuzzer traces

The fuzzer files for ed448 were the reverse for client and server.
Enhanced the fuzzer tools to run a single fuzzer, and added more
clear documentation on how to generate and manually test the fuzzer
outputs.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoREADME-adding-traces.md: updated with more precise information
Nikos Mavrogiannopoulos [Fri, 24 Jan 2020 22:11:34 +0000 (23:11 +0100)] 
README-adding-traces.md: updated with more precise information

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agofuzzers: added ed448 keys
Nikos Mavrogiannopoulos [Fri, 24 Jan 2020 21:57:49 +0000 (22:57 +0100)] 
fuzzers: added ed448 keys

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoCreate files in gl/ licenced lgpl2+ instead of lgpl3+
Tim Rühsen [Sat, 25 Jan 2020 10:18:09 +0000 (11:18 +0100)] 
Create files in gl/ licenced lgpl2+ instead of lgpl3+

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
6 years agofuzzers: when provided with a parameter they will run on a single file
Nikos Mavrogiannopoulos [Fri, 24 Jan 2020 21:53:50 +0000 (22:53 +0100)] 
fuzzers: when provided with a parameter they will run on a single file

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
6 years agoMerge branch 'fix-gost-nettle-master' into 'master'
Dmitry Baryshkov [Sat, 25 Jan 2020 05:08:06 +0000 (05:08 +0000)] 
Merge branch 'fix-gost-nettle-master' into 'master'

lib/nettle/gost: restore compatibility with nettle master

See merge request gnutls/gnutls!1176

6 years ago.gitlab-ci.yml: remove --disable-gost from nettle-master test
Dmitry Baryshkov [Fri, 24 Jan 2020 19:04:41 +0000 (22:04 +0300)] 
.gitlab-ci.yml: remove --disable-gost from nettle-master test

Remove --disable-gost switch from the test using Nettle's master branch
as GnuTLS is now compatible again with nettle/master.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years agolib/nettle/gost: restore compatibility with nettle master
Dmitry Baryshkov [Thu, 23 Jan 2020 10:07:23 +0000 (13:07 +0300)] 
lib/nettle/gost: restore compatibility with nettle master

Use newer format of ecc curve data if curve448 support is detected.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
6 years ago.gitlab-ci.yml: force running jobs on linux runners
Nikos Mavrogiannopoulos [Fri, 24 Jan 2020 15:38:15 +0000 (16:38 +0100)] 
.gitlab-ci.yml: force running jobs on linux runners

There are shared windows runners in gitlab, that will fail
running our jobs.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
6 years agoMerge branch 'legacy-gost-512' into 'master'
Nikos Mavrogiannopoulos [Fri, 24 Jan 2020 13:46:20 +0000 (13:46 +0000)] 
Merge branch 'legacy-gost-512' into 'master'

x509: include digestParamSet into GOST 512-bit curves A and B params

See merge request gnutls/gnutls!1173

6 years agoMerge branch 'tmp-ed448' into 'master'
Daiki Ueno [Fri, 24 Jan 2020 07:31:54 +0000 (07:31 +0000)] 
Merge branch 'tmp-ed448' into 'master'

algorithms: implement X448 key exchange and Ed448 signature scheme

See merge request gnutls/gnutls!984

6 years agofuzz: import key, certificate, and traces using Ed448
Daiki Ueno [Thu, 23 Jan 2020 15:25:43 +0000 (16:25 +0100)] 
fuzz: import key, certificate, and traces using Ed448

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agotlsfuzzer: enable tests for X448
Daiki Ueno [Wed, 22 Jan 2020 04:25:19 +0000 (05:25 +0100)] 
tlsfuzzer: enable tests for X448

Signed-off-by: Daiki Ueno <dueno@redhat.com>