]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
4 years agognutls_ciphersuite_get: new function to get unique ciphersuite name
Daiki Ueno [Wed, 12 Jan 2022 09:37:53 +0000 (10:37 +0100)] 
gnutls_ciphersuite_get: new function to get unique ciphersuite name

The existing method to obtain the name of the currently negotiated TLS
ciphersuite is as follows:

- call gnutls_cipher_get, gnutls_mac_get, gnutls_kx_get
- call gnutls_cipher_suite_get_name with the value from the above functions

This process is cumbersome and only works with TLS 1.2 or earlier;
moreover the returned names are GnuTLS specific.

This change adds a new function gnutls_ciphersuite_get to eliminate
those limitations.  It returns the "canonical" name of the
ciphersuite, which is mostly identical to the ones registered in IANA,
with an exception for compatibility.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/nettle-master' into 'master'
Daiki Ueno [Thu, 10 Feb 2022 14:53:29 +0000 (14:53 +0000)] 
Merge branch 'wip/dueno/nettle-master' into 'master'

.gitlab-ci.yml: fix nettle installation path

See merge request gnutls/gnutls!1492

4 years agotls-fuzzer: prolong timeout for FFDHE tests
Daiki Ueno [Mon, 20 Dec 2021 08:28:10 +0000 (09:28 +0100)] 
tls-fuzzer: prolong timeout for FFDHE tests

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years ago.gitlab-ci.yml: prolong timeout for fedora-nettle-minigmp/test
Daiki Ueno [Fri, 26 Nov 2021 19:03:15 +0000 (20:03 +0100)] 
.gitlab-ci.yml: prolong timeout for fedora-nettle-minigmp/test

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years ago.gitlab-ci.yml: fix nettle installation path
Daiki Ueno [Fri, 26 Nov 2021 08:37:58 +0000 (09:37 +0100)] 
.gitlab-ci.yml: fix nettle installation path

.fedora-nettle/build clones the nettle into "nettle-git" and
temporarily change the working directory while buidling it.  After
moving back to the original working directory, the installation path
should be prefixed with "${PWD}/nettle-git/".

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/fips-rsa-keygen' into 'master'
Daiki Ueno [Thu, 3 Feb 2022 15:35:40 +0000 (15:35 +0000)] 
Merge branch 'wip/dueno/fips-rsa-keygen' into 'master'

rsa_generate_fips186_4_keypair: accept a few more modulus sizes

See merge request gnutls/gnutls!1523

4 years agocerttool --generate-privkey: update warnings on RSA key sizes
Daiki Ueno [Tue, 1 Feb 2022 14:19:52 +0000 (15:19 +0100)] 
certtool --generate-privkey: update warnings on RSA key sizes

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agorsa_generate_fips186_4_keypair: accept a few more modulus sizes
Daiki Ueno [Thu, 27 Jan 2022 17:17:43 +0000 (18:17 +0100)] 
rsa_generate_fips186_4_keypair: accept a few more modulus sizes

While _rsa_generate_fips186_4_keypair was modified to accept modulus
sizes other than 2048 and 3076, rsa_generate_fips186_4_keypair, which
calls that function, was not updated to accept such modulus sizes.

Spotted by Alexander Sosedkin.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/fedora35' into 'master'
Daiki Ueno [Thu, 3 Feb 2022 13:46:46 +0000 (13:46 +0000)] 
Merge branch 'wip/dueno/fedora35' into 'master'

.gitlab-ci.yml: update Fedora images to Fedora 35

See merge request gnutls/gnutls!1527

4 years ago.gitlab-ci.yml: update Fedora images to Fedora 35
Daiki Ueno [Fri, 7 Jan 2022 10:24:36 +0000 (11:24 +0100)] 
.gitlab-ci.yml: update Fedora images to Fedora 35

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'bump-soname' into 'master'
Daiki Ueno [Tue, 1 Feb 2022 13:39:00 +0000 (13:39 +0000)] 
Merge branch 'bump-soname' into 'master'

Bump libgnutlsxx soname due to ABI break

Closes #1318

See merge request gnutls/gnutls!1528

4 years agoBump libgnutlsxx soname due to ABI break
Seppo Yli-Olli [Mon, 31 Jan 2022 16:32:28 +0000 (18:32 +0200)] 
Bump libgnutlsxx soname due to ABI break

db_check_entry and db_check_entry now have const parameters

Signed-off-by: Seppo Yli-Olli <seppo.yliolli@gmail.com>
4 years agoMerge branch 'wip/dueno/tpmtool' into 'master'
Daiki Ueno [Sat, 29 Jan 2022 12:24:01 +0000 (12:24 +0000)] 
Merge branch 'wip/dueno/tpmtool' into 'master'

Make --with-tpm2 not conflict with --with-tpm

Closes #1313

See merge request gnutls/gnutls!1526

4 years agoMerge branch 'ktls-record-send-fix' into 'master'
Daiki Ueno [Fri, 28 Jan 2022 19:21:51 +0000 (19:21 +0000)] 
Merge branch 'ktls-record-send-fix' into 'master'

ktls: fix _gnutls_ktls_send_control_msg return value

Closes #1314

See merge request gnutls/gnutls!1525

4 years agoMerge branch 'aes-gcm-sizes' into 'master'
Daiki Ueno [Fri, 28 Jan 2022 15:18:16 +0000 (15:18 +0000)] 
Merge branch 'aes-gcm-sizes' into 'master'

buffer size checks in accelerated cipher implementations

See merge request gnutls/gnutls!1521

4 years agoMerge branch 'wip/dueno/doc-fixes2' into 'master'
Daiki Ueno [Fri, 28 Jan 2022 15:17:54 +0000 (15:17 +0000)] 
Merge branch 'wip/dueno/doc-fixes2' into 'master'

Minor fixes after 3.7.3 (mainly documentation)

See merge request gnutls/gnutls!1524

4 years agoconfigure.ac: make --with-tpm and --with-tpm2 independent
Daiki Ueno [Fri, 28 Jan 2022 06:49:42 +0000 (07:49 +0100)] 
configure.ac: make --with-tpm and --with-tpm2 independent

These features are not mutually exclusive, so it doesn't make sense to
disable the TPM 1.2 support with TPM 2.0 support.

Reported by Jan Palus in:
https://gitlab.com/gnutls/gnutls/-/issues/1313

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agogen-getopt.py: avoid struct member name clash with C keywords
Daiki Ueno [Fri, 28 Jan 2022 11:50:56 +0000 (12:50 +0100)] 
gen-getopt.py: avoid struct member name clash with C keywords

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agotests: tcp_connect: avoid resource leak on error path
Daiki Ueno [Fri, 28 Jan 2022 06:55:25 +0000 (07:55 +0100)] 
tests: tcp_connect: avoid resource leak on error path

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoREADME.md: fix versions in build status and add 3.6.x
Daiki Ueno [Fri, 28 Jan 2022 07:48:47 +0000 (08:48 +0100)] 
README.md: fix versions in build status and add 3.6.x

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'ktls_fix' into 'master'
František Krenželok [Fri, 28 Jan 2022 11:49:32 +0000 (11:49 +0000)] 
Merge branch 'ktls_fix' into 'master'

KTLS: hotfix

See merge request gnutls/gnutls!1522

4 years agoktls: fix _gnutls_ktls_send_control_msg return value
Jan Palus [Fri, 28 Jan 2022 10:07:02 +0000 (11:07 +0100)] 
ktls: fix _gnutls_ktls_send_control_msg return value

always returned 0 on success while contract mandates to return number of
bytes sent

Fixes #1314

Signed-off-by: Jan Palus <jpalus@fastmail.com>
4 years agorelease-steps: fix markup
Daiki Ueno [Fri, 28 Jan 2022 05:35:45 +0000 (06:35 +0100)] 
release-steps: fix markup

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoKTLS: hotfix
Frantisek Krenzelok [Thu, 27 Jan 2022 12:54:21 +0000 (13:54 +0100)] 
KTLS: hotfix

fixed: keys will be set only when both sockets were enabled for ktls
fixed: session->internals.ktls_enabled left uninitialized for non
ktls-enabled build

Signed-off-by: Frantisek Krenzelok <krenzelok.frantisek@gmail.com>
4 years agolib/accelerated: use unlikely on buffer length checks more consistently
Alexander Sosedkin [Wed, 26 Jan 2022 15:25:01 +0000 (16:25 +0100)] 
lib/accelerated: use unlikely on buffer length checks more consistently

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agolib/accelerated: rearranged several size checks to avoid overflow
Alexander Sosedkin [Wed, 26 Jan 2022 15:15:36 +0000 (16:15 +0100)] 
lib/accelerated: rearranged several size checks to avoid overflow

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotests/scripts/common: fix skipping over x86-specific tests
Alexander Sosedkin [Tue, 25 Jan 2022 11:32:59 +0000 (12:32 +0100)] 
tests/scripts/common: fix skipping over x86-specific tests

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotests/slow/test-hash-large: output GNUTLS_CPUID_OVERRIDE hints
Alexander Sosedkin [Tue, 25 Jan 2022 12:37:55 +0000 (13:37 +0100)] 
tests/slow/test-hash-large: output GNUTLS_CPUID_OVERRIDE hints

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotests/slow/cipher-api-test: add happy paths, specific error checks etc
Alexander Sosedkin [Tue, 25 Jan 2022 12:46:46 +0000 (13:46 +0100)] 
tests/slow/cipher-api-test: add happy paths, specific error checks etc

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agolib/accelerated: report GNUTLS_E_SHORT_MEMORY_BUFFER in many places
Alexander Sosedkin [Tue, 25 Jan 2022 12:36:19 +0000 (13:36 +0100)] 
lib/accelerated: report GNUTLS_E_SHORT_MEMORY_BUFFER in many places

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agoMerge branch 'tmp-2022-testsuite-more-bashism' into 'master'
Andreas Metzler [Mon, 24 Jan 2022 17:13:41 +0000 (17:13 +0000)] 
Merge branch 'tmp-2022-testsuite-more-bashism' into 'master'

testsuite: Fix missed instances of &> redirection

See merge request gnutls/gnutls!1519

4 years agoMerge branch 'tmp-2022-testsuite-infinite-loop' into 'master'
Andreas Metzler [Mon, 24 Jan 2022 17:12:50 +0000 (17:12 +0000)] 
Merge branch 'tmp-2022-testsuite-infinite-loop' into 'master'

testsuite: Fix endless loop on /bin/sh without $RANDOM

Closes #1315

See merge request gnutls/gnutls!1520

4 years ago.gitlab-ci.yml: enable hardware acceleration in UB+ASAN jobs
Alexander Sosedkin [Mon, 24 Jan 2022 16:37:24 +0000 (17:37 +0100)] 
.gitlab-ci.yml: enable hardware acceleration in UB+ASAN jobs

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotests/slow/cipher-api-test: actually test for short buffer...
Alexander Sosedkin [Mon, 24 Jan 2022 16:34:35 +0000 (17:34 +0100)] 
tests/slow/cipher-api-test: actually test for short buffer...

... avoiding the case when different failures mask the intended one

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agolib/accelerated/x86/aes-gcm-x86-pclmul-avx: add short buffer checks
Alexander Sosedkin [Mon, 24 Jan 2022 16:33:48 +0000 (17:33 +0100)] 
lib/accelerated/x86/aes-gcm-x86-pclmul-avx: add short buffer checks

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agotestsuite: Fix endless loop on /bin/sh without $RANDOM
Andreas Metzler [Sun, 23 Jan 2022 12:40:17 +0000 (13:40 +0100)] 
testsuite: Fix endless loop on /bin/sh without $RANDOM

Closes #1315
Signed-off-by: Andreas Metzler <ametzler@bebt.de>
4 years agotestsuite: Fix missed instances of &> redirection
Andreas Metzler [Sun, 23 Jan 2022 06:52:21 +0000 (07:52 +0100)] 
testsuite: Fix missed instances of &> redirection

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
4 years agoMerge branch 'tmp-2022-testsuite-bashism' into 'master'
Andreas Metzler [Sat, 22 Jan 2022 12:40:03 +0000 (12:40 +0000)] 
Merge branch 'tmp-2022-testsuite-bashism' into 'master'

Avoid &> redirection bashism in testsuite

See merge request gnutls/gnutls!1518

4 years agoAvoid &> redirection bashism in testsuite
Andreas Metzler [Fri, 21 Jan 2022 17:25:52 +0000 (18:25 +0100)] 
Avoid &> redirection bashism in testsuite

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
4 years agoMerge branch 'wip/dueno/release-3.7.3' into 'master' 3.7.3
Daiki Ueno [Tue, 18 Jan 2022 06:59:08 +0000 (06:59 +0000)] 
Merge branch 'wip/dueno/release-3.7.3' into 'master'

Release 3.7.3

See merge request gnutls/gnutls!1517

4 years agoRelease 3.7.3
Daiki Ueno [Mon, 17 Jan 2022 15:48:10 +0000 (16:48 +0100)] 
Release 3.7.3

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agotests: privkey-keygen: fix memory leak
Daiki Ueno [Tue, 18 Jan 2022 05:43:07 +0000 (06:43 +0100)] 
tests: privkey-keygen: fix memory leak

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agox509: fix thread-safety in gnutls_x509_trust_list_verify_crt2
Daiki Ueno [Sat, 30 Oct 2021 06:56:07 +0000 (08:56 +0200)] 
x509: fix thread-safety in gnutls_x509_trust_list_verify_crt2

This function previously used gnutls_x509_trust_list_get_issuer
without GNUTLS_TL_GET_COPY flag, which is required when the function
is called from multi-threaded application and PKCS #11 trust store is
in use.

Reported and the change suggested by Remi Gacogne in:
https://gitlab.com/gnutls/gnutls/-/issues/1277

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/fips-module-version' into 'master'
Daiki Ueno [Mon, 17 Jan 2022 17:53:32 +0000 (17:53 +0000)] 
Merge branch 'wip/dueno/fips-module-version' into 'master'

fips: add mechanism to embed FIPS module name in the library

See merge request gnutls/gnutls!1508

4 years agocli: add --list-config option
Daiki Ueno [Sun, 16 Jan 2022 06:57:02 +0000 (07:57 +0100)] 
cli: add --list-config option

With this option gnutls-cli prints the build-time configuration of the
library, retrieved through gnutls_get_library_config.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agofips: add build option to embed FIPS module info in library config
Daiki Ueno [Tue, 11 Jan 2022 06:36:27 +0000 (07:36 +0100)] 
fips: add build option to embed FIPS module info in library config

This adds a couple of configure options, --with-fips140-module-name
and --with-fips140-module-version, which packagers can use to embed
FIPS module information in the library.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoglobal: add API to retrieve library configuration at run time
Daiki Ueno [Tue, 11 Jan 2022 06:34:59 +0000 (07:34 +0100)] 
global: add API to retrieve library configuration at run time

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoconfigure.ac: emit feature summary as C macro
Daiki Ueno [Sun, 16 Jan 2022 11:17:39 +0000 (12:17 +0100)] 
configure.ac: emit feature summary as C macro

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/build-fixes3' into 'master'
Daiki Ueno [Sun, 16 Jan 2022 16:48:14 +0000 (16:48 +0000)] 
Merge branch 'wip/dueno/build-fixes3' into 'master'

Minor build fixes for 3.7.3 release (part 2)

See merge request gnutls/gnutls!1516

4 years agotests: suppress GCC -fanalyzer warnings
Daiki Ueno [Sun, 16 Jan 2022 15:19:53 +0000 (16:19 +0100)] 
tests: suppress GCC -fanalyzer warnings

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years ago.gitignore: ignore more files
Daiki Ueno [Sun, 16 Jan 2022 15:00:10 +0000 (16:00 +0100)] 
.gitignore: ignore more files

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agosrc: avoid overriding noinst_PROGRAMS
Daiki Ueno [Sun, 16 Jan 2022 14:59:01 +0000 (15:59 +0100)] 
src: avoid overriding noinst_PROGRAMS

In src, we now have two helper programs: systemkey and dumpcfg.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agobuild: hide maintainer tool invocation behind AM_V_GEN
Daiki Ueno [Thu, 13 Jan 2022 13:30:02 +0000 (14:30 +0100)] 
build: hide maintainer tool invocation behind AM_V_GEN

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/remove-autogen' into 'master'
Daiki Ueno [Sat, 15 Jan 2022 14:33:53 +0000 (14:33 +0000)] 
Merge branch 'wip/dueno/remove-autogen' into 'master'

remove autogen dependency

Closes #775, #774, and #773

See merge request gnutls/gnutls!1506

4 years agotests: use more aliases in tests for better alias testing coverage
Alexander Sosedkin [Thu, 13 Jan 2022 13:35:07 +0000 (14:35 +0100)] 
tests: use more aliases in tests for better alias testing coverage

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years ago.gitlab-ci.yml: run static analyzers on Python files
Daiki Ueno [Fri, 7 Jan 2022 09:02:32 +0000 (10:02 +0100)] 
.gitlab-ci.yml: run static analyzers on Python files

This runs a couple of code analysis on the Python scripts added to
remove AutoGen dependency.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years ago.gitlab-ci.yml: bump cache key for python3 detection
Daiki Ueno [Fri, 7 Jan 2022 08:58:11 +0000 (09:58 +0100)] 
.gitlab-ci.yml: bump cache key for python3 detection

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoREADME.md: mention Python as requirement instead of AutoGen
Daiki Ueno [Wed, 5 Jan 2022 07:09:36 +0000 (08:09 +0100)] 
README.md: mention Python as requirement instead of AutoGen

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agosrc: remove AutoGen .def files
Daiki Ueno [Wed, 5 Jan 2022 06:39:10 +0000 (07:39 +0100)] 
src: remove AutoGen .def files

As neither the tools nor documentation depends on AutoGen, we don't
need to include the AutoGen definition files.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agodoc: generate man-pages from JSON
Daiki Ueno [Wed, 5 Jan 2022 06:24:03 +0000 (07:24 +0100)] 
doc: generate man-pages from JSON

This replaces man-pages generation previously provided by the autogen
-Tagman.tpl command with a Python script (gen-cmd-man.py).

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agodoc: generate texinfo files from JSON
Daiki Ueno [Tue, 4 Jan 2022 08:06:21 +0000 (09:06 +0100)] 
doc: generate texinfo files from JSON

This replaces texinfo generation previously provided by the autogen
-Tagtexi.tpl command with a Python script (gen-cmd-texi.py).

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agosrc: remove included copy of libopts
Daiki Ueno [Mon, 3 Jan 2022 10:02:43 +0000 (11:02 +0100)] 
src: remove included copy of libopts

As no tools link with libopts anymore, we don't need to include it in
the distribution.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agosrc: replace autoopts/libopts with minimal config parser
Daiki Ueno [Mon, 3 Jan 2022 09:30:34 +0000 (10:30 +0100)] 
src: replace autoopts/libopts with minimal config parser

This replaces configuration file parsing code previously provided by
<autoopts/options.h>, with a minimal compatible implementation.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agosrc: generate option handling code from JSON
Daiki Ueno [Fri, 31 Dec 2021 17:13:58 +0000 (18:13 +0100)] 
src: generate option handling code from JSON

This replaces AutoGen based command-line parser with a Python
script (gen-getopt.py), which takes JSON description as the input.
The included JSON files were converted one-off using the parse-autogen
program: https://gitlab.com/dueno/parse-autogen.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agopython: add library for handling JSON-based option description
Daiki Ueno [Tue, 4 Jan 2022 14:18:26 +0000 (15:18 +0100)] 
python: add library for handling JSON-based option description

This adds the jsonopts Python module used by the command-line parser
generator and documentation generators in the following commits.  This
also bumps the required Python interpreter version to 3.6.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
Co-authored-by: Alexander Sosedkin <asosedkin@redhat.com>
4 years agoMerge branch 'wip/dueno/gost-pkcs12' into 'master'
Daiki Ueno [Fri, 14 Jan 2022 10:08:48 +0000 (10:08 +0000)] 
Merge branch 'wip/dueno/gost-pkcs12' into 'master'

pkcs12: use the correct MAC algorithm for GOST key generation

Closes #1225

See merge request gnutls/gnutls!1514

4 years agopkcs12: use the correct MAC algorithm for GOST key generation
Daiki Ueno [Thu, 13 Jan 2022 08:36:52 +0000 (09:36 +0100)] 
pkcs12: use the correct MAC algorithm for GOST key generation

According to the latest TC-26 requirements, the MAC algorithm used for
PBKDF2 should always be HMAC_GOSTR3411_2012_512.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/build-fixes2' into 'master'
Daiki Ueno [Wed, 12 Jan 2022 10:22:21 +0000 (10:22 +0000)] 
Merge branch 'wip/dueno/build-fixes2' into 'master'

Minor build fixes before the 3.7.3 release

See merge request gnutls/gnutls!1511

4 years agoMerge branch 'wip/dueno/cpuid' into 'master'
Daiki Ueno [Wed, 12 Jan 2022 07:38:42 +0000 (07:38 +0000)] 
Merge branch 'wip/dueno/cpuid' into 'master'

accelerated: fix CPU feature detection for Intel CPUs

See merge request gnutls/gnutls!1487

4 years agoMerge branch 'curve-keygen-allowlist-test' into 'master'
Daiki Ueno [Wed, 12 Jan 2022 07:20:28 +0000 (07:20 +0000)] 
Merge branch 'curve-keygen-allowlist-test' into 'master'

Extend system-override-curves-allowlist test with key generation

See merge request gnutls/gnutls!1500

4 years agotests: simple: check if the digest algorithm is compiled in
Daiki Ueno [Wed, 12 Jan 2022 07:15:24 +0000 (08:15 +0100)] 
tests: simple: check if the digest algorithm is compiled in

When the library is built with --disable-gost, gnutls_digest_get_id
returns GNUTLS_DIG_UNKNOWN for GOST algorithms.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agox509: fix potential wrong usage of memcpy
Daiki Ueno [Tue, 11 Jan 2022 13:07:56 +0000 (14:07 +0100)] 
x509: fix potential wrong usage of memcpy

Spotted by GCC analyzer:

  common.c:552:17: warning: use of NULL 'out.data' where non-null expected [CWE-476] [-Wanalyzer-null-argument]
    552 |                 memcpy(output_data, out.data, (size_t) out.size);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agocert-auth: suppress false-positive warnings with GCC analyzer
Daiki Ueno [Sun, 9 Jan 2022 07:34:52 +0000 (08:34 +0100)] 
cert-auth: suppress false-positive warnings with GCC analyzer

When compiled with gcc -fanalyzer, it reports:

  cert.c: In function '_gnutls_pcert_to_auth_info':
  cert.c:85:17: error: dereference of NULL 'info' [CWE-476] [-Werror=analyzer-null-dereference]
     85 |         if (info->raw_certificate_list != NULL) {

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/pkcs12' into 'master'
Daiki Ueno [Wed, 12 Jan 2022 06:54:10 +0000 (06:54 +0000)] 
Merge branch 'wip/dueno/pkcs12' into 'master'

certtool: --to-p12: use modern algorithms by default

See merge request gnutls/gnutls!1499

4 years agognutls_pkcs12_generate_mac: use SHA256 by default
Daiki Ueno [Fri, 7 Jan 2022 16:48:22 +0000 (17:48 +0100)] 
gnutls_pkcs12_generate_mac: use SHA256 by default

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years ago.gitlab-ci.yml: reduce PKCS#12 iteration count while testing
Daiki Ueno [Mon, 20 Dec 2021 15:16:23 +0000 (16:16 +0100)] 
.gitlab-ci.yml: reduce PKCS#12 iteration count while testing

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agotests: check algorithms for generating PKCS#12 file
Daiki Ueno [Tue, 21 Dec 2021 14:02:45 +0000 (15:02 +0100)] 
tests: check algorithms for generating PKCS#12 file

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/fipscontext' into 'master'
Daiki Ueno [Sat, 8 Jan 2022 10:04:40 +0000 (10:04 +0000)] 
Merge branch 'wip/dueno/fipscontext' into 'master'

fips: add functions to inspect thread-local FIPS operation state

See merge request gnutls/gnutls!1465

4 years agocipher-api-test: mention why it is written using fork
Daiki Ueno [Sun, 26 Dec 2021 16:40:42 +0000 (17:40 +0100)] 
cipher-api-test: mention why it is written using fork

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agofips: plumb service indicator to symmetric key crypto operations
Daiki Ueno [Tue, 23 Nov 2021 14:23:34 +0000 (15:23 +0100)] 
fips: plumb service indicator to symmetric key crypto operations

Signed-off-by: Daiki Ueno <ueno@gnu.org>
Co-authored-by: Pedro Monreal <pmonrealgonzalez@suse.de>
4 years agofips: plumb service indicator to public key crypto operations
Daiki Ueno [Tue, 31 Aug 2021 11:29:45 +0000 (13:29 +0200)] 
fips: plumb service indicator to public key crypto operations

This installs service indicator state transitions in certain public
key operations in gnutls_crypto_pk_st, namely:

* fallible operations
  - encrypt
  - sign
  - generate_keys
  - derive

* infallible operations
  - decrypt, decrypt2
  - verify

other operations, such as generate_params, are not considered as
crypto operation.  Note that fallible operations above mean that those
return value could indicate error, while infallible operations do not
have distinction between errors and failures: decrypt/verify failures
are treated as a successful completion of the operation.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
Co-authored-by: Pedro Monreal <pmonrealgonzalez@suse.de>
4 years ago_gnutls_pkcs_generate_key: use HMAC-SHA256 for PBKDF2
Daiki Ueno [Tue, 21 Dec 2021 14:17:55 +0000 (15:17 +0100)] 
_gnutls_pkcs_generate_key: use HMAC-SHA256 for PBKDF2

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agopkcs12: determine iteration count for MAC at build time
Daiki Ueno [Mon, 20 Dec 2021 15:34:30 +0000 (16:34 +0100)] 
pkcs12: determine iteration count for MAC at build time

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agopkcs7: determine iteration count for PBKDF2 at build time
Daiki Ueno [Mon, 20 Dec 2021 15:13:06 +0000 (16:13 +0100)] 
pkcs7: determine iteration count for PBKDF2 at build time

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agocerttool: --to-p12: use modern algorithms by default
Daiki Ueno [Mon, 20 Dec 2021 14:56:24 +0000 (15:56 +0100)] 
certtool: --to-p12: use modern algorithms by default

Currently certtool uses PKCS12-3DES-SHA1 for encrypting keys in
PKCS#12, while it is suggested to migrate to more modern algorithms,
namely AES-128-CBC with PBKDF2 and SHA-256:
https://bugzilla.redhat.com/show_bug.cgi?id=1759982

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agofips: add functions to inspect thread-local FIPS operation state
Daiki Ueno [Fri, 23 Jul 2021 08:31:08 +0000 (10:31 +0200)] 
fips: add functions to inspect thread-local FIPS operation state

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'tmp-2022-gtkdoc' into 'master'
Daiki Ueno [Thu, 6 Jan 2022 13:01:49 +0000 (13:01 +0000)] 
Merge branch 'tmp-2022-gtkdoc' into 'master'

Fix gtk-doc build, Debian bug #1003075

See merge request gnutls/gnutls!1507

4 years agoDrop unquoted angle brackets in gtk-doc comment.
Andreas Metzler [Thu, 6 Jan 2022 06:17:01 +0000 (07:17 +0100)] 
Drop unquoted angle brackets in gtk-doc comment.

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
4 years agoFix gtk-doc build, use http URI in sgml master.
Andreas Metzler [Thu, 6 Jan 2022 06:15:31 +0000 (07:15 +0100)] 
Fix gtk-doc build, use http URI in sgml master.

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
4 years agoMerge branch 'p11tool-always-auth' into 'master'
Daiki Ueno [Wed, 5 Jan 2022 07:26:01 +0000 (07:26 +0000)] 
Merge branch 'p11tool-always-auth' into 'master'

p11tool: add --mark-always-authenticate option

See merge request gnutls/gnutls!1504

4 years agop11tool: add --mark-always-authenticate option
Alon Bar-Lev [Sat, 1 Jan 2022 19:12:51 +0000 (21:12 +0200)] 
p11tool: add --mark-always-authenticate option

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
4 years agoMerge branch 'copyright' into 'master'
Daiki Ueno [Mon, 3 Jan 2022 06:53:34 +0000 (06:53 +0000)] 
Merge branch 'copyright' into 'master'

doc: updated copyrights for 2022

See merge request gnutls/gnutls!1505

4 years agodoc: updated copyrights for 2022
Alon Bar-Lev [Sun, 2 Jan 2022 17:31:33 +0000 (19:31 +0200)] 
doc: updated copyrights for 2022

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
4 years agoaccelerated: fix CPU feature detection for Intel CPUs
Daiki Ueno [Thu, 18 Nov 2021 18:02:03 +0000 (19:02 +0100)] 
accelerated: fix CPU feature detection for Intel CPUs

This fixes read_cpuid_vals to correctly read the CPUID quadruple, as
well as to set the bit the ustream CRYPTOGAMS uses to identify Intel
CPUs.

Suggested by Rafael Gieschke in:
https://gitlab.com/gnutls/gnutls/-/issues/1282

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agopadlock: reset _gnutls_x86_cpuid_s only after padlock check succeeds
Daiki Ueno [Wed, 22 Dec 2021 16:00:03 +0000 (17:00 +0100)] 
padlock: reset _gnutls_x86_cpuid_s only after padlock check succeeds

Otherwise it clears _gnutls_x86_cpuid_s which may already hold valid
CPUID detected for Intel and AMD CPUs.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agoMerge branch 'wip/dueno/nettle-hash' into 'master'
Daiki Ueno [Wed, 22 Dec 2021 15:16:02 +0000 (15:16 +0000)] 
Merge branch 'wip/dueno/nettle-hash' into 'master'

wrap_nettle_hash_fast: avoid calling _update with zero-length input

See merge request gnutls/gnutls!1503

4 years agoMerge branch 'wip/dueno/hash-copy-doc' into 'master'
Daiki Ueno [Wed, 22 Dec 2021 09:37:01 +0000 (09:37 +0000)] 
Merge branch 'wip/dueno/hash-copy-doc' into 'master'

gnutls_{hash,hmac}_copy: mention the functions do not always work

See merge request gnutls/gnutls!1502

4 years agowrap_nettle_hash_fast: avoid calling _update with zero-length input
Daiki Ueno [Wed, 22 Dec 2021 08:12:25 +0000 (09:12 +0100)] 
wrap_nettle_hash_fast: avoid calling _update with zero-length input

As Nettle's hash update functions internally call memcpy, providing
zero-length input may cause undefined behavior.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agognutls_{hash,hmac}_copy: mention the functions do not always work
Daiki Ueno [Wed, 22 Dec 2021 07:22:04 +0000 (08:22 +0100)] 
gnutls_{hash,hmac}_copy: mention the functions do not always work

It is known that some built-in accelerated implementation, such as
AF_ALG, does not support copying hash/hmac contexts.  This expands the
documentation to suggest checking the return value of those functions.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
4 years agotests: extend system-override-curves-allowlist with key generation
Alexander Sosedkin [Mon, 20 Dec 2021 16:47:36 +0000 (17:47 +0100)] 
tests: extend system-override-curves-allowlist with key generation

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>