]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
5 years agoinih: remove unused code
Daiki Ueno [Mon, 14 Sep 2020 06:31:17 +0000 (08:31 +0200)] 
inih: remove unused code

This avoids -fanalyzer false-positive in GCC 10:
https://bugzilla.redhat.com/show_bug.cgi?id=1878600
as well as the cppcheck warning:
"variableScope:lib/inih/ini.c:99,style,The scope of the variable 'start' can be reduced."

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-ametzler-1090-testsuite' into 'master'
Daiki Ueno [Mon, 21 Sep 2020 05:25:23 +0000 (05:25 +0000)] 
Merge branch 'tmp-ametzler-1090-testsuite' into 'master'

Fix inconsistent handling of $SERV environment variable in testsuite

Closes #1090

See merge request gnutls/gnutls!1331

5 years agopriority: add Ed448 to SECURE192 signing algorithms
Daiki Ueno [Sun, 20 Sep 2020 15:49:17 +0000 (17:49 +0200)] 
priority: add Ed448 to SECURE192 signing algorithms

Reported Vladimír Čunát in:
https://gitlab.com/gnutls/gnutls/-/merge_requests/984#note_349374656

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'rsa_privkey_prive' into 'master'
Daiki Ueno [Sun, 20 Sep 2020 15:34:26 +0000 (15:34 +0000)] 
Merge branch 'rsa_privkey_prive' into 'master'

Make private exponent optional in gnutls_privkey_import_rsa_raw()

See merge request gnutls/gnutls!1323

5 years agotestsuite: Fix $SERV / $GNUTLS_SERV inconsistency
Andreas Metzler [Sat, 19 Sep 2020 08:57:04 +0000 (10:57 +0200)] 
testsuite: Fix $SERV / $GNUTLS_SERV inconsistency

Some tests did not support overriding the PATH to gnutls-serv by setting
the environment variable SERV but used GNUTLS_SERV instead.

Closes #1090

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
5 years agoIn testsuite scripts use "$@" instead of $*.
Andreas Metzler [Fri, 18 Sep 2020 11:55:06 +0000 (13:55 +0200)] 
In testsuite scripts use "$@" instead of $*.

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
5 years agobuild: remove dead assignments
Daiki Ueno [Sun, 13 Sep 2020 15:19:32 +0000 (17:19 +0200)] 
build: remove dead assignments

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agospki: work around GCC 10 -Warray-bounds false-positive
Daiki Ueno [Tue, 8 Sep 2020 17:55:14 +0000 (19:55 +0200)] 
spki: work around GCC 10 -Warray-bounds false-positive

Suggested by Martin Sebor in:
https://bugzilla.redhat.com/show_bug.cgi?id=1876801#c1

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotls13/session_ticket: remove _gnutls13_session_ticket_unset
Daiki Ueno [Tue, 8 Sep 2020 17:51:07 +0000 (19:51 +0200)] 
tls13/session_ticket: remove _gnutls13_session_ticket_unset

The function was not really useful because _gnutls_free_datum()
has a NULL check as in free().  This also makes GCC 10 happy if
-Warray-bounds=2 is specified:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96984

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: allow clock_nanosleep in seccomp tests
Daiki Ueno [Mon, 7 Sep 2020 07:52:52 +0000 (09:52 +0200)] 
tests: allow clock_nanosleep in seccomp tests

The nanosleep wrapper in glibc has changed the implementation using
the clock_nanosleep syscall:
https://sourceware.org/git/?p=glibc.git;a=commit;h=3537ecb49cf7177274607004c562d6f9ecc99474

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: bump build environment to Fedora 32
Daiki Ueno [Mon, 7 Sep 2020 07:52:09 +0000 (09:52 +0200)] 
.gitlab-ci.yml: bump build environment to Fedora 32

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'max_seed' into 'master'
Daiki Ueno [Thu, 17 Sep 2020 19:37:24 +0000 (19:37 +0000)] 
Merge branch 'max_seed' into 'master'

Modifies P_hash() to hash the seed and label separately.

Closes #1013

See merge request gnutls/gnutls!1329

5 years agoMerge branch 'tmp-ametzler-1091-gost' into 'master'
Daiki Ueno [Thu, 17 Sep 2020 13:37:54 +0000 (13:37 +0000)] 
Merge branch 'tmp-ametzler-1091-gost' into 'master'

Fix and enable GOST test in tests/gnutls-cli-debug.sh

See merge request gnutls/gnutls!1328

5 years agotestsuite: Run GOST part of tests/gnutls-cli-debug.sh
Andreas Metzler [Wed, 16 Sep 2020 05:18:51 +0000 (07:18 +0200)] 
testsuite: Run GOST part of tests/gnutls-cli-debug.sh

Closes #1097

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
5 years agotestsuite: Fix GOST gnutls-cli-debug test
Andreas Metzler [Wed, 16 Sep 2020 05:13:06 +0000 (07:13 +0200)] 
testsuite: Fix GOST gnutls-cli-debug test

GOST algorithms are not enabled by default, explicitely request them in
priority string.

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
5 years agoModifies P_hash() to hash the seed and label separately
Sahana Prasad [Mon, 14 Sep 2020 11:09:00 +0000 (13:09 +0200)] 
Modifies P_hash() to hash the seed and label separately
Thereby not restricting the implementation of prf to MAX_SEED_SIZE
MAX_SEED_SIZE is not used anymore

Signed-off-by: Sahana Prasad <sahana@redhat.com>
5 years agoMerge branch 'tmp-gnulib' into 'master'
Daiki Ueno [Thu, 17 Sep 2020 11:26:22 +0000 (11:26 +0000)] 
Merge branch 'tmp-gnulib' into 'master'

gnulib: update git submodule

See merge request gnutls/gnutls!1330

5 years agobuild: ignore pointless -Wformat-nonliteral warning
Daiki Ueno [Thu, 17 Sep 2020 10:03:20 +0000 (12:03 +0200)] 
build: ignore pointless -Wformat-nonliteral warning

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoconfigure.ac: don't enable warning only available in decent gcc
Daiki Ueno [Thu, 17 Sep 2020 09:15:43 +0000 (11:15 +0200)] 
configure.ac: don't enable warning only available in decent gcc

-Warith-conversion is new in GCC 10.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: bump cache version
Daiki Ueno [Sat, 12 Sep 2020 18:29:54 +0000 (20:29 +0200)] 
.gitlab-ci.yml: bump cache version

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobuild: ignore pointless -Wformat-y2k warning
Daiki Ueno [Sun, 13 Sep 2020 18:27:05 +0000 (20:27 +0200)] 
build: ignore pointless -Wformat-y2k warning

Printing UTCTime really needs last 2 digits of the year.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognulib: update git submodule
Daiki Ueno [Sun, 13 Sep 2020 15:52:44 +0000 (17:52 +0200)] 
gnulib: update git submodule

This brings in the build fixes of parse-datetime module:
https://lists.gnu.org/archive/html/bug-gnulib/2020-07/msg00178.html
https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00001.html
https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00046.html

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMake private exponent optional in gnutls_privkey_import_rsa_raw().
Nikolay Sivov [Sun, 6 Sep 2020 20:42:33 +0000 (23:42 +0300)] 
Make private exponent optional in gnutls_privkey_import_rsa_raw().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
5 years agoUse symbols defined for RSA key parameter indices in some more places.
Nikolay Sivov [Sun, 6 Sep 2020 18:18:57 +0000 (21:18 +0300)] 
Use symbols defined for RSA key parameter indices in some more places.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
5 years agoMerge branch 'gnutls-cli-aia' into 'master'
Daiki Ueno [Fri, 4 Sep 2020 15:51:14 +0000 (15:51 +0000)] 
Merge branch 'gnutls-cli-aia' into 'master'

Dynamic downloading of missing intermediate CAs via gnutls-cli using the option 'ca-auto-retrieve'

Closes #968

See merge request gnutls/gnutls!1319

5 years agoMerge branch 'tmp-renegotiation' into 'master'
Daiki Ueno [Thu, 3 Sep 2020 17:20:25 +0000 (17:20 +0000)] 
Merge branch 'tmp-renegotiation' into 'master'

handshake: reject no_renegotiation alert if handshake is incomplete

Closes #1071

See merge request gnutls/gnutls!1320

5 years agoMerge branch 'tmp-sizeof' into 'master'
Daiki Ueno [Thu, 3 Sep 2020 16:28:34 +0000 (16:28 +0000)] 
Merge branch 'tmp-sizeof' into 'master'

Fix padlock partial PHE detection and sizeof usage

Closes #1076

See merge request gnutls/gnutls!1316

5 years agoMerge branch 'rsa_privkey_import' into 'master'
Daiki Ueno [Thu, 3 Sep 2020 16:27:56 +0000 (16:27 +0000)] 
Merge branch 'rsa_privkey_import' into 'master'

Fix optional arguments handling in gnutls_privkey_import_rsa_raw()

See merge request gnutls/gnutls!1318

5 years agohandshake: reject no_renegotiation alert if handshake is incomplete
Daiki Ueno [Sat, 22 Aug 2020 15:19:39 +0000 (17:19 +0200)] 
handshake: reject no_renegotiation alert if handshake is incomplete

If the initial handshake is incomplete and the server sends a
no_renegotiation alert, the client should treat it as a fatal error
even if its level is warning.  Otherwise the same handshake
state (e.g., DHE parameters) are reused in the next gnutls_handshake
call, if it is called in the loop idiom:

  do {
          ret = gnutls_handshake(session);
  } while (ret < 0 && gnutls_error_is_fatal(ret) == 0);

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoConsolidate optional arguments tests for RSA key import, cleanup after each import.
Nikolay Sivov [Wed, 2 Sep 2020 20:49:14 +0000 (23:49 +0300)] 
Consolidate optional arguments tests for RSA key import, cleanup after each import.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
5 years agoMove RSA key parameter counter fixup closer to exponent update helper.
Nikolay Sivov [Wed, 2 Sep 2020 20:14:14 +0000 (23:14 +0300)] 
Move RSA key parameter counter fixup closer to exponent update helper.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
5 years agosrc/cli: adds new option '--ca-auto-retrieve' that can be used with gnutls-cli to
Sahana Prasad [Tue, 1 Sep 2020 21:16:53 +0000 (23:16 +0200)] 
src/cli: adds new option '--ca-auto-retrieve' that can be used with gnutls-cli to
         automatically download missing intermediate CAs in a certificate chain
lib/cred-cert.c : adds set and get APIs to get user data in the
gnutls_x509_trust_list_set_getissuer_function() callback.

Signed-off-by: Sahana Prasad <sahana@redhat.com>
5 years agoAdd some tests for optional arguments in gnutls_privkey_import_rsa_raw().
Nikolay Sivov [Tue, 1 Sep 2020 18:00:18 +0000 (21:00 +0300)] 
Add some tests for optional arguments in gnutls_privkey_import_rsa_raw().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
5 years agoFix optional parameters counter when importing RSA private keys.
Nikolay Sivov [Tue, 1 Sep 2020 16:29:20 +0000 (19:29 +0300)] 
Fix optional parameters counter when importing RSA private keys.

Currently gnutls_privkey_import_rsa_raw() allows 3 last arguments to be omitted,
key fixup logic however checks for 3 missing arguments when updating coefficient 'u'
but then asserts when updating exponents 'e1' and 'e2' assuming only 2 parameters
are missing at that point.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
5 years agoUse symbols defined for RSA key parameter indices in more places.
Nikolay Sivov [Tue, 1 Sep 2020 16:15:02 +0000 (19:15 +0300)] 
Use symbols defined for RSA key parameter indices in more places.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
5 years agotests: fix sizeof usage in mini-record-timing
Daiki Ueno [Sun, 30 Aug 2020 12:40:13 +0000 (14:40 +0200)] 
tests: fix sizeof usage in mini-record-timing

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agopadlock: fix partial PHE detection
Daiki Ueno [Sun, 30 Aug 2020 12:35:47 +0000 (14:35 +0200)] 
padlock: fix partial PHE detection

The xsha1 instruction takes complete SHA-1 blocks (64 bytes) instead
of arbitrary length data when EAX is set to -1.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'master' into 'master'
Daiki Ueno [Sat, 29 Aug 2020 20:01:20 +0000 (20:01 +0000)] 
Merge branch 'master' into 'master'

improve gnutls-serv EOL processing

Closes #1073

See merge request gnutls/gnutls!1314

5 years agoimprove gnutls-serv EOL processing
Albrecht Dreß [Sat, 29 Aug 2020 12:33:05 +0000 (14:33 +0200)] 
improve gnutls-serv EOL processing

add option `--crlf` to gnutls-serv to disable replacing a received CRLF
by LF in echo mode (fixes #1073).

Signed-off-by: Albrecht Dreß <albrecht.dress@arcor.de>
5 years agoMerge branch 'tmp-tls12-version-checks' into 'master'
Daiki Ueno [Fri, 21 Aug 2020 06:58:42 +0000 (06:58 +0000)] 
Merge branch 'tmp-tls12-version-checks' into 'master'

handshake: check TLS version against modified server priorities

Closes #1054

See merge request gnutls/gnutls!1309

5 years agoMerge branch 'tmp-ocsp-resp-status' into 'master'
Daiki Ueno [Thu, 20 Aug 2020 13:20:49 +0000 (13:20 +0000)] 
Merge branch 'tmp-ocsp-resp-status' into 'master'

cert-session: check OCSP error responses

Closes #1062

See merge request gnutls/gnutls!1308

5 years agoMerge branch 'tmp-cipher-check-length' into 'master'
Daiki Ueno [Tue, 18 Aug 2020 09:50:11 +0000 (09:50 +0000)] 
Merge branch 'tmp-cipher-check-length' into 'master'

gnutls_aead_cipher_decrypt: check output buffer size before writing

Closes #1049

See merge request gnutls/gnutls!1312

5 years agoMerge branch 'tmp-crt-export2' into 'master'
Daiki Ueno [Tue, 18 Aug 2020 08:42:57 +0000 (08:42 +0000)] 
Merge branch 'tmp-crt-export2' into 'master'

gnutls_x509_crt_export2: return 0 instead of the length

Closes #1025

See merge request gnutls/gnutls!1311

5 years agoMerge branch 'tmp-type-limits' into 'master'
Daiki Ueno [Tue, 18 Aug 2020 08:01:50 +0000 (08:01 +0000)] 
Merge branch 'tmp-type-limits' into 'master'

minitasn1: move WARN_CFLAGS setting to configure.ac

Closes #1022

See merge request gnutls/gnutls!1307

5 years agognutls_aead_cipher_decrypt: check output buffer size before writing
Daiki Ueno [Thu, 13 Aug 2020 16:17:08 +0000 (18:17 +0200)] 
gnutls_aead_cipher_decrypt: check output buffer size before writing

While the documentation of gnutls_aead_cipher_decrypt indicates that
the inout argument ptext_len initially holds the size that
sufficiently fits the expected output size, there was no runtime check
on that.  This makes the interface robuster against misuses.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: check TLS version against modified server priorities
Daiki Ueno [Sun, 16 Aug 2020 09:43:35 +0000 (11:43 +0200)] 
handshake: check TLS version against modified server priorities

The server needs to take into account of multiple factors when
determining the TLS protocol version actually being used:
- the legacy version
- "supported_versions" extension
- user_hello_func that may modify the server's priorities

Only after that it can check whether the TLS version is enabled in the
server's priorities.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognutls_x509_crt_export2: return 0 instead of the length
Daiki Ueno [Sun, 16 Aug 2020 16:23:24 +0000 (18:23 +0200)] 
gnutls_x509_crt_export2: return 0 instead of the length

This aligns the behavior to the documentation.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-fix-gost-cert-nogost' into 'master'
Daiki Ueno [Sun, 16 Aug 2020 14:18:54 +0000 (14:18 +0000)] 
Merge branch 'tmp-fix-gost-cert-nogost' into 'master'

Fix parser output in tests/cert-tests/data/gost-cert-nogost.pem

Closes #1038

See merge request gnutls/gnutls!1310

5 years agoFix parser output in tests/cert-tests/data/gost-cert-nogost.pem
Fiona Klute [Sun, 16 Aug 2020 12:05:44 +0000 (14:05 +0200)] 
Fix parser output in tests/cert-tests/data/gost-cert-nogost.pem

When building without GOST support parsing a GOST certificate must
return an "error importing public key" message instead of key
details. This change makes tests/cert-tests/pem-decoding pass for
builds with --disable-gost.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoMerge branch 'tmp-fips-enabled' into 'master'
Daiki Ueno [Fri, 14 Aug 2020 17:22:37 +0000 (17:22 +0000)] 
Merge branch 'tmp-fips-enabled' into 'master'

_gnutls_fips_mode_enabled: treat selftest failure as FIPS disabled

See merge request gnutls/gnutls!1306

5 years agoMerge branch 'tmp-typo-fixes' into 'master'
Daiki Ueno [Fri, 14 Aug 2020 17:21:13 +0000 (17:21 +0000)] 
Merge branch 'tmp-typo-fixes' into 'master'

doc: assorted typo fixes

See merge request gnutls/gnutls!1305

5 years agoMerge branch 'tmp-cert-invalid' into 'master'
Daiki Ueno [Fri, 14 Aug 2020 17:20:16 +0000 (17:20 +0000)] 
Merge branch 'tmp-cert-invalid' into 'master'

cert-session: ensure that invalid flag is always set

See merge request gnutls/gnutls!1304

5 years agoMerge branch 'tmp-public-header-guards' into 'master'
Daiki Ueno [Fri, 14 Aug 2020 13:33:17 +0000 (13:33 +0000)] 
Merge branch 'tmp-public-header-guards' into 'master'

Add or clean header guards in lib/includes/gnutls/

See merge request gnutls/gnutls!993

5 years agocert-session: check OCSP error responses
Daiki Ueno [Fri, 14 Aug 2020 05:27:40 +0000 (07:27 +0200)] 
cert-session: check OCSP error responses

If the OCSP responder returns an error code, such as tryLater, we
can't proceed to examine the response bytes.  In that case, just skip
the check unless the stapling is mandatory on this certificate.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-fix-cert-pass' into 'master'
Daiki Ueno [Fri, 14 Aug 2020 08:48:34 +0000 (08:48 +0000)] 
Merge branch 'tmp-fix-cert-pass' into 'master'

Fix two issues about certtool and passwords

Closes #933 and #888

See merge request gnutls/gnutls!1268

5 years agoMerge branch 'mangle-ecc_scalar_random' into 'master'
Daiki Ueno [Fri, 14 Aug 2020 08:12:09 +0000 (08:12 +0000)] 
Merge branch 'mangle-ecc_scalar_random' into 'master'

Mangle/hide GNUTLS-built ecc_scalar_random()

Closes #1016

See merge request gnutls/gnutls!1300

5 years agomangle gnutls-built ecc_scalar_random
Steve Lhomme [Wed, 15 Jul 2020 07:34:19 +0000 (09:34 +0200)] 
mangle gnutls-built ecc_scalar_random

GNUTLS builds ecc-random.c but ecc_scalar_random() is a public API. So we
mangle the internal version we build.

ecc_mod_random is unaffected as it's an internal API that is mangled by GNUTLS.

Fixes #1016

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
5 years agominitasn1: move WARN_CFLAGS setting to configure.ac
Daiki Ueno [Thu, 13 Aug 2020 13:56:20 +0000 (15:56 +0200)] 
minitasn1: move WARN_CFLAGS setting to configure.ac

Some compilers don't support -Wno-type-limits, while they support
-Wtype-limits.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_fips_mode_enabled: treat selftest failure as FIPS disabled
Daiki Ueno [Thu, 4 Jun 2020 14:42:07 +0000 (16:42 +0200)] 
_gnutls_fips_mode_enabled: treat selftest failure as FIPS disabled

Previously gnutls_fips140_mode_enabled() returned true, even after
selftests have failed and the library state has switched to error.
While later calls to crypto operations fails, it would be more
convenient to have a function to detect that state.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodoc: assorted typo fixes
Daiki Ueno [Wed, 12 Aug 2020 06:10:51 +0000 (08:10 +0200)] 
doc: assorted typo fixes

Spotted by codespell.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoserv, cli: ensure that invalid flag is always set
Daiki Ueno [Wed, 12 Aug 2020 05:29:30 +0000 (07:29 +0200)] 
serv, cli: ensure that invalid flag is always set

According to the documentation, the GNUTLS_CERT_INVALID flag must
always be set in case of verification failure, together with the flag
indicating the actual error cause.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agocert-session: fail hard if mandatory stapling is not honored
Daiki Ueno [Wed, 12 Aug 2020 05:27:17 +0000 (07:27 +0200)] 
cert-session: fail hard if mandatory stapling is not honored

According to the documentation, the GNUTLS_CERT_INVALID flag must
always be set in case of verification failure, together with the flag
indicating the actual error cause.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'mcatanzaro/test-missingissuer' into 'master'
Daiki Ueno [Sat, 8 Aug 2020 15:48:32 +0000 (15:48 +0000)] 
Merge branch 'mcatanzaro/test-missingissuer' into 'master'

Fix invalid free in missing issuer test case error path

See merge request gnutls/gnutls!1303

5 years agoMerge branch 'mcatanzaro/typo' into 'master'
Daiki Ueno [Fri, 7 Aug 2020 19:29:28 +0000 (19:29 +0000)] 
Merge branch 'mcatanzaro/typo' into 'master'

Fix typo in API docs

See merge request gnutls/gnutls!1302

5 years agoFix invalid free in missing issuer test case error path
Michael Catanzaro [Fri, 7 Aug 2020 18:55:23 +0000 (13:55 -0500)] 
Fix invalid free in missing issuer test case error path

This variable is not initialized in this error path: it's only
initialized if gnutls_x509_crt_get_authority_info_access() succeeds.

Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
5 years agoFix typo in API docs
Michael Catanzaro [Fri, 7 Aug 2020 18:00:22 +0000 (13:00 -0500)] 
Fix typo in API docs

Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
5 years agoMerge branch 'sign-spurious-message' into 'master'
Daiki Ueno [Mon, 27 Jul 2020 10:37:11 +0000 (10:37 +0000)] 
Merge branch 'sign-spurious-message' into 'master'

pubkey: avoid spurious audit messages from _gnutls_pubkey_compatible_with_sig()

See merge request gnutls/gnutls!1301

5 years agopubkey: avoid spurious audit messages from _gnutls_pubkey_compatible_with_sig()
Petr Pavlu [Wed, 8 Jul 2020 08:12:30 +0000 (10:12 +0200)] 
pubkey: avoid spurious audit messages from _gnutls_pubkey_compatible_with_sig()

When checking in _gnutls_pubkey_compatible_with_sig() whether a public
key is compatible with a signature algorithm, run first
pubkey_supports_sig() before performing weaker checks that can accept
the given algorithm but with an audit-log warning. This avoids an issue
when a weaker check would log an audit message for some signature
algorithm that would then be determined as incompatible by the
pubkey_supports_sig() check anyway.

For instance, a GnuTLS server might have a certificate with a SECP384R1
public key and a client can report that it supports
ECDSA-SECP256R1-SHA256 and ECDSA-SECP384R1-SHA384. In such a case, the
GnuTLS server will eventually find that it must use
ECDSA-SECP384R1-SHA384 with this public key. However, the code would
first run _gnutls_pubkey_compatible_with_sig() to check if SECP384R1 is
compatible with ECDSA-SECP256R1-SHA256. The function would report the
audit warning "The hash size used in signature (32) is less than the
expected (48)" but then reject the signature algorithm in
pubkey_supports_sig() as incompatible because it has a different curve.
Since the algorithm gets rejected it is not necessary to inform about
its hash size difference in the audit log.

Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
5 years agoMerge branch 'tmp-dh-z' into 'master'
Daiki Ueno [Thu, 23 Jul 2020 04:43:24 +0000 (04:43 +0000)] 
Merge branch 'tmp-dh-z' into 'master'

nettle: check validity of (EC)DH shared secret before export

See merge request gnutls/gnutls!1299

5 years agoecdh: perform SP800-56A rev3 full pubkey validation on keygen
Daiki Ueno [Sat, 18 Jul 2020 06:26:48 +0000 (08:26 +0200)] 
ecdh: perform SP800-56A rev3 full pubkey validation on keygen

This implements full public key validation required in
SP800-56A rev3, section 5.6.2.3.3.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodh: perform SP800-56A rev3 full pubkey validation on keygen
Daiki Ueno [Fri, 17 Jul 2020 15:47:06 +0000 (17:47 +0200)] 
dh: perform SP800-56A rev3 full pubkey validation on keygen

This implements full public key validation required in SP800-56A rev3,
section 5.6.2.3.1.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodh-primes: make the FIPS approved check return Q value
Daiki Ueno [Fri, 17 Jul 2020 15:45:17 +0000 (17:45 +0200)] 
dh-primes: make the FIPS approved check return Q value

This is necessary for full public key validation in
SP800-56A (revision 3), section 5.6.2.3.1.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoecdh: check validity of P before export
Daiki Ueno [Fri, 10 Jul 2020 07:42:30 +0000 (09:42 +0200)] 
ecdh: check validity of P before export

SP800-56A rev3 section 5.7.1.2 step 2 mandates that the validity of
the calculated shared secret is verified before the data is returned
to the caller.  This patch adds the validation check.

Suggested by Stephan Mueller.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodh: check validity of Z before export
Daiki Ueno [Fri, 10 Jul 2020 07:35:49 +0000 (09:35 +0200)] 
dh: check validity of Z before export

SP800-56A rev3 section 5.7.1.1 step 2 mandates that the validity of the
calculated shared secret is verified before the data is returned to the
caller.  This patch adds the validation check.

Suggested by Stephan Mueller.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-doc-fixes' into 'master'
Dmitry Baryshkov [Sat, 4 Jul 2020 11:27:59 +0000 (11:27 +0000)] 
Merge branch 'tmp-doc-fixes' into 'master'

RELEASES.md: update for the 3.7.x releases

See merge request gnutls/gnutls!1283

5 years agoMerge branch 'tmp-pthread' into 'master'
Dmitry Baryshkov [Sat, 4 Jul 2020 11:27:14 +0000 (11:27 +0000)] 
Merge branch 'tmp-pthread' into 'master'

build: use $(LIBPTHREAD) rather than non-existent $(LTLIBPTHREAD)

See merge request gnutls/gnutls!1296

5 years agoMerge branch 'tmp-nettle-master' into 'master'
Dmitry Baryshkov [Sat, 4 Jul 2020 11:25:27 +0000 (11:25 +0000)] 
Merge branch 'tmp-nettle-master' into 'master'

.gitlab-ci: disable config.cache for nettle-master builds

See merge request gnutls/gnutls!1291

5 years agoMerge branch 'split-up-tests-s-o-sig-hash' into 'master'
Daiki Ueno [Fri, 3 Jul 2020 19:26:26 +0000 (19:26 +0000)] 
Merge branch 'split-up-tests-s-o-sig-hash' into 'master'

tests: split up system-override-sig-hash.sh

See merge request gnutls/gnutls!1298

5 years agotests: split up system-override-sig-hash.sh
Alexander Sosedkin [Fri, 3 Jul 2020 12:54:17 +0000 (14:54 +0200)] 
tests: split up system-override-sig-hash.sh

Split up system-override-sig-hash.sh
so that the errors won't get swallowed or conflated.
Also correct unused `srcdir` to `builddir`,
which I believe was meant to be set there.

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
5 years agoMerge branch 'macos-connectx' into 'master'
Daiki Ueno [Thu, 2 Jul 2020 18:26:19 +0000 (18:26 +0000)] 
Merge branch 'macos-connectx' into 'master'

Detect the availability of connectx at runtime

See merge request gnutls/gnutls!1294

5 years agofix connectx not available on older macOS SDK
Steve Lhomme [Mon, 22 Jun 2020 07:09:05 +0000 (09:09 +0200)] 
fix connectx not available on older macOS SDK

Fixes this compilation error:
system/fastopen.c:134:9: error: 'connectx' is only available on macOS 10.11 or newer [-Werror,-Wunguarded-availability]
                ret = connectx(fd, &endpoints, SAE_ASSOCID_ANY, CONNECT_RESUME_ON_READ_WRITE | CONNECT_DATA_IDEMPOTENT, NULL, 0, NULL, NULL);
                      ^~~~~~~~
/Applications/Xcode9.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/socket.h:713:5: note: 'connectx' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.7.0

The detection is the same as found in curl [1].

If HAVE_BUILTIN_AVAILABLE is not available we fallback to the code without
TCP_FASTOPEN_OSX.

The OS values match exactly the values found in
https://opensource.apple.com/source/xnu/xnu-4570.41.2/bsd/sys/socket.h

[1] https://github.com/curl/curl/commit/870d849d48a26b8eeb0d4bb1f4655367a4a191ca

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
5 years agoMerge branch 'tmp-safe-memcmp' into 'master'
Daiki Ueno [Mon, 29 Jun 2020 14:49:43 +0000 (14:49 +0000)] 
Merge branch 'tmp-safe-memcmp' into 'master'

safe_memcmp: remove in favor of gnutls_memcmp

Closes #1042

See merge request gnutls/gnutls!1297

5 years agobuild: use $(LIBPTHREAD) rather than non-existent $(LTLIBPTHREAD)
James Bottomley [Sun, 28 Jun 2020 19:33:09 +0000 (21:33 +0200)] 
build: use $(LIBPTHREAD) rather than non-existent $(LTLIBPTHREAD)

On a very recent openSUSE build, libgnutls is getting built without
libpthread. This caused a thread related error when trying to load a
pkcs11 module that uses threading. The reason is rather convoluted:
glibc actually controls all the pthread_ function calls, but it
returns success without doing anything unless -lpthread is in the link
list. What's happening is that gnutls_system_mutex_init() is being
called on _gnutls_pkcs11_mutex before library pthreading is
initialized, so the pthread_mutex_init ends up being a nop. Then, when
the pkcs11 module is loaded, pthreads get initialized and the call to
pthread_mutex_lock is real, but errors out on the uninitialized mutex.

The problem seems to be that nothing in the gnulib macros gnutls
relies on for threading support detection actually sets LTLIBPTHREAD,
they only set LIBPTHREAD. The fix is to use LIBPTHREAD in
lib/Makefile.in

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
5 years agosafe_memcmp: remove in favor of gnutls_memcmp
Daiki Ueno [Sun, 21 Jun 2020 14:03:54 +0000 (16:03 +0200)] 
safe_memcmp: remove in favor of gnutls_memcmp

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-sp800-56ar3' into 'master'
Daiki Ueno [Mon, 29 Jun 2020 07:17:35 +0000 (07:17 +0000)] 
Merge branch 'tmp-sp800-56ar3' into 'master'

fips: tighten check on DH parameters according to SP800-56A (rev 3)

See merge request gnutls/gnutls!1295

5 years agodhe: check if DH params in SKE match the FIPS approved algorithms
Daiki Ueno [Fri, 26 Jun 2020 08:21:26 +0000 (10:21 +0200)] 
dhe: check if DH params in SKE match the FIPS approved algorithms

SP800-56A rev. 3 restricts the FIPS compliant clients to use only
approved DH parameters, defined in RFC 7919 and RFC 3526.  This adds a
check in the handling of ServerKeyExchange if DHE is negotiated.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodh-primes: add MODP primes from RFC 3526
Daiki Ueno [Fri, 26 Jun 2020 07:43:02 +0000 (09:43 +0200)] 
dh-primes: add MODP primes from RFC 3526

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'tmp-clear-session-ticket-keys' into 'master'
Daiki Ueno [Sun, 21 Jun 2020 08:16:43 +0000 (08:16 +0000)] 
Merge branch 'tmp-clear-session-ticket-keys' into 'master'

Wipe session ticket keys before releasing the session structure

See merge request gnutls/gnutls!1289

5 years agoMerge branch 'master' into 'master'
Daiki Ueno [Thu, 18 Jun 2020 07:05:48 +0000 (07:05 +0000)] 
Merge branch 'master' into 'master'

issues #1018- Modied the license to GPLv2.1+ to keep with LICENSE file.

See merge request gnutls/gnutls!1285

5 years agoMerge branch 'tmp-detect-python' into 'master'
Dmitry Baryshkov [Wed, 17 Jun 2020 17:43:28 +0000 (17:43 +0000)] 
Merge branch 'tmp-detect-python' into 'master'

Detect Python interpreter for tests instead of assuming "python"

Closes #1034

See merge request gnutls/gnutls!1292

5 years agoUpdate tlsfuzzer to get Python interpreter detection
Fiona Klute [Tue, 16 Jun 2020 19:23:14 +0000 (21:23 +0200)] 
Update tlsfuzzer to get Python interpreter detection

Tlsfuzzer also assumed the Python interpreter would be called
"python", this update is necessary to get a fixed version (see
https://github.com/tomato42/tlsfuzzer/pull/671).

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoDetect Python interpreter instead of assuming "python"
Fiona Klute [Tue, 16 Jun 2020 18:48:44 +0000 (20:48 +0200)] 
Detect Python interpreter instead of assuming "python"

This makes the extended test suite work one Debian(-ish) systems
without Python 2, where the Python 3 interpreter is called "python3".

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoMerge branch 'tmp-mark-gost94-as-broken' into 'master'
Dmitry Baryshkov [Tue, 16 Jun 2020 00:35:12 +0000 (00:35 +0000)] 
Merge branch 'tmp-mark-gost94-as-broken' into 'master'

GOSTR341194, RIPEMD160: mark as insecure for digital signatures

See merge request gnutls/gnutls!1175

5 years agoMerge branch 'master' into 'tmp-mark-gost94-as-broken'
Dmitry Baryshkov [Mon, 15 Jun 2020 20:55:39 +0000 (20:55 +0000)] 
Merge branch 'master' into 'tmp-mark-gost94-as-broken'

# Conflicts:
#   lib/crypto-selftests-pk.c

5 years agoMerge branch 'tmp-enum' into 'master'
Dmitry Baryshkov [Mon, 15 Jun 2020 09:26:49 +0000 (09:26 +0000)] 
Merge branch 'tmp-enum' into 'master'

build: minor fixes

See merge request gnutls/gnutls!1287

5 years ago.gitlab-ci.yml: bump configure cache version
Daiki Ueno [Fri, 12 Jun 2020 14:50:14 +0000 (16:50 +0200)] 
.gitlab-ci.yml: bump configure cache version

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitignore: ignore more files
Daiki Ueno [Fri, 12 Jun 2020 09:34:38 +0000 (11:34 +0200)] 
.gitignore: ignore more files

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobuild: avoid -Wenum-conversion warnings with GCC 10
Daiki Ueno [Fri, 12 Jun 2020 09:32:58 +0000 (11:32 +0200)] 
build: avoid -Wenum-conversion warnings with GCC 10

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'better_SSL3.0_tests' into 'master'
Dmitry Baryshkov [Sun, 14 Jun 2020 21:26:31 +0000 (21:26 +0000)] 
Merge branch 'better_SSL3.0_tests' into 'master'

refine tests for ancient servers which support both SSL 3.0 and TLS 1.0, but both only with %NO_EXTENSIONS

See merge request gnutls/gnutls!1251

5 years agoMerge branch 'tmp-skip-datefudge' into 'master'
Dmitry Baryshkov [Sun, 14 Jun 2020 21:08:55 +0000 (21:08 +0000)] 
Merge branch 'tmp-skip-datefudge' into 'master'

tests: improve datefudge usage

Closes #1021

See merge request gnutls/gnutls!1288