]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
22 months agotests: pqc-hybrid-kx: use key and certificate in distribution
Daiki Ueno [Tue, 23 Jul 2024 00:50:04 +0000 (09:50 +0900)] 
tests: pqc-hybrid-kx: use key and certificate in distribution

The Ed25519 key and certificate in doc/credentials/x509/ are currently
not included in the distribution.  Use the ECDSA ones in the test to
make the test work.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agoliboqs: manually load liboqs.so at startup
Daiki Ueno [Tue, 23 Jul 2024 06:12:11 +0000 (15:12 +0900)] 
liboqs: manually load liboqs.so at startup

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agodlwrap: use different macro for library soname in generated code
Daiki Ueno [Tue, 23 Jul 2024 02:25:18 +0000 (11:25 +0900)] 
dlwrap: use different macro for library soname in generated code

As GnuTLS opt in for manual initialization of dlopen'ed libraries,
config.h shouldn't define the SONAME macro used in the generated code.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agoMerge branch 'wip/dueno/hybrid-kx-liboqs' into 'master'
Daiki Ueno [Mon, 22 Jul 2024 06:42:02 +0000 (06:42 +0000)] 
Merge branch 'wip/dueno/hybrid-kx-liboqs' into 'master'

key_share: support X25519Kyber768Draft00

See merge request gnutls/gnutls!1842

22 months agotests: hash-large: exercise gnutls_hash_output(..., NULL)
Daiki Ueno [Mon, 22 Jul 2024 01:30:11 +0000 (10:30 +0900)] 
tests: hash-large: exercise gnutls_hash_output(..., NULL)

This adds a call to gnutls_hash_output with DIGEST argument as NULL to
exercise the context reset behavior added in commit
eced4c0c2b3d3ee6a35dab99616a25910b623f79.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agocrypto-selftests-pk: only define dsa_2048_privkey if DSA is enabled
Daiki Ueno [Mon, 22 Jul 2024 01:16:31 +0000 (10:16 +0900)] 
crypto-selftests-pk: only define dsa_2048_privkey if DSA is enabled

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agotests: assign unique names to temporary directories
Daiki Ueno [Mon, 22 Jul 2024 01:33:11 +0000 (10:33 +0900)] 
tests: assign unique names to temporary directories

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agotests: iov: fix printing of error
Daiki Ueno [Wed, 17 Jul 2024 03:15:06 +0000 (12:15 +0900)] 
tests: iov: fix printing of error

This fixes an incorrect usage of a printf format specifier and adds
extra length check before calling memcmp.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agoprivkey_openssl: avoid deinitializing cipher context on error path
Daiki Ueno [Wed, 17 Jul 2024 03:14:24 +0000 (12:14 +0900)] 
privkey_openssl: avoid deinitializing cipher context on error path

When gnutls_cipher_init returns error, the cipher handle is not
initialized and thus shouldn't be deinitialized.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months ago.gitlab-ci.yml: use --with-liboqs in fedora/build
Daiki Ueno [Mon, 8 Jul 2024 06:46:13 +0000 (15:46 +0900)] 
.gitlab-ci.yml: use --with-liboqs in fedora/build

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agokey_share: support X25519Kyber768Draft00
Daiki Ueno [Sat, 1 Jun 2024 22:19:14 +0000 (07:19 +0900)] 
key_share: support X25519Kyber768Draft00

This implements X25519Kyber768Draft00 hybrid post-quantum key exchange
in TLS 1.3, based on the draft:
https://datatracker.ietf.org/doc/draft-tls-westerbaan-xyber768d00/

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agobuild: plumb liboqs as an optional dependency
Daiki Ueno [Fri, 31 May 2024 00:18:27 +0000 (09:18 +0900)] 
build: plumb liboqs as an optional dependency

This exposes OQS functions necessary to implement Kyber768 through
dlopen with stub implementation for lower-level cryptographic
primitives, such as SHA3 and DRBG.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agoMerge branch 'zfridric_devel2' into 'master'
Zoltán Fridrich [Fri, 19 Jul 2024 06:19:08 +0000 (06:19 +0000)] 
Merge branch 'zfridric_devel2' into 'master'

Add configuration option to disable/enable DSA

Closes #1561

See merge request gnutls/gnutls!1850

22 months agoAdd configuration option to disable/enable DSA signing and verification
Zoltan Fridrich [Mon, 8 Jul 2024 14:13:40 +0000 (16:13 +0200)] 
Add configuration option to disable/enable DSA signing and verification

DSA signing and verification is enabled by default

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
22 months agoMerge branch 'wip/dueno/compress-dlwrap' into 'master'
Daiki Ueno [Sun, 7 Jul 2024 08:47:40 +0000 (08:47 +0000)] 
Merge branch 'wip/dueno/compress-dlwrap' into 'master'

build: switch to using dlwrap for loading compression libraries

Closes #1546

See merge request gnutls/gnutls!1847

22 months ago.gitlab-ci.yml: don't disable compression support in fedora/build
Daiki Ueno [Mon, 1 Jul 2024 22:53:02 +0000 (07:53 +0900)] 
.gitlab-ci.yml: don't disable compression support in fedora/build

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agobuild: switch to using dlwrap for loading compression libraries
Daiki Ueno [Sat, 29 Jun 2024 04:36:58 +0000 (13:36 +0900)] 
build: switch to using dlwrap for loading compression libraries

This switches the logic to load compression libraries from the
hand-written code to the automatically generated code by the dlwrap
tool[1], which enables to select whether to use dlopen or link to the
library at build time.

1. https://crates.io/crates/dlwrap

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agobuild: detect SONAME for compression libraries at configure
Daiki Ueno [Sat, 29 Jun 2024 04:34:36 +0000 (13:34 +0900)] 
build: detect SONAME for compression libraries at configure

Instead of hard-coding the SONAMEs for zlib, libzstd, libbrotlienc,
and libbrotlidec, this checks the actual SONAMEs at configure time, so
the first argument of dlopen is more acurate when a SONAME is bumped.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agobuild: check if dlopen(SONAME) works in configure
Daiki Ueno [Sat, 6 Jul 2024 02:59:08 +0000 (11:59 +0900)] 
build: check if dlopen(SONAME) works in configure

Signed-off-by: Daiki Ueno <ueno@gnu.org>
22 months agom4: factor out soname check into a separate macro
Daiki Ueno [Sat, 29 Jun 2024 00:52:55 +0000 (09:52 +0900)] 
m4: factor out soname check into a separate macro

This moves the SONAME detection from configure.ac to m4/hooks.m4 as
the LIBGNUTLS_CHECK_SONAME macro. The new macro doesn't implicitly
set *_LIBRARY_SONAME to "none", so the callers need to adjust
themselves depending on whether the macro is defined.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months agoMerge branch 'zfridric_devel3' into 'master' 3.8.6
Zoltán Fridrich [Wed, 3 Jul 2024 08:55:37 +0000 (08:55 +0000)] 
Merge branch 'zfridric_devel3' into 'master'

Release 3.8.6

See merge request gnutls/gnutls!1848

23 months agoRelease 3.8.6
Zoltan Fridrich [Tue, 2 Jul 2024 14:00:40 +0000 (16:00 +0200)] 
Release 3.8.6

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
23 months agoMake asm-sources
Zoltan Fridrich [Tue, 2 Jul 2024 15:13:21 +0000 (17:13 +0200)] 
Make asm-sources

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
23 months agoMerge branch 'fix-tests-for-future' into 'master'
Daiki Ueno [Sat, 29 Jun 2024 08:24:48 +0000 (08:24 +0000)] 
Merge branch 'fix-tests-for-future' into 'master'

Fix running tests in the close future

See merge request gnutls/gnutls!1846

23 months agoMerge branch 'fixes-for-pac-bti-enablement' into 'master'
Daiki Ueno [Fri, 21 Jun 2024 02:22:47 +0000 (02:22 +0000)] 
Merge branch 'fixes-for-pac-bti-enablement' into 'master'

lib/accelerated: add missing space on pushsection

See merge request gnutls/gnutls!1845

23 months agoaarch64: no lint asm block
Bill Roberts [Thu, 20 Jun 2024 14:00:49 +0000 (09:00 -0500)] 
aarch64: no lint asm block

For clang-format, have it ignore the asm block in the header.

Fixes:
clang-format --dry-run lib/accelerated/aarch64/aarch64-common.h
lib/accelerated/aarch64/aarch64-common.h:109:13: warning: code should be clang-formatted [-Wclang-format-violations]
.pushsection .note.gnu.property, "a";

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
23 months agotest/cert-tests: use --attime in more tests
Alexander Sosedkin [Wed, 19 Jun 2024 12:40:23 +0000 (14:40 +0200)] 
test/cert-tests: use --attime in more tests

With this change, building should be fine until 2049
on platforms with 64-bit time_t.

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
23 months agotests: use --attime in more tests
Alexander Sosedkin [Wed, 19 Jun 2024 12:39:53 +0000 (14:39 +0200)] 
tests: use --attime in more tests

With this change, building should build fine until 2039
on platforms with 64-bit time_t.

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
23 months agotests/Makefile: expose ac_cv_sizeof_time_t
Alexander Sosedkin [Thu, 20 Jun 2024 12:37:01 +0000 (14:37 +0200)] 
tests/Makefile: expose ac_cv_sizeof_time_t

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
23 months agoMerge branch 'remove-testcompat' into 'master'
Daiki Ueno [Thu, 13 Jun 2024 01:31:17 +0000 (01:31 +0000)] 
Merge branch 'remove-testcompat' into 'master'

remove testcompat-* tests

See merge request gnutls/gnutls!1840

23 months agotls-interoperability: workaround for openssl CCM8
Stanislav Zidek [Tue, 11 Jun 2024 15:23:11 +0000 (17:23 +0200)] 
tls-interoperability: workaround for openssl CCM8

CCM8 moved to SECLEVEL=0 in openssl

Signed-off-by: Stanislav Zidek <szidek@redhat.com>
23 months agoremove obsolete testcompat-openssl-* tests
Stanislav Zidek [Fri, 31 May 2024 08:50:42 +0000 (10:50 +0200)] 
remove obsolete testcompat-openssl-* tests

These tests are superseded by tls-interoperability/ test suite
with the exception of 0-RTT (--earlydata) tests.

Signed-off-by: Stanislav Zidek <szidek@redhat.com>
23 months agolib/accelerated: add CFLAGS to aarch64/elf
Bill Roberts [Mon, 10 Jun 2024 17:16:53 +0000 (12:16 -0500)] 
lib/accelerated: add CFLAGS to aarch64/elf

When building with certain cflags, like -mbranch-protection=standard,
the assembly generation needs to get the CFLAGS to enable assembler
level features. Without this, closing PAC/BTI feature support will not
be completed.

Example:
export CFLAGS='-mbranch-protection=standard'
export CPPFLAGS='-mbranch-protection=standard'
\# not needed, just for error reporting
export LDFLAGS='-Wl,-zforce-bti,--fatal-warnings'
./bootstrap
./configure --with-included-libtasn1 --with-included-unistring
make asm-sources
make -j4
readelf -n ./lib/.libs/libgnutls.so

Displaying notes found in: .note.gnu.property
  Owner                Data size  Description
  GNU                  0x00000010 NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: BTI, PAC
<snip>

readelf -n ./lib/.libs/libgnutlsxx.so

Displaying notes found in: .note.gnu.property
  Owner                Data size  Description
  GNU                  0x00000010 NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: BTI, PAC
<snip>

Related to: #1517

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
23 months agolib/accelerated: add missing space on pushsection
Bill Roberts [Mon, 10 Jun 2024 17:46:09 +0000 (12:46 -0500)] 
lib/accelerated: add missing space on pushsection

Missing a space between pushsection and the section name.

Results in this error:
lib/accelerated/aarch64/aarch64-common.h:109: Error: unknown pseudo-op: `.pushsection.note.gnu.property'

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
23 months agoMerge branch 'update-openssl-to-3.2.1-add-pac-bti' into 'master'
Daiki Ueno [Sat, 8 Jun 2024 08:33:37 +0000 (08:33 +0000)] 
Merge branch 'update-openssl-to-3.2.1-add-pac-bti' into 'master'

aarch64: enable PAC and BTI

Closes #1517

See merge request gnutls/gnutls!1843

23 months agoMerge branch 'wip/dueno/ci-fedora40' into 'master'
Daiki Ueno [Fri, 7 Jun 2024 12:16:17 +0000 (12:16 +0000)] 
Merge branch 'wip/dueno/ci-fedora40' into 'master'

.gitlab-ci.yml: switch to using Fedora 40

See merge request gnutls/gnutls!1844

23 months agotls-fuzzer: move SSL3 specific tests to gnutls-nocert-ssl3.json
Daiki Ueno [Thu, 6 Jun 2024 01:51:56 +0000 (10:51 +0900)] 
tls-fuzzer: move SSL3 specific tests to gnutls-nocert-ssl3.json

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months agotests: skip pthreads tests when cross compiling
Daiki Ueno [Thu, 6 Jun 2024 00:30:13 +0000 (09:30 +0900)] 
tests: skip pthreads tests when cross compiling

These tests hangs under qemu-user-static on Fedora 40.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months agotests: testcompat-openssl-tls13: explicitly allow CCM8 ciphersuites
Daiki Ueno [Wed, 5 Jun 2024 07:33:16 +0000 (16:33 +0900)] 
tests: testcompat-openssl-tls13: explicitly allow CCM8 ciphersuites

Since OpenSSL 3.2, CCM8 is only allowed in security level 0. This
tweaks test scripts to explicitly enable this level but only enable
TLS 1.3 to exclude any TLS 1.2 ciphersuites.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months agobuild: indent code using Clang 18
Daiki Ueno [Wed, 5 Jun 2024 01:48:38 +0000 (10:48 +0900)] 
build: indent code using Clang 18

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months agotests: dtls/dtls-stress: silence -Wcalloc-transposed-args warning
Daiki Ueno [Wed, 5 Jun 2024 01:43:02 +0000 (10:43 +0900)] 
tests: dtls/dtls-stress: silence -Wcalloc-transposed-args warning

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months agotests: mini-global-init: include <stdlib.h> for exit on Windows
Daiki Ueno [Wed, 5 Jun 2024 01:39:38 +0000 (10:39 +0900)] 
tests: mini-global-init: include <stdlib.h> for exit on Windows

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months ago.gitlab-ci.yml: switch to using Fedora 40
Daiki Ueno [Tue, 4 Jun 2024 21:50:27 +0000 (06:50 +0900)] 
.gitlab-ci.yml: switch to using Fedora 40

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months agoMerge branch 'wip/dueno/ci-fedora39' into 'master'
Daiki Ueno [Tue, 4 Jun 2024 11:11:28 +0000 (11:11 +0000)] 
Merge branch 'wip/dueno/ci-fedora39' into 'master'

.gitlab-ci.yml: switch to using Fedora 39

See merge request gnutls/gnutls!1796

23 months agotests: add missing global_init/gnutls_global_deinit for MinGW
Daiki Ueno [Tue, 4 Jun 2024 00:31:31 +0000 (09:31 +0900)] 
tests: add missing global_init/gnutls_global_deinit for MinGW

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months ago.gitlab-ci.yml: restore MinGW tweaks
Daiki Ueno [Tue, 4 Jun 2024 02:29:50 +0000 (11:29 +0900)] 
.gitlab-ci.yml: restore MinGW tweaks

Signed-off-by: Daiki Ueno <ueno@gnu.org>
23 months ago.gitlab-ci.yml: bump cache version
Daiki Ueno [Tue, 4 Jun 2024 01:37:40 +0000 (10:37 +0900)] 
.gitlab-ci.yml: bump cache version

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agolib/accellerated: update asm and enable PAC/BTI
Bill Roberts [Fri, 2 Feb 2024 20:05:55 +0000 (14:05 -0600)] 
lib/accellerated: update asm and enable PAC/BTI

Update the asm sources generated from devel/openssl which have the BTI
and PAC support. Add the -mbranch-protection=standard build flag to the
generated sources. On older machines that don't have support, the
options are in the NOP space and will be NOP'd, on architectures with
support the instructions are executed as expected.

Note that this updates the ELF GNU NOTES section to indicate that BTI
and PAC are enabled. For BTI this must be in all the ELF files loaded
and linked or the feature is disabled as all execution segments need it.

After updating the asm sources via make asm-sources, you can build and
get a PAC/BTI enabled binary and test via the testsuite to verify.

readelf -n ./lib/.libs/libgnutls.so

Displaying notes found in: .note.gnu.property
  Owner                Data size  Description
  GNU                  0x00000010 NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: BTI, PAC

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
2 years agocfg.mk: add common headers used for asm gen
Bill Roberts [Fri, 2 Feb 2024 20:04:29 +0000 (14:04 -0600)] 
cfg.mk: add common headers used for asm gen

The common headers are needed when generating the assembly, so make them
depencies of the build target.

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
2 years agoopenssl: update 3.2.1
Bill Roberts [Fri, 2 Feb 2024 18:39:25 +0000 (12:39 -0600)] 
openssl: update 3.2.1

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
2 years agoci: ignore parse errors from gcovr
Bill Roberts [Tue, 6 Feb 2024 14:11:33 +0000 (08:11 -0600)] 
ci: ignore parse errors from gcovr

The documentation for gcovr suggests this as a work around to a bug in gcovr
that cause negative hit values, which is impossible, and is not accepted by
default and will cause the CI to fail:
  -  https://gcovr.com/en/stable/guide/gcov_parser.html

To correct this, add option:
  -gcov-ignore-parse-errors=negative_hits.warn_once_per_file

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
2 years agoMerge branch 'wip/dueno/shake-fixes' into 'master'
Daiki Ueno [Mon, 3 Jun 2024 13:06:49 +0000 (13:06 +0000)] 
Merge branch 'wip/dueno/shake-fixes' into 'master'

nettle: follow-up on SHAKE support

See merge request gnutls/gnutls!1841

2 years agonettle: add a way to reset hash context
Daiki Ueno [Sun, 2 Jun 2024 07:50:06 +0000 (16:50 +0900)] 
nettle: add a way to reset hash context

This makes gnutls_hash_output just reset the hash context without
calling out Nettle's hash digest function if DIGEST argument is NULL.
That is particularly useful when used with SHAKE, as its _shake_output
function marks ctx->index in a special way indicating incremental
output is in progress.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years ago.gitlab-ci.yml: switch to using Fedora 39
Daiki Ueno [Mon, 1 Jan 2024 03:51:38 +0000 (12:51 +0900)] 
.gitlab-ci.yml: switch to using Fedora 39

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years ago.gitlab-ci.yml: temporarily disable implicit library init on MinGW64
Daiki Ueno [Mon, 15 Jan 2024 00:02:47 +0000 (09:02 +0900)] 
.gitlab-ci.yml: temporarily disable implicit library init on MinGW64

This doesn't seem to work on the latest Wine 8.19.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years ago.gitlab-ci.yml: indent code using Clang 17
Daiki Ueno [Mon, 1 Jan 2024 03:57:55 +0000 (12:57 +0900)] 
.gitlab-ci.yml: indent code using Clang 17

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agotests: update tlslite-ng submodule for Python asyncore deprecation
Daiki Ueno [Sun, 14 Jan 2024 07:57:11 +0000 (16:57 +0900)] 
tests: update tlslite-ng submodule for Python asyncore deprecation

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agonettle: avoid symbol clash in sha3-shake.h
Daiki Ueno [Sun, 2 Jun 2024 00:12:15 +0000 (09:12 +0900)] 
nettle: avoid symbol clash in sha3-shake.h

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/shake' into 'master'
Daiki Ueno [Wed, 29 May 2024 22:41:58 +0000 (22:41 +0000)] 
Merge branch 'wip/dueno/shake' into 'master'

algorithms: expose SHAKE from public API

See merge request gnutls/gnutls!1839

2 years agoalgorithms: expose SHAKE from public API
Daiki Ueno [Wed, 29 May 2024 08:41:36 +0000 (17:41 +0900)] 
algorithms: expose SHAKE from public API

This adds a new function gnutls_hash_squeeze, which works similarly to
gnutls_hash_output but enables to retrieve output of arbitrary length.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agonettle: vendor-in SHAKE implementation
Daiki Ueno [Wed, 29 May 2024 08:40:55 +0000 (17:40 +0900)] 
nettle: vendor-in SHAKE implementation

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agodevel: update nettle submodule
Daiki Ueno [Wed, 29 May 2024 01:13:53 +0000 (10:13 +0900)] 
devel: update nettle submodule

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/sast' into 'master' ech
Daiki Ueno [Mon, 20 May 2024 01:14:03 +0000 (01:14 +0000)] 
Merge branch 'wip/dueno/sast' into 'master'

build: suppress static analyzer warnings

See merge request gnutls/gnutls!1837

2 years agoshuffle_exts: avoid theoretical wrap around of unsigned integer
Daiki Ueno [Fri, 17 May 2024 01:34:46 +0000 (10:34 +0900)] 
shuffle_exts: avoid theoretical wrap around of unsigned integer

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoload_dir_certs: avoid memleak
Daiki Ueno [Tue, 30 Apr 2024 13:28:29 +0000 (22:28 +0900)] 
load_dir_certs: avoid memleak

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/nettle-aes-cbc' into 'master'
Daiki Ueno [Wed, 15 May 2024 09:59:53 +0000 (09:59 +0000)] 
Merge branch 'wip/dueno/nettle-aes-cbc' into 'master'

nettle: utilize nettle_cbc_aes*_encrypt for performance

See merge request gnutls/gnutls!1836

2 years agonettle: utilize nettle_cbc_aes*_encrypt for performance
Daiki Ueno [Wed, 15 May 2024 01:17:41 +0000 (10:17 +0900)] 
nettle: utilize nettle_cbc_aes*_encrypt for performance

While CBC encryption is inherently slow for lack of parallelisim,
Nettle >= 3.8 provides specialized AES-CBC encryption functions to
improve performance by avoiding multiple calls to block cipher
initialization. This patch makes GnuTLS use those functions if
available.

Here are the results of benchmark:

* GNUTLS_CPUID_OVERRIDE=0x1, without nettle_cbc_aes*_encrypt:

  Checking cipher-MAC combinations, payload size: 16384
          AES-128-CBC-SHA1 0.90 GB/sec
          AES-128-CBC-SHA256 0.88 GB/sec

  Checking ciphers, payload size: 16384
               AES-128-CBC 1.56 GB/sec

* GNUTLS_CPUID_OVERRIDE=0x1, with nettle_cbc_aes*_encrypt:

  Checking cipher-MAC combinations, payload size: 16384
          AES-128-CBC-SHA1 1.08 GB/sec
          AES-128-CBC-SHA256 1.05 GB/sec

  Checking ciphers, payload size: 16384
               AES-128-CBC 2.16 GB/sec

* GNUTLS_CPUID_OVERRIDE unset:

  Checking cipher-MAC combinations, payload size: 16384
          AES-128-CBC-SHA1 1.13 GB/sec
          AES-128-CBC-SHA256 1.05 GB/sec

  Checking ciphers, payload size: 16384
               AES-128-CBC 2.24 GB/sec

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/pkcs12-pbmac1' into 'master'
Daiki Ueno [Tue, 14 May 2024 15:01:27 +0000 (15:01 +0000)] 
Merge branch 'wip/dueno/pkcs12-pbmac1' into 'master'

Support PBMAC1 usage in PKCS#12

See merge request gnutls/gnutls!1833

2 years agoSupport PBMAC1 usage in PKCS#12
Daiki Ueno [Tue, 30 Apr 2024 01:17:37 +0000 (10:17 +0900)] 
Support PBMAC1 usage in PKCS#12

This allows usage of PBMAC1 as the MAC to verify a PKCS#12 structure,
following draft-ietf-lamps-pkcs12-pbmac1[1]. While the MAC
verification is transparent, the generation requires a new API
gnutls_pkcs12_generate_mac3 to be used with the
GNUTLS_PKCS12_USE_PBMAC1 flag.

certtool has also been extended with the --pbmac1 option, which can be
used in combination with --to-p12.

1. https://datatracker.ietf.org/doc/draft-ietf-lamps-pkcs12-pbmac1/

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agognutls_pkcs12_generate_mac2: factor out mac generation logic
Daiki Ueno [Tue, 14 May 2024 03:40:38 +0000 (12:40 +0900)] 
gnutls_pkcs12_generate_mac2: factor out mac generation logic

This would allow us to easily implement PBMAC1 usage in PKCS#12.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agopkcs7-crypt: output keyLength in PBKDF2 only if it is greater than 0
Daiki Ueno [Tue, 14 May 2024 02:09:21 +0000 (11:09 +0900)] 
pkcs7-crypt: output keyLength in PBKDF2 only if it is greater than 0

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agopkcs7-crypt: use _gnutls_x509_write_uint32 as possible
Daiki Ueno [Tue, 14 May 2024 01:48:43 +0000 (10:48 +0900)] 
pkcs7-crypt: use _gnutls_x509_write_uint32 as possible

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years ago_gnutls_x509_read_uint: accept values greater than 0x7FFFFFFF
Daiki Ueno [Tue, 14 May 2024 01:24:03 +0000 (10:24 +0900)] 
_gnutls_x509_read_uint: accept values greater than 0x7FFFFFFF

_gnutls_x509_read_uint previously only accepted integer values encoded
in 4 bytes without checking if the first byte indicates a negative
integer in 2's complement format.  This adds the check and also avoid
unnecessary memory allocation.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/ci-gitlab-tag-change' into 'master'
Daiki Ueno [Fri, 10 May 2024 10:19:02 +0000 (10:19 +0000)] 
Merge branch 'wip/dueno/ci-gitlab-tag-change' into 'master'

.gitlab-ci.yml: use correct tag for GitLab 1.70 deployment

See merge request gnutls/gnutls!1835

2 years ago.gitlab-ci.yml: run fedora-threadsan/build without ASLR
Daiki Ueno [Fri, 10 May 2024 05:57:32 +0000 (14:57 +0900)] 
.gitlab-ci.yml: run fedora-threadsan/build without ASLR

ThreadSanitizer doesn't cope well with newer kernel (>= 6.6.x) when
ASLR is enabled:
https://github.com/google/sanitizers/issues/1716

This disables ASLR locally around the fedora-threadsan tasks.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years ago.gitlab-ci.yml: Bump cache version
Daiki Ueno [Fri, 10 May 2024 00:05:01 +0000 (09:05 +0900)] 
.gitlab-ci.yml: Bump cache version

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years ago.gitlab-ci.yml: use correct tag for GitLab 1.70 deployment
Daiki Ueno [Thu, 9 May 2024 14:29:30 +0000 (23:29 +0900)] 
.gitlab-ci.yml: use correct tag for GitLab 1.70 deployment

The "shared", "linux", and "docker" tags we use to select shared CI
runners are consolidated into "saas-linux-small-amd64" in GitLab 1.70:
https://docs.gitlab.com/ee/update/deprecations.html#removal-of-tags-from-small-saas-runners-on-linux

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/error-asn1' into 'master'
Daiki Ueno [Thu, 9 May 2024 13:53:34 +0000 (13:53 +0000)] 
Merge branch 'wip/dueno/error-asn1' into 'master'

build: fix confusions between libtasn1 and GnuTLS error codes

See merge request gnutls/gnutls!1834

2 years agobuild: fix confusions between libtasn1 and GnuTLS error codes
Daiki Ueno [Sun, 5 May 2024 22:46:29 +0000 (07:46 +0900)] 
build: fix confusions between libtasn1 and GnuTLS error codes

libtasn1 error codes returned from asn1_{read,write}_value are always
positive. Check against ASN1_SUCCESS instead.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'dg0yt-master-patch-98306' into 'master'
Daiki Ueno [Fri, 3 May 2024 10:28:06 +0000 (10:28 +0000)] 
Merge branch 'dg0yt-master-patch-98306' into 'master'

Fix configuration with multi-word GMP_LIBS.

See merge request gnutls/gnutls!1832

2 years agoFix configuration with multi-word GMP_LIBS.
Kai Pastor [Wed, 24 Apr 2024 05:36:22 +0000 (07:36 +0200)] 
Fix configuration with multi-word GMP_LIBS.

Signed-off-by: Kai Pastor <dg0yt@darc.de>
2 years agoMerge branch 'zfridric_devel2' into 'master'
Zoltán Fridrich [Fri, 12 Apr 2024 07:23:44 +0000 (07:23 +0000)] 
Merge branch 'zfridric_devel2' into 'master'

Fix RSAES-PKCS1-v1_5 system-wide configuration

Closes #1540

See merge request gnutls/gnutls!1830

2 years agoPrevent GCOVR from returning NegativeHits exception
Zoltan Fridrich [Thu, 11 Apr 2024 15:53:06 +0000 (17:53 +0200)] 
Prevent GCOVR from returning NegativeHits exception

see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68080

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2 years agoFix RSAES-PKCS1-v1_5 system-wide configuration
Zoltan Fridrich [Wed, 10 Apr 2024 10:51:33 +0000 (12:51 +0200)] 
Fix RSAES-PKCS1-v1_5 system-wide configuration

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2 years agoMerge branch 'zfridric_devel2' into 'master' 3.8.5
Zoltán Fridrich [Thu, 4 Apr 2024 09:14:35 +0000 (09:14 +0000)] 
Merge branch 'zfridric_devel2' into 'master'

Release 3.8.5

See merge request gnutls/gnutls!1829

2 years agoRelease 3.8.5
Zoltan Fridrich [Wed, 3 Apr 2024 11:03:21 +0000 (13:03 +0200)] 
Release 3.8.5

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2 years agoMerge branch 'zfridric_devel2' into 'master'
Zoltán Fridrich [Tue, 2 Apr 2024 13:28:16 +0000 (13:28 +0000)] 
Merge branch 'zfridric_devel2' into 'master'

Disable RSAES-PKCS1-v1.5 by default

See merge request gnutls/gnutls!1828

2 years agoAdd option to disable RSAES-PKCS1-v1_5
Zoltan Fridrich [Tue, 26 Mar 2024 10:48:58 +0000 (11:48 +0100)] 
Add option to disable RSAES-PKCS1-v1_5

A new option `allow-rsa-pkcs1-encrypt` has been added into the
system-wide library configuration which allows to enable/disable
the RSAES-PKCS1-v1_5. Currently, the RSAES-PKCS1-v1_5 is enabled
by default.

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2 years agoMerge branch 'rsa_compute_root_tr' into 'master'
Daiki Ueno [Wed, 27 Mar 2024 16:13:57 +0000 (16:13 +0000)] 
Merge branch 'rsa_compute_root_tr' into 'master'

Mangle/hide GNUTLS-built nettle_rsa_compute_root_tr()

See merge request gnutls/gnutls!1826

2 years agoMangle/hide GNUTLS-built nettle_rsa_compute_root_tr()
Alyssa Ross [Mon, 25 Mar 2024 10:17:29 +0000 (10:17 +0000)] 
Mangle/hide GNUTLS-built nettle_rsa_compute_root_tr()

Since bfb326f6e ("nettle: plumb RSA-OAEP in the Nettle crypto backend"),
building gnutls statically fails due to a duplicate definition of
nettle_rsa_compute_root_tr (which comes from "rsa_compute_root_tr" being
replaced by a preprocessor macro).

This patch fixes this by renaming the GNUTLS version by redefining the
value of the rsa_compute_root_tr macro.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2 years agoMerge branch 'wip/dueno/deterministic-ecdsa-followup' into 'master'
Daiki Ueno [Tue, 26 Mar 2024 15:30:20 +0000 (15:30 +0000)] 
Merge branch 'wip/dueno/deterministic-ecdsa-followup' into 'master'

nettle: avoid potential memleak with GMP older than 6.2.0

See merge request gnutls/gnutls!1827

2 years agoMerge branch 'wip/dueno/legacy-algorithms' into 'master'
Daiki Ueno [Tue, 26 Mar 2024 15:18:04 +0000 (15:18 +0000)] 
Merge branch 'wip/dueno/legacy-algorithms' into 'master'

Enable RIPEMD160 and PBES1-DES-SHA1 for compatibility

See merge request gnutls/gnutls!1824

2 years agox509: support PBES1-DES-SHA1
Daiki Ueno [Fri, 22 Mar 2024 03:47:00 +0000 (12:47 +0900)] 
x509: support PBES1-DES-SHA1

PBES1 with single DES backed by SHA-1 hash is used to parse legacy
PKCS#8 file in GCR.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agonettle: avoid potential memleak with GMP older than 6.2.0
Daiki Ueno [Tue, 26 Mar 2024 11:18:08 +0000 (20:18 +0900)] 
nettle: avoid potential memleak with GMP older than 6.2.0

As GMP 6.1.0 or ealier eagerly allocates memory at mpz_init_set_str,
if the operand is already initialized, it will cause a small leak.

See also: https://gmplib.org/repo/gmp/rev/f049e75390fc

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'wip/dueno/rsa-oaep-followup2' into 'master'
Daiki Ueno [Tue, 26 Mar 2024 11:10:15 +0000 (11:10 +0000)] 
Merge branch 'wip/dueno/rsa-oaep-followup2' into 'master'

gnutls_privkey_decrypt_data: don't free plaintext on failure

Closes #1535

See merge request gnutls/gnutls!1825

2 years agognutls_privkey_decrypt_data: don't free plaintext on failure
Daiki Ueno [Sun, 24 Mar 2024 21:45:39 +0000 (06:45 +0900)] 
gnutls_privkey_decrypt_data: don't free plaintext on failure

As _wrap_nettle_pk_decrypt uses a locally allocated buffer for the
plaintext, it doesn't need to free the plaintext given by the caller.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agonettle: plumb RIPEMD160
Daiki Ueno [Fri, 22 Mar 2024 01:48:02 +0000 (10:48 +0900)] 
nettle: plumb RIPEMD160

RIPEMD160 is still used by GnuTLS to calculate fingerprint for an
OpenPGP key when displaying it:

- https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=g10/keyid.c;h=7e4c50b59de8c25756c5ce890deecab233f19b53;hb=refs/heads/master#l800
- https://gitlab.gnome.org/GNOME/gcr/-/blob/f3c95db45099dff288986aa367007da1e855a3d0/gcr/gcr-openpgp.c#L268

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoMerge branch 'zfridric_devel2' into 'master' 3.8.4
Zoltán Fridrich [Tue, 19 Mar 2024 12:20:02 +0000 (12:20 +0000)] 
Merge branch 'zfridric_devel2' into 'master'

Release 3.8.4

Closes #1516, #1525, and #1527

See merge request gnutls/gnutls!1823

2 years agoRelease 3.8.4
Zoltan Fridrich [Mon, 18 Mar 2024 11:48:32 +0000 (12:48 +0100)] 
Release 3.8.4

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2 years agoMerge branch 'interop-version' into 'master'
Stanislav Židek [Tue, 19 Mar 2024 09:00:54 +0000 (09:00 +0000)] 
Merge branch 'interop-version' into 'master'

TLS interoperability: test actual compiled master

See merge request gnutls/gnutls!1802