]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
5 years agognutls_session_is_resumed: don't check session ID in TLS 1.3
Daiki Ueno [Wed, 3 Feb 2021 14:50:08 +0000 (15:50 +0100)] 
gnutls_session_is_resumed: don't check session ID in TLS 1.3

In middlebox compatibiltiy mode, TLS 1.3 client simulates the TLS 1.2
resumption handshake, so checking session ID for resumption is
pointless.  This worked previously because the client always generated
new random value even in a true resumption handshake, but didn't
update the session parameters properly.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_openpgp_send_fingerprint: remove unused declaration
Daiki Ueno [Thu, 4 Feb 2021 07:39:04 +0000 (08:39 +0100)] 
_gnutls_openpgp_send_fingerprint: remove unused declaration

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_session_is_resumable: remove unused internal function
Daiki Ueno [Thu, 4 Feb 2021 07:38:16 +0000 (08:38 +0100)] 
_gnutls_session_is_resumable: remove unused internal function

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: replace TRUE and FALSE with <stdbool.h>
Daiki Ueno [Thu, 4 Feb 2021 07:56:33 +0000 (08:56 +0100)] 
handshake: replace TRUE and FALSE with <stdbool.h>

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: replace RESUME_TRUE and RESUME_FALSE with <stdbool.h>
Daiki Ueno [Thu, 4 Feb 2021 07:30:30 +0000 (08:30 +0100)] 
handshake: replace RESUME_TRUE and RESUME_FALSE with <stdbool.h>

Having those constants could cause wrong impression that there is a
third possible value.

To reproduce the changes other than lib/gnutls_int.h:

  for i in `git ls-files lib`; do
      sed -i
         -e 's/\(session->internals.\(resumed\|resumable\)\) *\(== *RESUME_FALSE\|!= *RESUME_TRUE\)/!\1/' \
  -e 's/\(session->internals.\(resumed\|resumable\)\) *\(== *RESUME_TRUE\|!= *RESUME_FALSE\)/\1/' \
  -e 's/RESUME_TRUE/true/' \
  -e 's/RESUME_FALSE/false/' \
      $i
  done

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotestcompat-openssl: run TLS 1.3 client/server tests in parallel
Daiki Ueno [Tue, 29 Dec 2020 08:59:06 +0000 (09:59 +0100)] 
testcompat-openssl: run TLS 1.3 client/server tests in parallel

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotestcompat-openssl: remove hand-written parallelism
Daiki Ueno [Tue, 29 Dec 2020 06:26:16 +0000 (07:26 +0100)] 
testcompat-openssl: remove hand-written parallelism

Previously, the test used to launch multiple tests in background and
then join them using shell primitives.  That approach makes the test
slower as it cannot benefit from the automake's parallel test harness,
as well as it makes diagnostic harder because the lines in the log
file mix up.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'check_cert_list_argument' into 'master'
Daiki Ueno [Sun, 31 Jan 2021 11:49:37 +0000 (11:49 +0000)] 
Merge branch 'check_cert_list_argument' into 'master'

Verify that cert_list_size > 0 and cert_list != NULL

See merge request gnutls/gnutls!1379

5 years agotestcompat-polarssl: remove hand-written parallelism
Daiki Ueno [Tue, 29 Dec 2020 09:06:50 +0000 (10:06 +0100)] 
testcompat-polarssl: remove hand-written parallelism

Previously, the test used to launch multiple tests in background and
then join them using shell primitives.  That approach makes the test
slower as it cannot benefit from the automake's parallel test harness,
as well as it makes diagnostic harder because the lines in the log
file mix up.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/fips-dh-memleak' into 'master'
Daiki Ueno [Mon, 25 Jan 2021 15:23:11 +0000 (15:23 +0000)] 
Merge branch 'wip/dueno/fips-dh-memleak' into 'master'

fips: avoid memleak in (EC)DH internal APIs

See merge request gnutls/gnutls!1380

5 years agoMerge branch 'pcert_deinit_on_cleanup' into 'master'
Daiki Ueno [Mon, 25 Jan 2021 13:24:24 +0000 (13:24 +0000)] 
Merge branch 'pcert_deinit_on_cleanup' into 'master'

gnutls_certificate_set_x509_key(): deinitialize pcerts array elements during cleanup

See merge request gnutls/gnutls!1378

5 years agofips: avoid memleak in (EC)DH internal APIs
Daiki Ueno [Fri, 22 Jan 2021 13:37:47 +0000 (14:37 +0100)] 
fips: avoid memleak in (EC)DH internal APIs

There were some confusions of gnutls_pk_params_clear and
gnutls_pk_params_release, as well as the number of parameters to scan
in the gnutls_pk_params_st structure.

Flagged by address sanitizer:
  ==354688==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 192 byte(s) in 12 object(s) allocated from:
      #0 0x7f13506163cf in __interceptor_malloc (/lib64/libasan.so.6+0xab3cf)
      #1 0x7f13503b94de in wrap_nettle_mpi_init /home/ueno/devel/gnutls/lib/nettle/mpi.c:79
      #2 0x7ffcb8495f07  ([stack]+0x1ef07)

  Direct leak of 160 byte(s) in 10 object(s) allocated from:
      #0 0x7f13506163cf in __interceptor_malloc (/lib64/libasan.so.6+0xab3cf)
      #1 0x7f13503b94de in wrap_nettle_mpi_init /home/ueno/devel/gnutls/lib/nettle/mpi.c:79

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoDeinitialize pcerts array elements during cleanup.
Tom Carroll [Sun, 10 Jan 2021 23:28:50 +0000 (15:28 -0800)] 
Deinitialize pcerts array elements during cleanup.

In gnutls_certificate_set_x509_key() cleanup, the pcert elements should
be deinitialized, freeing pcert's pubkey and cert fields.

Signed-off-by: Tom Carroll <incentivedesign@gmail.com>
5 years agoEnsure ca_list != NULL and ca_list_size > 0.
Tom Carroll [Mon, 11 Jan 2021 05:40:52 +0000 (21:40 -0800)] 
Ensure ca_list != NULL and ca_list_size > 0.

As ca_list_size is used in malloc, ensure that ca_list_size > 0.
If ca_list_size > 0, then ca_list cannot be NULL. Make these
assumptions explicit with argument condition check.

Signed-off-by: Tom Carroll <incentivedesign@gmail.com>
5 years agoVerify that cert_list != NULL and cert_list_size > 0.
Tom Carroll [Mon, 11 Jan 2021 05:31:19 +0000 (21:31 -0800)] 
Verify that cert_list != NULL and cert_list_size > 0.

gnutls_certificate_set_x509_key() assumes that cert_list != NULL and
cert_list_size > 0.  These assumptions are evident as cert_list_size is
used for malloc and cert_list[0] is accessed. Make those assumptions
explicit with argument condition check.

Signed-off-by: Tom Carroll <incentivedesign@gmail.com>
5 years agoMerge branch 'no-weak' into 'master'
Daiki Ueno [Sat, 9 Jan 2021 08:07:29 +0000 (08:07 +0000)] 
Merge branch 'no-weak' into 'master'

configure: Remove -no_weak_links from LDFLAGS after detecting function availability

Closes #966

See merge request gnutls/gnutls!1376

5 years agoMerge branch 'wip/dueno/autoconf-2.70' into 'master'
Daiki Ueno [Fri, 8 Jan 2021 19:27:38 +0000 (19:27 +0000)] 
Merge branch 'wip/dueno/autoconf-2.70' into 'master'

gnulib: update git submodule

Closes #1138

See merge request gnutls/gnutls!1374

5 years agoconfigure: Remove -no_weak_links from LDFLAGS after detecting function availability
Martin Storsjo [Thu, 7 Jan 2021 11:41:12 +0000 (13:41 +0200)] 
configure: Remove -no_weak_links from LDFLAGS after detecting function availability

This reverts commit 945a48993dcdd9ead17216e55c59db209923ea5e
and fixes the original issue (#966) differently.

This makes sure that when targeting a version of macOS less than
10.12, we won't pick up and unconditionally use functions that
only appeared later, when building with Xcode 11.4 or newer.
(With Xcode 11.4 or newer, the fix from 945a48993dcdd9 caused
-no_weak_links not be added, affecting the function availability
tests.)

Signed-off-by: Martin Storsjo <martin@martin.st>
5 years agoMerge branch 'ci-rework' into 'master'
Daiki Ueno [Fri, 8 Jan 2021 10:19:43 +0000 (10:19 +0000)] 
Merge branch 'ci-rework' into 'master'

CI pipeline rework - using stages and inheritance

See merge request gnutls/gnutls!1366

5 years agoMerge branch 'github-macos' into 'master'
Airtower [Fri, 8 Jan 2021 07:42:06 +0000 (07:42 +0000)] 
Merge branch 'github-macos' into 'master'

Use Github Actions for MacOS CI

Closes #1140

See merge request gnutls/gnutls!1375

5 years agoUpdate year of copyright notices in doc/gnutls.texi
Fiona Klute [Thu, 7 Jan 2021 19:29:54 +0000 (20:29 +0100)] 
Update year of copyright notices in doc/gnutls.texi

Static analysis in CI checks if this is up to date, and fails if
not. This fixes the failure.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoUpdate CI documentation for use of Github Actions
Fiona Klute [Sat, 2 Jan 2021 17:24:18 +0000 (18:24 +0100)] 
Update CI documentation for use of Github Actions

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoRemove Travis CI configuration
Fiona Klute [Sat, 2 Jan 2021 17:22:55 +0000 (18:22 +0100)] 
Remove Travis CI configuration

Replaced by Github Actions workflow added in
9fc73ec96fa5adfc8e9a4bd2ee9e6543ffcfe120.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoGithub Actions job for MacOS CI
Fiona Klute [Tue, 29 Dec 2020 21:03:53 +0000 (22:03 +0100)] 
Github Actions job for MacOS CI

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
5 years agoMerge branch 'tmp-limit-gnutls-openssl-exported-symbols' into 'master'
Andreas Metzler [Wed, 30 Dec 2020 10:40:17 +0000 (10:40 +0000)] 
Merge branch 'tmp-limit-gnutls-openssl-exported-symbols' into 'master'

libgnutls-openssl: Clean up list of exported symbols

See merge request gnutls/gnutls!1373

5 years agognulib: update git submodule
Daiki Ueno [Tue, 29 Dec 2020 18:24:28 +0000 (19:24 +0100)] 
gnulib: update git submodule

This brings in the fix for building with autoconf 2.70:
https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00091.html

Suggested by Jan Palus in:
https://gitlab.com/gnutls/gnutls/-/issues/1138

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoFix a common typo of gnutls_priority_t.
Sadie Powell [Fri, 11 Dec 2020 05:39:56 +0000 (05:39 +0000)] 
Fix a common typo of gnutls_priority_t.

Signed-off-by: Sadie Powell <sadie@witchery.services>
5 years agolibgnutls-openssl: Clean up list of exported symbols
Andreas Metzler [Tue, 8 Dec 2020 10:36:57 +0000 (11:36 +0100)] 
libgnutls-openssl: Clean up list of exported symbols

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
5 years agoMerge branch 'wip/dueno/test-fixes' into 'master'
Daiki Ueno [Tue, 29 Dec 2020 12:28:32 +0000 (12:28 +0000)] 
Merge branch 'wip/dueno/test-fixes' into 'master'

fix CI failures on recent Fedora 33 image

Closes #1136 and #1135

See merge request gnutls/gnutls!1371

5 years agotestcompat-openssl: specify -sigalgs on s_client command line
Daiki Ueno [Tue, 29 Dec 2020 08:46:36 +0000 (09:46 +0100)] 
testcompat-openssl: specify -sigalgs on s_client command line

This is a left-over of commit
23958322865a8a77c2f924f569484e5fd150a24b. Otherwise the OpenSSL system
configuration may affect algorithm selection.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotestpkcs11: use datefudge to trick certificate expiry
Daiki Ueno [Mon, 28 Dec 2020 15:16:53 +0000 (16:16 +0100)] 
testpkcs11: use datefudge to trick certificate expiry

The certificates stored in tests/testpkcs11-certs expired on
2020-12-13.  To avoid verification failure due to that, use datefudge
to set custom date when calling gnutls-cli, gnutls-serv, and certtool.

Based on the patch by Andreas Metzler:
https://gitlab.com/gnutls/gnutls/-/issues/1135#note_469682121

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotests: Fix tpmtool_test due to changes in trousers
Stefan Berger [Mon, 21 Dec 2020 14:36:47 +0000 (09:36 -0500)] 
tests: Fix tpmtool_test due to changes in trousers

Recent changes to trousers now require an ownership of root:tss for
the tcsd config file, older ones requires tss:tss. So, start tcsd
using trial and error with either one of these ownership configurations
until one works.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
5 years agoMerge branch '#1074' into 'master'
Daiki Ueno [Tue, 8 Dec 2020 18:13:53 +0000 (18:13 +0000)] 
Merge branch '#1074' into 'master'

Fix non-empty session id (TLS13_APPENDIX_D4)

Closes #1074

See merge request gnutls/gnutls!1350

5 years agoFix non-empty session id (TLS13_APPENDIX_D4)
Norbert Pocs [Fri, 30 Oct 2020 16:18:30 +0000 (17:18 +0100)] 
Fix non-empty session id (TLS13_APPENDIX_D4)

When TLS1.3 is used with middlebox compatible mode, the session id should be filled with random session id,
but remained empty.

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Closes #1074

5 years agoRelease 3.7.0 3.7.0
Daiki Ueno [Wed, 2 Dec 2020 09:30:08 +0000 (10:30 +0100)] 
Release 3.7.0

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoNEWS: update for 3.7.0 release
Daiki Ueno [Wed, 2 Dec 2020 08:33:21 +0000 (09:33 +0100)] 
NEWS: update for 3.7.0 release

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'ihsinme-master-patch-42280' into 'master'
Daiki Ueno [Tue, 1 Dec 2020 16:32:44 +0000 (16:32 +0000)] 
Merge branch 'ihsinme-master-patch-42280' into 'master'

fix invalid unsigned arithmetic.

See merge request gnutls/gnutls!1364

5 years agofix invalid unsigned arithmetic.
ihsinme [Mon, 30 Nov 2020 14:56:15 +0000 (14:56 +0000)] 
fix invalid unsigned arithmetic.

Signed-off-by: ihsinme <ihsinme@gmail.com>
5 years agoMerge branch 'wip/dueno/fuzzer-fixes' into 'master'
Daiki Ueno [Tue, 1 Dec 2020 12:33:28 +0000 (12:33 +0000)] 
Merge branch 'wip/dueno/fuzzer-fixes' into 'master'

fuzz: fix handshake fuzzer issues spotted by oss-fuzz

See merge request gnutls/gnutls!1363

5 years agoCI pipeline rework - using stages and inheritance
Stanislav Zidek [Fri, 27 Nov 2020 12:24:24 +0000 (13:24 +0100)] 
CI pipeline rework - using stages and inheritance

Signed-off-by: Stanislav Zidek <szidek@redhat.com>
5 years agoMerge branch 'mcatanzaro/getissuer_func_docs' into 'master'
Daiki Ueno [Tue, 1 Dec 2020 06:37:55 +0000 (06:37 +0000)] 
Merge branch 'mcatanzaro/getissuer_func_docs' into 'master'

x509: Improve documentation of new set_getissuer_function

See merge request gnutls/gnutls!1365

5 years agox509: Improve documentation of new set_getissuer_function
Michael Catanzaro [Mon, 30 Nov 2020 19:08:01 +0000 (13:08 -0600)] 
x509: Improve documentation of new set_getissuer_function

Since gnutls!1354, some of this information is now obsolete. The caller
is no longer responsible for verifying the certificate or adding it to
the trust list. GnuTLS will now handle that. Instead, the callback
should always import the missing certificate and return success if the
certificate was imported, or failure otherwise.

Also, let's point to gnutls_x509_crt_get_authority_info_access(), since
it is useful in combination with this function.

Finally, since this callback is emitted once for each missing
intermediate certificate, it's probably less confusing if we talk about
only a single missing intermediate here. Yes, there could be multiple
missing certificates, but a single invocation of this callback can only
deal with one.

Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
5 years agofuzz: limit the retry count in handshake fuzzer
Daiki Ueno [Sun, 29 Nov 2020 17:17:54 +0000 (18:17 +0100)] 
fuzz: limit the retry count in handshake fuzzer

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agognutls_handshake_write: don't enqueue empty Handshake message
Daiki Ueno [Sun, 29 Nov 2020 16:44:24 +0000 (17:44 +0100)] 
gnutls_handshake_write: don't enqueue empty Handshake message

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofuzz: fix undefined behavior on left shift
Daiki Ueno [Sun, 29 Nov 2020 15:51:45 +0000 (16:51 +0100)] 
fuzz: fix undefined behavior on left shift

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/verify-tofu-cstore' into 'master'
Daiki Ueno [Thu, 26 Nov 2020 05:00:18 +0000 (05:00 +0000)] 
Merge branch 'wip/dueno/verify-tofu-cstore' into 'master'

verify-tofu: return errors from store functions if callback fails

Closes #1092

See merge request gnutls/gnutls!1361

5 years agoMerge branch 'update_openssl' into 'master'
Daiki Ueno [Wed, 25 Nov 2020 06:23:58 +0000 (06:23 +0000)] 
Merge branch 'update_openssl' into 'master'

Update openssl submodule to fix backtrace info

See merge request gnutls/gnutls!1362

5 years agoaccelerated: Re-generate assembly sources
Anderson Toshiyuki Sasaki [Tue, 24 Nov 2020 10:13:07 +0000 (11:13 +0100)] 
accelerated: Re-generate assembly sources

Re-generate assembly sources from the updated openssl submodule.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
5 years agoverify-tofu: return errors from store functions if callback fails
Daiki Ueno [Tue, 24 Nov 2020 09:54:06 +0000 (10:54 +0100)] 
verify-tofu: return errors from store functions if callback fails

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agodevel: Update openssl submodule
Anderson Toshiyuki Sasaki [Tue, 24 Nov 2020 09:46:12 +0000 (10:46 +0100)] 
devel: Update openssl submodule

Update openssl submodule to current OpenSSL_1_1_1-stable branch
(8e813c085a).

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
5 years agoconfigure.ac: include <libguile.h> when checking scm_* functions
Daiki Ueno [Mon, 23 Nov 2020 06:49:04 +0000 (07:49 +0100)] 
configure.ac: include <libguile.h> when checking scm_* functions

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/aia-api' into 'master'
Daiki Ueno [Sat, 21 Nov 2020 16:46:37 +0000 (16:46 +0000)] 
Merge branch 'wip/dueno/aia-api' into 'master'

x509: check certificate trust status when adding CA through AIA

Closes #1100

See merge request gnutls/gnutls!1354

5 years agoMerge branch 'wip/dueno/disable-cipher-override' into 'master'
Daiki Ueno [Fri, 20 Nov 2020 06:43:10 +0000 (06:43 +0000)] 
Merge branch 'wip/dueno/disable-cipher-override' into 'master'

crypto-backend: remove ability of overriding ciphers

Closes #790

See merge request gnutls/gnutls!1355

5 years agocrypto-backend: remove ability of overriding ciphers
Daiki Ueno [Thu, 12 Nov 2020 05:49:12 +0000 (06:49 +0100)] 
crypto-backend: remove ability of overriding ciphers

Those functions has been deprecated in 3.6.9 as they do not have
active use cases.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/quic' into 'master'
Daiki Ueno [Thu, 19 Nov 2020 19:04:26 +0000 (19:04 +0000)] 
Merge branch 'wip/dueno/quic' into 'master'

Add QUIC related API functions

Closes #850, #849, and #826

See merge request gnutls/gnutls!1353

5 years agoNEWS: add entry for QUIC related API functions
Daiki Ueno [Mon, 9 Nov 2020 09:11:04 +0000 (10:11 +0100)] 
NEWS: add entry for QUIC related API functions

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agofuzz: fuzz gnutls_handshake_write
Daiki Ueno [Mon, 9 Nov 2020 08:05:05 +0000 (09:05 +0100)] 
fuzz: fuzz gnutls_handshake_write

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoalert: add callback to intercept alert messages
Daiki Ueno [Tue, 24 Mar 2020 16:51:56 +0000 (17:51 +0100)] 
alert: add callback to intercept alert messages

This adds gnutls_alert_set_read_function(), to allow QUIC
implementations to be notified when an alert message is sent.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: add callback to get notified with traffic secret change
Daiki Ueno [Fri, 21 Feb 2020 16:48:37 +0000 (17:48 +0100)] 
handshake: add callback to get notified with traffic secret change

For the use with QUIC, the change of traffic secrets must be notified
_after_ a new epoch is set up for reading or writing, and we can't
simply reuse the keylog mechanism.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agohandshake: add functions to read/write handshake messages directly
Daiki Ueno [Wed, 19 Feb 2020 13:35:04 +0000 (14:35 +0100)] 
handshake: add functions to read/write handshake messages directly

This adds a couple of functions, gnutls_handshake_set_read_function()
and gnutls_handshake_write(), to allow QUIC implementations to
directly interact with the TLS state machine.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agox509: rework issuer callback
Daiki Ueno [Wed, 11 Nov 2020 18:15:13 +0000 (19:15 +0100)] 
x509: rework issuer callback

The previous issuer callback API had a drawback: the callback is
supposed to add CA to the trust list by itself.  This was error-prone,
because the callback must check the new CA is trusted by the already
added CA.  This instead moves the responsibility to the library.

This also rewrites the chain amendment logic in a side-effect free
manner.  The application can assume that the trust information stored
on gnutls_x509_trust_list_t shouldn't change after the verification.

The missingissuer test has been extended to cover all the possible
patterns exhaustively.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_cert_log: assume that 'cert' is nonnull
Daiki Ueno [Thu, 12 Nov 2020 09:57:21 +0000 (10:57 +0100)] 
_gnutls_cert_log: assume that 'cert' is nonnull

This makes static analyzers happy.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_sort_clist: simplify the calling convention
Daiki Ueno [Sun, 15 Nov 2020 08:57:37 +0000 (09:57 +0100)] 
_gnutls_sort_clist: simplify the calling convention

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/ocsp-oid' into 'master'
Daiki Ueno [Thu, 19 Nov 2020 12:37:09 +0000 (12:37 +0000)] 
Merge branch 'wip/dueno/ocsp-oid' into 'master'

_gnutls_x509_read_value: don't count terminating null byte for OIDs

Closes #805

See merge request gnutls/gnutls!1358

5 years agoMerge branch 'wip/dueno/max-pin-len' into 'master'
Daiki Ueno [Fri, 13 Nov 2020 14:10:23 +0000 (14:10 +0000)] 
Merge branch 'wip/dueno/max-pin-len' into 'master'

pkcs11: increase the maximum PIN length from 31 to 255

Closes #932

See merge request gnutls/gnutls!1357

5 years agoMerge branch 'client-hello-version' into 'master'
Daiki Ueno [Fri, 13 Nov 2020 14:00:59 +0000 (14:00 +0000)] 
Merge branch 'client-hello-version' into 'master'

Use proper record version in client hello after hello retry request

Closes #1053

See merge request gnutls/gnutls!1346

5 years agoUse proper record version in client hello after hello retry request
Tomas Mraz [Mon, 26 Oct 2020 14:23:24 +0000 (15:23 +0100)] 
Use proper record version in client hello after hello retry request

Signed-off-by: Tomas Mraz <tmraz@fedoraproject.org>
Fixes: #1053
5 years agoMerge branch 'wip/dueno/doc-fixes' into 'master'
Daiki Ueno [Fri, 13 Nov 2020 11:02:09 +0000 (11:02 +0000)] 
Merge branch 'wip/dueno/doc-fixes' into 'master'

x509: clarify how to release memory allocated for DN

Closes #1110

See merge request gnutls/gnutls!1359

5 years agopkcs11: increase the maximum PIN length from 31 to 255
Daiki Ueno [Thu, 12 Nov 2020 06:46:19 +0000 (07:46 +0100)] 
pkcs11: increase the maximum PIN length from 31 to 255

The maximum is chosen from the default configuration of SoftHSMv2:
  https://github.com/opendnssec/SoftHSMv2/blob/develop/CMakeLists.txt#L61

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago_gnutls_x509_read_value: don't count terminating null byte for OIDs
Nikos Mavrogiannopoulos [Thu, 12 Nov 2020 07:45:03 +0000 (08:45 +0100)] 
_gnutls_x509_read_value: don't count terminating null byte for OIDs

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Co-authored-by: Daiki Ueno <ueno@gnu.org>
5 years agox509: clarify how to release memory allocated for DN
Daiki Ueno [Thu, 12 Nov 2020 08:19:30 +0000 (09:19 +0100)] 
x509: clarify how to release memory allocated for DN

The application can assume that DNs returned from
_gnutls_x509_get_dn() are allocated with gnutls_malloc() and thus
shall be freed with gnutls_free().

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'wip/dueno/revert-allow-broken-sig' into 'master'
Daiki Ueno [Thu, 12 Nov 2020 08:11:18 +0000 (08:11 +0000)] 
Merge branch 'wip/dueno/revert-allow-broken-sig' into 'master'

tls-sig: defer allowed sigalg check to gnutls_pubkey_verify_data2

See merge request gnutls/gnutls!1352

5 years agoMerge branch 'mcatanzaro/close-session' into 'master'
Daiki Ueno [Thu, 12 Nov 2020 05:44:01 +0000 (05:44 +0000)] 
Merge branch 'mcatanzaro/close-session' into 'master'

pkcs11: fix session leak in error path

See merge request gnutls/gnutls!1343

5 years agopkcs11: fix session leak in error path
Michael Catanzaro [Mon, 12 Oct 2020 21:33:54 +0000 (16:33 -0500)] 
pkcs11: fix session leak in error path

gnutls_pkcs11_obj_set_info() fails to call pkcs11_close_session() after
a successful pkcs11_open_session() if called with an invalid itype
parameter. That would be programmer error, of course, but better not
forget to close the session regardless.

Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
5 years agoMerge branch 'cert_validation' into 'master'
Daiki Ueno [Tue, 10 Nov 2020 19:37:12 +0000 (19:37 +0000)] 
Merge branch 'cert_validation' into 'master'

Adds a new API gnutls_session_set_verify_output_function() that allows TLS applications

Closes #1012

See merge request gnutls/gnutls!1339

5 years agoMerge branch 'tmp-nettle-3.6' into 'master'
Daiki Ueno [Tue, 10 Nov 2020 13:49:00 +0000 (13:49 +0000)] 
Merge branch 'tmp-nettle-3.6' into 'master'

build: hard require nettle 3.6

See merge request gnutls/gnutls!1322

5 years agoAdds a new API gnutls_session_set_verify_output_function() that allows TLS applications
Sahana Prasad [Mon, 28 Sep 2020 08:21:40 +0000 (10:21 +0200)] 
Adds a new API gnutls_session_set_verify_output_function() that allows TLS applications
to have a way to pass the gnutls_verify_output_function() as a callback so that the full
path of the certificate chain to the trusted root can be avaiable as output.

Signed-off-by: Sahana Prasad <sahana@redhat.com>
5 years ago.gitlab-ci.yml: temporarily allow failures on Debian.cross.aarch64
Daiki Ueno [Thu, 5 Nov 2020 04:57:01 +0000 (05:57 +0100)] 
.gitlab-ci.yml: temporarily allow failures on Debian.cross.aarch64

qemu is currently causing segmentation fault:
  cipher: aes-128-gcm
  cipher: aes-192-gcm
  cipher: aes-256-gcm
  cipher: chacha20-poly1305
  qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  Segmentation fault (core dumped)
  default cipher tests failed
  FAIL test-ciphers-openssl.sh (exit status: 139)

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: use nettle git master for FreeBSD.x86_64
Daiki Ueno [Thu, 5 Nov 2020 04:56:31 +0000 (05:56 +0100)] 
.gitlab-ci.yml: use nettle git master for FreeBSD.x86_64

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMerge branch 'mem-leak-client-cert-auth-rehandshake-ocsp' into 'master'
Daiki Ueno [Sat, 7 Nov 2020 04:09:17 +0000 (04:09 +0000)] 
Merge branch 'mem-leak-client-cert-auth-rehandshake-ocsp' into 'master'

Fix memory leak with client certificate auth

See merge request gnutls/gnutls!1347

5 years agotls-sig: defer allowed sigalg check to gnutls_pubkey_verify_data2
Daiki Ueno [Fri, 6 Nov 2020 08:54:54 +0000 (09:54 +0100)] 
tls-sig: defer allowed sigalg check to gnutls_pubkey_verify_data2

This reverts 485f2551e68d1b4ee70be2960f0a241b4a2b9fb9.  After the new
configuration file has been introduced, the allowed algorithms are
checked after this part.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoFix memory leak with client certificate auth
Remi Olivier [Thu, 29 Oct 2020 03:43:25 +0000 (20:43 -0700)] 
Fix memory leak with client certificate auth
Fix memory leak with client certificate auth when rehandshake with ocsp

More info in bug: gnutls/gnutls#1107

Signed-off-by: Remi Olivier <remi_8@hotmail.com>
5 years agoMerge branch 'dsa_import_optional_y' into 'master'
Daiki Ueno [Thu, 5 Nov 2020 14:37:13 +0000 (14:37 +0000)] 
Merge branch 'dsa_import_optional_y' into 'master'

Make y parameter optional in gnutls_privkey_import_dsa_raw().

See merge request gnutls/gnutls!1351

5 years agoRevert ".lgtm.yml: no longer bring nettle from master"
Daiki Ueno [Thu, 5 Nov 2020 04:51:56 +0000 (05:51 +0100)] 
Revert ".lgtm.yml: no longer bring nettle from master"

This reverts commit bbe93dc315009fe1f9a30426cbe20f4661b8435c.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agogostdsa: fix memleak in _gnutls_gostdsa_unmask_key
Daiki Ueno [Wed, 4 Nov 2020 18:05:58 +0000 (19:05 +0100)] 
gostdsa: fix memleak in _gnutls_gostdsa_unmask_key

Spotted by valgrind:
  ==5721== 40 bytes in 1 blocks are definitely lost in loss record 1 of 3
  ==5721==    at 0x4839809: malloc (vg_replace_malloc.c:307)
  ==5721==    by 0x4DC3E59: __gmp_default_allocate (in /usr/lib64/libgmp.so.10.4.0)
  ==5721==    by 0x4DD26A3: __gmpz_realloc (in /usr/lib64/libgmp.so.10.4.0)
  ==5721==    by 0x4DD8B9D: __gmpz_set_str (in /usr/lib64/libgmp.so.10.4.0)
  ==5721==    by 0x499339D: _gnutls_gostdsa_unmask_key (gostdsa-mask.c:68)

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotestcompat-openssl: use RC4-SHA instead of RC4-MD5 for testing
Daiki Ueno [Wed, 4 Nov 2020 17:58:25 +0000 (18:58 +0100)] 
testcompat-openssl: use RC4-SHA instead of RC4-MD5 for testing

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: use Fedora 33 with LEGACY policy for SSL 3.0 testing
Daiki Ueno [Wed, 4 Nov 2020 10:43:35 +0000 (11:43 +0100)] 
.gitlab-ci.yml: use Fedora 33 with LEGACY policy for SSL 3.0 testing

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: supply -fstack-protector required by latest MinGW
Daiki Ueno [Wed, 4 Nov 2020 08:46:10 +0000 (09:46 +0100)] 
.gitlab-ci.yml: supply -fstack-protector required by latest MinGW

https://sourceforge.net/p/mingw-w64/bugs/818/

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agotls-fuzzer: update submodules
Daiki Ueno [Wed, 4 Nov 2020 07:56:04 +0000 (08:56 +0100)] 
tls-fuzzer: update submodules

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: avoid using fipshmac
Daiki Ueno [Mon, 12 Oct 2020 15:42:15 +0000 (17:42 +0200)] 
.gitlab-ci.yml: avoid using fipshmac

The new fipshmac command provided by libkcapi requires NETLINK_CRYPTO,
which is not enabled on gitlab CI.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agosrc: remove use of siginterrupt
Daiki Ueno [Sun, 4 Oct 2020 12:08:37 +0000 (14:08 +0200)] 
src: remove use of siginterrupt

GCC 10 warns this:
  tests.c:702:2: error: 'siginterrupt' is deprecated: Use sigaction with SA_RESTART instead [-Werror=deprecated-declarations]

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years ago.gitlab-ci.yml: update build-images for nettle 3.6
Daiki Ueno [Sat, 3 Oct 2020 14:15:25 +0000 (16:15 +0200)] 
.gitlab-ci.yml: update build-images for nettle 3.6

Also remove Debian.cross.mips-linux-gnu, as it is no longer supported.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agobuild: hard require nettle 3.6
Daiki Ueno [Sun, 6 Sep 2020 06:56:07 +0000 (08:56 +0200)] 
build: hard require nettle 3.6

This allows us to remove several backports, including XTS, CFB8,
raw-ChaCha, CMAC64, Curve448, and the GOST curves and hashes.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoMake y parameter optional in gnutls_privkey_import_dsa_raw().
Hans Leidekker [Tue, 3 Nov 2020 11:31:38 +0000 (12:31 +0100)] 
Make y parameter optional in gnutls_privkey_import_dsa_raw().

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
5 years agoMerge branch 'wip/dueno/psktool-realloc' into 'master'
Daiki Ueno [Mon, 2 Nov 2020 13:50:27 +0000 (13:50 +0000)] 
Merge branch 'wip/dueno/psktool-realloc' into 'master'

psktool: Fix hex-encoding logic of username

See merge request gnutls/gnutls!1349

5 years agoMerge branch 'remove_3des' into 'master'
Daiki Ueno [Mon, 2 Nov 2020 10:51:12 +0000 (10:51 +0000)] 
Merge branch 'remove_3des' into 'master'

PKCS #12: switch default encryption to AES-256-CBC

Closes #799

See merge request gnutls/gnutls!1348

5 years agopsktool: Fix hex-encoding logic of username
Daiki Ueno [Fri, 30 Oct 2020 15:53:47 +0000 (16:53 +0100)] 
psktool: Fix hex-encoding logic of username

The previous code didn't modify the pointer to the realloc'ed region
nor check overflow before calling realloc.

Spotted by Anderson Sasaki in:
<https://gitlab.com/gnutls/gnutls/-/merge_requests/1345#note_439063374>.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
5 years agoPKCS#12: switch default encryption to AES-256-CBC
Sahana Prasad [Thu, 29 Oct 2020 09:18:56 +0000 (10:18 +0100)] 
PKCS#12: switch default encryption to AES-256-CBC

Signed-off-by: Sahana Prasad <sahana@redhat.com>
5 years agoMerge branch 'wip/dueno/psk-colon' into 'master'
Daiki Ueno [Fri, 30 Oct 2020 09:50:05 +0000 (09:50 +0000)] 
Merge branch 'wip/dueno/psk-colon' into 'master'

psktool: encode username if it contains special character

Closes #1103

See merge request gnutls/gnutls!1345

5 years agosrptool: fix FILE pointer leak
Daiki Ueno [Mon, 26 Oct 2020 15:32:59 +0000 (16:32 +0100)] 
srptool: fix FILE pointer leak

Signed-off-by: Daiki Ueno <ueno@gnu.org>