]> git.ipfire.org Git - thirdparty/gnutls.git/log
thirdparty/gnutls.git
3 years agocerttool: add --attime option
Wilbur Wetterquarz [Wed, 22 Mar 2023 00:00:09 +0000 (01:00 +0100)] 
certtool: add --attime option

This adds a --attime option to certtool, so the tests don't need
faketime or datefudge to adjust system time.

Signed-off-by: Wilbur Wetterquarz <freaxmate@protonmail.com>
Modified-by: Daiki Ueno <ueno@gnu.org>
3 years agoocsptool: fix memleak spotted by ASan
Daiki Ueno [Thu, 6 Jul 2023 12:30:52 +0000 (14:30 +0200)] 
ocsptool: fix memleak spotted by ASan

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoocsptool: add --attime option
Pravek Sharma [Mon, 13 Mar 2023 02:31:33 +0000 (22:31 -0400)] 
ocsptool: add --attime option

This adds a --attime option to ocsptool, so the tests don't need
faketime or datefudge to adjust system time.

Signed-off-by: Pravek Sharma <sharmapravek@gmail.com>
Modified-by: Daiki Ueno <ueno@gnu.org>
3 years agosystem: override gettime if time is overridden
Daiki Ueno [Wed, 5 Jul 2023 15:28:47 +0000 (17:28 +0200)] 
system: override gettime if time is overridden

If the gnutls_time is manually set by user, it would be more intuitive
to also update gnutls_gettime to use it internally.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotests: detect faketime at configure time
Daiki Ueno [Wed, 5 Jul 2023 13:55:16 +0000 (15:55 +0200)] 
tests: detect faketime at configure time

Previously, the test suite checked the existence of faketime or
datefudge at "make check", multiple times when it is needed.  This
moves the check to configure and check it only once.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
Co-authored-by: Andreas Metzler <ametzler@bebt.de>
3 years agoMerge branch 'wip/dueno/ems-followup' into 'master'
Daiki Ueno [Mon, 10 Jul 2023 14:26:57 +0000 (14:26 +0000)] 
Merge branch 'wip/dueno/ems-followup' into 'master'

Follow-up changes to extended master secret enforcement

See merge request gnutls/gnutls!1752

3 years agopriority: add config keyword "tls-session-hash"
Daiki Ueno [Tue, 4 Jul 2023 07:47:52 +0000 (09:47 +0200)] 
priority: add config keyword "tls-session-hash"

This adds a new keyword in the configuration file, "tls-session-hash",
which shall appear in the [overrides] section and takes either
"request" or "require" as the argument.  This is particularly useful
when reverting the EMS requirement in FIPS mode for interoperability
reasons.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotls1-prf: mark use of non-EMS PRF non-approved in FIPS
Daiki Ueno [Thu, 29 Jun 2023 08:04:51 +0000 (10:04 +0200)] 
tls1-prf: mark use of non-EMS PRF non-approved in FIPS

This adds service indicator transitions around the use of TLS 1.2 PRF.
As of May 16, 2023, the use of extended master secret is mandatory
according to FIPS 140-3 IG.  This patch detects the usage of non-EMS
KDF by checking the label: if it is "master secret", the service
indicator transitions to a non-approved state.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'tmp-ametzler-2023-manpage-copyright-year' into 'master'
Daiki Ueno [Sat, 8 Jul 2023 11:44:05 +0000 (11:44 +0000)] 
Merge branch 'tmp-ametzler-2023-manpage-copyright-year' into 'master'

Bump manpage copyright year

See merge request gnutls/gnutls!1746

3 years agoFix update-copyright-year target for switch from GNU autogen
Andreas Metzler [Sun, 4 Jun 2023 12:15:45 +0000 (14:15 +0200)] 
Fix update-copyright-year target for switch from GNU autogen

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoAutomate and fix manpage copyright year update
Andreas Metzler [Sun, 4 Jun 2023 11:53:43 +0000 (13:53 +0200)] 
Automate and fix manpage copyright year update

Handle manpage copyright year update in update-copyright-year
target, and fix the library manpage copyright year statement, $(YEAR)
expanded to an empty string

Broken by: 5a58370864e04f5dbb05b0ae453e6fa592a93175
Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoBump manpage copyright year
Andreas Metzler [Sat, 3 Jun 2023 11:27:53 +0000 (13:27 +0200)] 
Bump manpage copyright year

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoMerge branch 'wip/dueno/test-ciphersuites' into 'master'
Daiki Ueno [Fri, 7 Jul 2023 18:26:17 +0000 (18:26 +0000)] 
Merge branch 'wip/dueno/test-ciphersuites' into 'master'

tests: update tests/suite/ciphersuite after a96b04ff

See merge request gnutls/gnutls!1745

3 years agotests: re-add test-ciphersuite-names.sh to TESTS
Daiki Ueno [Mon, 5 Jun 2023 14:47:36 +0000 (16:47 +0200)] 
tests: re-add test-ciphersuite-names.sh to TESTS

The test was removed from TESTS in commit
5e52b0d0fec0d9eaac30ca8f35fd7b8368064222.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotests: update tests/suite/ciphersuite after a96b04ff
Daiki Ueno [Thu, 1 Jun 2023 14:08:24 +0000 (16:08 +0200)] 
tests: update tests/suite/ciphersuite after a96b04ff

The commit a96b04ffcf8fd7375dc3c0f90602bf679f5a9791 introduced a new
field in gnutls_cipher_suite_entry_st for gnutls_ciphersuite_get. The
scan-gnutls.sh script needs to be updated to correctly parse the
ciphersuites list.  This also fixes the include path so the test
doesn't require gnutls to be installed on the system.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/ci-fedora38' into 'master'
Daiki Ueno [Fri, 7 Jul 2023 12:38:13 +0000 (12:38 +0000)] 
Merge branch 'wip/dueno/ci-fedora38' into 'master'

.gitlab-ci.yml: switch to Fedora 38 images

See merge request gnutls/gnutls!1747

3 years agotests: make testcompat-openssl-tls13-serv.sh less flaky
Daiki Ueno [Fri, 7 Jul 2023 11:18:20 +0000 (13:18 +0200)] 
tests: make testcompat-openssl-tls13-serv.sh less flaky

Bash has a special variable GROUPS[1] which clashes with our use in
testcompat-openssl-tls13-serv.sh as a list of key exchange groups.
This avoids using it as well as expands the logging message to
indicate what is tested.

1. https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-GROUPS

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agolib: suppress -Wmaybe-uninitialized warning
Daiki Ueno [Fri, 7 Jul 2023 08:07:26 +0000 (10:07 +0200)] 
lib: suppress -Wmaybe-uninitialized warning

Spotted by GCC 13:

  pkcs11.c: In function 'gnutls_pkcs11_token_get_info':
  pkcs11.c:2535:25: error: 'str' may be used uninitialized [-Werror=maybe-uninitialized]
   2535 |                         memcpy(output, str, len);
        |                         ^~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agolib: suppress false-positive -Wanalyzer-out-of-bounds
Daiki Ueno [Wed, 7 Jun 2023 14:44:00 +0000 (16:44 +0200)] 
lib: suppress false-positive -Wanalyzer-out-of-bounds

GCC analyzer from GCC 13 reports this:

  verify-high.c:1471:21: error: stack-based buffer over-read [CWE-126] [-Werror=analyzer-out-of-bounds]
   1471 |                 if (gnutls_x509_trust_list_get_issuer(
        |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1472 |                             list, cert_list[i - 1], &issuer,

This is false-positive, as i is always in a range 0 < i < cert_list_size.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agolib: suppress false-positive -Wanalyzer-deref-before-check
Daiki Ueno [Wed, 7 Jun 2023 09:54:54 +0000 (11:54 +0200)] 
lib: suppress false-positive -Wanalyzer-deref-before-check

GCC analyzer from GCC 13 reports an error when a pointer dereference
followed by a memcpy:

  x509_dn.c:54:17: error: check of '*name.data' for NULL after already dereferencing it [-Werror=analyzer-deref-before-check]
     54 |                 memcpy(_oid, name->data, name->size);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a false-positive, because we check name->size is > 0 on a
previous line.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agosrc: suppress clang-analyzer warning
Daiki Ueno [Wed, 7 Jun 2023 09:43:32 +0000 (11:43 +0200)] 
src: suppress clang-analyzer warning

clang-analyzer from Clang 16 reports the following:

  serv.c:2069:2: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker]
          memcpy(cache_db[i].session_data.data, data.data, data.size);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years ago.gitlab-ci.yml: switch to Fedora 38 images
Daiki Ueno [Tue, 6 Jun 2023 07:30:50 +0000 (09:30 +0200)] 
.gitlab-ci.yml: switch to Fedora 38 images

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoFix DTLS handshake when first fragment is 1 byte
Stephen Paul Weber [Wed, 5 Jul 2023 03:28:48 +0000 (22:28 -0500)] 
Fix DTLS handshake when first fragment is 1 byte

Asterisk sometimes generates this, and it seems like a valid case.  If
the first fragment is 1 byte then subsequent fragments will still try to
merge into it so it needs to have a big enough buffer for this to happen.

Signed-off-by: Stephen Paul Weber <singpolyma@singpolyma.net>
3 years agoMerge branch 'dev-fix' into 'master'
Daiki Ueno [Mon, 19 Jun 2023 08:42:10 +0000 (08:42 +0000)] 
Merge branch 'dev-fix' into 'master'

m4/hooks.m4: Fixed typo

See merge request gnutls/gnutls!1751

3 years agom4/hooks.m4: Fixed typo
Ajit Singh [Wed, 7 Jun 2023 16:36:57 +0000 (22:06 +0530)] 
m4/hooks.m4: Fixed typo

Signed-off-by: Ajit Singh <ajeetsinghchahar2@gmail.com>
3 years agoMerge branch 'wip/dueno/nettle-backport-cleanup' into 'master'
Daiki Ueno [Mon, 29 May 2023 07:10:49 +0000 (07:10 +0000)] 
Merge branch 'wip/dueno/nettle-backport-cleanup' into 'master'

nettle: remove files no longer used

See merge request gnutls/gnutls!1744

3 years agoMerge branch 'wip/dueno/cfb8-post' into 'master'
Daiki Ueno [Mon, 29 May 2023 06:58:49 +0000 (06:58 +0000)] 
Merge branch 'wip/dueno/cfb8-post' into 'master'

crypto-selftests: mark CFB8 block sizes tests optional

See merge request gnutls/gnutls!1743

3 years ago.gitlab-ci.yml: pull in clang16-extra-tools instead of clang15-*
Daiki Ueno [Wed, 24 May 2023 07:02:26 +0000 (09:02 +0200)] 
.gitlab-ci.yml: pull in clang16-extra-tools instead of clang15-*

Also re-indent the existing code with the newer version of clang.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotests: use GNUTLS_SELF_TEST_FLAG_ALL macro instead of magic number
Daiki Ueno [Thu, 11 May 2023 00:57:09 +0000 (09:57 +0900)] 
tests: use GNUTLS_SELF_TEST_FLAG_ALL macro instead of magic number

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agocrypto-selftests: mark CFB8 block sizes tests optional
Daiki Ueno [Thu, 11 May 2023 00:52:20 +0000 (09:52 +0900)] 
crypto-selftests: mark CFB8 block sizes tests optional

It was not obvious that the second function supplied to CASE2 macro
was only called when GNUTLS_SELF_TEST_FLAG_ALL is set.  This splits
the macro into two: the one to be required and the other to be
optional.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agonettle: remove files no longer used
Daiki Ueno [Thu, 11 May 2023 13:13:25 +0000 (22:13 +0900)] 
nettle: remove files no longer used

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/external-psk-importer' into 'master'
Daiki Ueno [Fri, 5 May 2023 21:00:12 +0000 (21:00 +0000)] 
Merge branch 'wip/dueno/external-psk-importer' into 'master'

psk: Add basic support for RFC 9258 external PSK importer interface

Closes #1355

See merge request gnutls/gnutls!1741

3 years agopsk: Add basic support for RFC 9258 external PSK importer interface
Daiki Ueno [Mon, 1 May 2023 23:41:08 +0000 (08:41 +0900)] 
psk: Add basic support for RFC 9258 external PSK importer interface

This adds a minimal, callback-based API to import external PSK,
following RFC 9258.  The client and the server importing external PSK
are supposed to set a callback to retrieve PSK, which returns flags
that may indicate the PSK is imported, along with the key:

  typedef int gnutls_psk_client_credentials_function3(
          gnutls_session_t session,
          gnutls_datum_t *username, gnutls_datum_t *key,
          gnutls_psk_key_flags *flags);

  typedef int gnutls_psk_server_credentials_function3(
          gnutls_session_t session,
          const gnutls_datum_t *username, gnutls_datum_t *key,
          gnutls_psk_key_flags *flags);

Those callbacks are responsible to call
gnutls_psk_format_imported_identity() for external PSKs to build a
serialized PSK identity, and set GNUTLS_PSK_KEY_EXT in flags if the
identity is an imported one.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/clang-format' into 'master'
Daiki Ueno [Mon, 24 Apr 2023 15:14:29 +0000 (15:14 +0000)] 
Merge branch 'wip/dueno/clang-format' into 'master'

build: switch to using clang-format instead of GNU indent

See merge request gnutls/gnutls!1727

3 years agobuild: re-indent code
Daiki Ueno [Mon, 24 Apr 2023 03:39:42 +0000 (12:39 +0900)] 
build: re-indent code

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agodoc: add missing documentation for enums
Daiki Ueno [Fri, 17 Mar 2023 09:17:30 +0000 (18:17 +0900)] 
doc: add missing documentation for enums

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years ago.gitlab-ci.yml: install clang15-extra-tools for clang-format
Daiki Ueno [Thu, 16 Mar 2023 02:31:42 +0000 (11:31 +0900)] 
.gitlab-ci.yml: install clang15-extra-tools for clang-format

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agognutls.h.in: stop indenting doc-comments for typedefs
Daiki Ueno [Fri, 17 Mar 2023 04:05:41 +0000 (13:05 +0900)] 
gnutls.h.in: stop indenting doc-comments for typedefs

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agobuild: use /* clang-format {on|off} */ annotation
Daiki Ueno [Thu, 16 Mar 2023 07:21:37 +0000 (16:21 +0900)] 
build: use /* clang-format {on|off} */ annotation

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agodoc: mention how to indent source code
Daiki Ueno [Mon, 24 Apr 2023 03:38:56 +0000 (12:38 +0900)] 
doc: mention how to indent source code

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agobuild: switch to using clang-format instead of GNU indent
Daiki Ueno [Thu, 16 Mar 2023 01:33:14 +0000 (10:33 +0900)] 
build: switch to using clang-format instead of GNU indent

GNU indent yields weird output when using the Linux kernel coding
style as in the below examples, which affects code readability.

- Too long lines cause unexpected indentation:
   if (!
       (priv->flags &
        GNUTLS_PKCS11_OBJ_FLAG_RETRIEVE_DISTRUSTED)
  && (priv->flags & GNUTLS_PKCS11_OBJ_FLAG_OVERWRITE_TRUSTMOD_EXT)
  && data.size > 0) {

- Unary operators (`-` and `+`) after a type cast are not recognized
  properly: `(time_t)-1` becomes `(time-t) - 1`

- Long conditionals are wrapped before binary operators, such as `&&`
  or `||`.  This is not mandatory in the style, but all the occurrences
  are replaced with that style

This switches to using clang-format instead, with the configuration
used in the Linux kernel as of commit
596ff4a09b8981790e15572e8e7bc904df5835e7:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/.clang-format

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/shuffle-exts-followup' into 'master'
Daiki Ueno [Fri, 21 Apr 2023 07:09:17 +0000 (07:09 +0000)] 
Merge branch 'wip/dueno/shuffle-exts-followup' into 'master'

doc: mention ClientHello extensions shuffling

See merge request gnutls/gnutls!1738

3 years agodoc: fix typo in %DISABLE_SAFE_RENEGOTIATION documentation
Daiki Ueno [Fri, 14 Apr 2023 23:04:01 +0000 (08:04 +0900)] 
doc: fix typo in %DISABLE_SAFE_RENEGOTIATION documentation

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agodoc: mention ClientHello extensions shuffling
Daiki Ueno [Sat, 1 Apr 2023 23:21:41 +0000 (08:21 +0900)] 
doc: mention ClientHello extensions shuffling

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agohello_ext: minor cleanup of extension shuffling code
Daiki Ueno [Sat, 1 Apr 2023 23:16:33 +0000 (08:16 +0900)] 
hello_ext: minor cleanup of extension shuffling code

This reduces the number of calls to gnutls_rnd(GNUTLS_RND_RANDOM)
based on the assumption that extension indices fit in uint8_t.

This also renames the priority string modifier from %NO_EXTS_SHUFFLE
to %NO_SHUFFLE_EXTENSIONS.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'master' into 'master'
Daiki Ueno [Thu, 13 Apr 2023 09:56:26 +0000 (09:56 +0000)] 
Merge branch 'master' into 'master'

add test for gnutls_certificate_set_x509_trust

See merge request gnutls/gnutls!1740

3 years agotests: add test for gnutls_certificate_set_x509_trust
xuraoqing [Thu, 13 Apr 2023 09:56:26 +0000 (09:56 +0000)] 
tests: add test for gnutls_certificate_set_x509_trust

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
3 years agoMerge branch 'tmp-ametzler-faketime' into 'master'
Daiki Ueno [Wed, 5 Apr 2023 07:28:54 +0000 (07:28 +0000)] 
Merge branch 'tmp-ametzler-faketime' into 'master'

Use faketime instead of datefudge

See merge request gnutls/gnutls!1716

3 years agoUpdate docs for faketime instead of datefudge
Andreas Metzler [Sun, 5 Mar 2023 13:27:39 +0000 (14:27 +0100)] 
Update docs for faketime instead of datefudge

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoDrop unused function.
Andreas Metzler [Sun, 19 Mar 2023 13:42:27 +0000 (14:42 +0100)] 
Drop unused function.

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoAlso use gnutls_timewrapper non-frozen time
Andreas Metzler [Sun, 5 Mar 2023 13:17:31 +0000 (14:17 +0100)] 
Also use gnutls_timewrapper non-frozen time

also switch timeout/wrapper order

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoUse gnutls_timewrapper for static (frozen time) instances
Andreas Metzler [Sun, 5 Mar 2023 10:29:17 +0000 (11:29 +0100)] 
Use gnutls_timewrapper for static (frozen time) instances

Also switch setsid/wrapper order

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoAdd wrapper around faketime/datefudge
Andreas Metzler [Fri, 17 Mar 2023 17:18:46 +0000 (18:18 +0100)] 
Add wrapper around faketime/datefudge

Prefer faketime, fall back to datefudge.

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoChange timestamp format for faketime compatibility.
Andreas Metzler [Tue, 28 Feb 2023 17:49:56 +0000 (18:49 +0100)] 
Change timestamp format for faketime compatibility.

Change all timestamps passed to "datefudge -s" to "YYYY-MM-DD hh:mm:ss"
format for compatibility with faketime -f ("Freeze clock" advanced format)

Signed-off-by: Andreas Metzler <ametzler@bebt.de>
3 years agoMerge branch 'issue1471' into 'master'
Daiki Ueno [Tue, 4 Apr 2023 03:49:13 +0000 (03:49 +0000)] 
Merge branch 'issue1471' into 'master'

Fix for issue #1471: Add configurable timeout to gnutls-serv

See merge request gnutls/gnutls!1726

3 years agognutls-serv: add configurable timeout
ATHARVA S MARATHE [Tue, 4 Apr 2023 03:49:13 +0000 (03:49 +0000)] 
gnutls-serv: add configurable timeout

This adds --timeout option to gnutls-serv to control the inactivity
interval, which would be useful for testing.

Fixes: #1471
Signed-off-by: maratheatharva <atharvamarathe8@gmail.com>
3 years agoMerge branch 'pbkdf' into 'master'
Daiki Ueno [Sat, 1 Apr 2023 23:24:59 +0000 (23:24 +0000)] 
Merge branch 'pbkdf' into 'master'

fips: add additional pbkdf limit checks as defined in SP 800-132

See merge request gnutls/gnutls!1736

3 years agoMerge branch 'dev0' into 'master'
Daiki Ueno [Sat, 1 Apr 2023 23:05:00 +0000 (23:05 +0000)] 
Merge branch 'dev0' into 'master'

added clientHello extension permutation

Closes #1465

See merge request gnutls/gnutls!1737

3 years agohello_ext: add ClientHello extension permutation
@Ajit [Sat, 1 Apr 2023 23:05:00 +0000 (23:05 +0000)] 
hello_ext: add ClientHello extension permutation

This adds a mechanism to randomize the order of TLS extensions in the
ClientHello to make fingerprinting harder. The mechanism is enabled by
default and a new priority keyword %NO_EXTS_SHUFFLE has been added to
turn it off.

Signed-off-by: peonix <ajeetsinghchahar2@gmail.com>
3 years agofips: adjust pbkdf2 tests for SP 800-132 limits
Tobias Heider [Thu, 30 Mar 2023 14:38:05 +0000 (16:38 +0200)] 
fips: adjust pbkdf2 tests for SP 800-132 limits

- Make sure to always use approved iteration count
- Check that salt < 16 return non-approved
- Check that iteration count < 1000 returns non-approved

Signed-off-by: Tobias Heider <tobias.heider@canonical.com>
3 years agofips: add additional pbkdf limit checks as defined in SP 800-132
Tobias Heider [Thu, 30 Mar 2023 09:36:34 +0000 (11:36 +0200)] 
fips: add additional pbkdf limit checks as defined in SP 800-132

Signed-off-by: Tobias Heider <tobias.heider@canonical.com>
3 years agoMerge branch 'wip/dueno/psk-username' into 'master'
Daiki Ueno [Thu, 30 Mar 2023 02:18:07 +0000 (02:18 +0000)] 
Merge branch 'wip/dueno/psk-username' into 'master'

src: print_info: prefer gnutls_psk_server_get_username2

See merge request gnutls/gnutls!1730

3 years agoMerge branch 'dev' into 'master'
Daiki Ueno [Tue, 28 Mar 2023 11:23:40 +0000 (11:23 +0000)] 
Merge branch 'dev' into 'master'

Modifier GNUTLS_NO_EXTENSIONS renamed to GNUTLS_NO_DEFAULT_EXTENSIONS

See merge request gnutls/gnutls!1734

3 years agochanges to keep backward compatibility
peonix [Tue, 28 Mar 2023 08:51:07 +0000 (14:21 +0530)] 
changes to keep backward compatibility

Signed-off-by: peonix <ajeetsinghchahar2@gmail.com>
3 years agoreformatted
peonix [Tue, 28 Mar 2023 08:50:47 +0000 (14:20 +0530)] 
reformatted

Signed-off-by: peonix <ajeetsinghchahar2@gmail.com>
3 years agoUpdated desc for @GNUTLS_NO_DEFAULT_EXTENSIONS
peonix [Tue, 28 Mar 2023 03:40:36 +0000 (09:10 +0530)] 
Updated desc for @GNUTLS_NO_DEFAULT_EXTENSIONS

Signed-off-by: peonix <ajeetsinghchahar2@gmail.com>
3 years agoModifier GNUTLS_NO_EXTENSIONS renamed to GNUTLS_NO_DEFAULT_EXTENSIONS
peonix [Tue, 28 Mar 2023 03:38:40 +0000 (09:08 +0530)] 
Modifier GNUTLS_NO_EXTENSIONS renamed to GNUTLS_NO_DEFAULT_EXTENSIONS

Signed-off-by: peonix <ajeetsinghchahar2@gmail.com>
3 years agoMerge branch 'master' into 'master'
Daiki Ueno [Wed, 22 Mar 2023 08:06:28 +0000 (08:06 +0000)] 
Merge branch 'master' into 'master'

add DER crl list import test

See merge request gnutls/gnutls!1733

3 years agofix incorrect parameter description of crl import function
xuraoqing [Wed, 22 Mar 2023 03:46:55 +0000 (11:46 +0800)] 
fix incorrect parameter description of crl import function

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
3 years agopsk: guard against the case where psk_auth_info_t has NULL username
Daiki Ueno [Sun, 19 Mar 2023 04:01:39 +0000 (13:01 +0900)] 
psk: guard against the case where psk_auth_info_t has NULL username

This happens when gnutls_psk_server_get_username is called from a
client.  Also simplify the embedded NUL-byte check with memchr.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agosrc: print_info: prefer gnutls_psk_server_get_username2
Daiki Ueno [Sun, 19 Mar 2023 04:00:36 +0000 (13:00 +0900)] 
src: print_info: prefer gnutls_psk_server_get_username2

gnutls_psk_server_get_username only supports NUL-terminated usernames,
while we added support for non-NULL terminated usernames in
d00638997fa269a975095d852633b48b2b64fbf9.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'master' into 'master'
Daiki Ueno [Mon, 20 Mar 2023 17:19:45 +0000 (17:19 +0000)] 
Merge branch 'master' into 'master'

add get dn by oid test

See merge request gnutls/gnutls!1731

3 years agoadd DER crl list import test
xuraoqing [Mon, 20 Mar 2023 06:43:34 +0000 (14:43 +0800)] 
add DER crl list import test

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
3 years agoadd get dn by oid test
xuraoqing [Mon, 20 Mar 2023 06:18:19 +0000 (14:18 +0800)] 
add get dn by oid test

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
3 years agoMerge branch 'tests-keys_limits_single' into 'master'
Daiki Ueno [Sat, 18 Mar 2023 23:12:33 +0000 (23:12 +0000)] 
Merge branch 'tests-keys_limits_single' into 'master'

test:tls13/key_limits: rewrite key_limits testcase as single process

See merge request gnutls/gnutls!1728

3 years agorewrite tests/tls13/key_limits.c in single process
Yongye Zhu [Sat, 18 Mar 2023 20:33:57 +0000 (15:33 -0500)] 
rewrite tests/tls13/key_limits.c in single process

Signed-off-by: Yongye Zhu <zyy1102000@gmail.com>
3 years agoMerge branch 'wip/dueno/pre-bootstrap' into 'master'
Daiki Ueno [Sat, 18 Mar 2023 08:14:24 +0000 (08:14 +0000)] 
Merge branch 'wip/dueno/pre-bootstrap' into 'master'

.gitlab-ci.yml: make use of .pre stage

See merge request gnutls/gnutls!1729

3 years ago.gitlab-ci.yml: make use of .pre stage
Daiki Ueno [Sat, 18 Mar 2023 01:52:13 +0000 (10:52 +0900)] 
.gitlab-ci.yml: make use of .pre stage

Jobs in the .pre stage run before any other jobs:
https://docs.gitlab.com/ee/ci/yaml/index.html#stage-pre

As commit-check is lightweight and a prerequisite for merging MRs,
this moves it from the test stage to .pre.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'wip/dueno/distrust-after' into 'master'
Daiki Ueno [Fri, 17 Mar 2023 02:44:44 +0000 (02:44 +0000)] 
Merge branch 'wip/dueno/distrust-after' into 'master'

pkcs11: respect Mozilla's time-based distrust upon issuer lookup

Closes #912

See merge request gnutls/gnutls!1725

3 years agopkcs11: respect Mozilla's time-based distrust upon issuer lookup
Daiki Ueno [Mon, 13 Mar 2023 07:58:45 +0000 (16:58 +0900)] 
pkcs11: respect Mozilla's time-based distrust upon issuer lookup

This implements the basic logic needed to support time-based distrust
of CA, according to [1].

1. https://wiki.mozilla.org/CA/Additional_Trust_Changes#Distrust_After

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'master' into 'master'
Daiki Ueno [Mon, 13 Mar 2023 14:04:04 +0000 (14:04 +0000)] 
Merge branch 'master' into 'master'

add CRL issuer get test

See merge request gnutls/gnutls!1722

3 years agotests: add tests for CRL issuer get functions
xuraoqing [Mon, 13 Mar 2023 14:04:03 +0000 (14:04 +0000)] 
tests: add tests for CRL issuer get functions

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
3 years agoMerge branch '2023-fix-ktls-writes' into 'master'
Daiki Ueno [Fri, 10 Mar 2023 23:37:08 +0000 (23:37 +0000)] 
Merge branch '2023-fix-ktls-writes' into 'master'

ktls: Do not return GNUTLS_E_INTERRUPTED/AGAIN from short writes

Closes #1470

See merge request gnutls/gnutls!1723

3 years agoktls: Do not return GNUTLS_E_INTERRUPTED/AGAIN from short writes
Richard W.M. Jones [Fri, 10 Mar 2023 11:15:19 +0000 (11:15 +0000)] 
ktls: Do not return GNUTLS_E_INTERRUPTED/AGAIN from short writes

If sendmsg returns a short write, we end up going around the loop with
data_to_send being smaller.  However if sendmsg then returns -EAGAIN
or -EINTR then we return an error.  But we have "forgotten" that we
already sent some data.

This causes the caller to retry gnutls_record_send with the full
buffer (ie. with a buffer that has already been partially sent),
causing desynchronization.

Instead check if we sent some data in this case and return the number
of bytes sent.

Fixes: https://gitlab.com/gnutls/gnutls/-/issues/1470
Thanks: Dan Berrange for suggesting a fix
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
3 years agoMerge branch 'wip/dueno/ems' into 'master'
Daiki Ueno [Thu, 9 Mar 2023 21:42:41 +0000 (21:42 +0000)] 
Merge branch 'wip/dueno/ems' into 'master'

priority: add %FORCE_SESSION_HASH modifier

Closes #1445

See merge request gnutls/gnutls!1711

3 years agotests: skip TLS 1.2 resume tests without EMS under FIPS
Daiki Ueno [Thu, 9 Mar 2023 05:09:14 +0000 (14:09 +0900)] 
tests: skip TLS 1.2 resume tests without EMS under FIPS

In FIPS mode, extended master secret is required and those tests are
not supported.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agotests: close unused peer socket in the tests using socketpair
Daiki Ueno [Sun, 5 Mar 2023 06:20:35 +0000 (15:20 +0900)] 
tests: close unused peer socket in the tests using socketpair

Otherwise, the subsequent call to wait will block, when the child
process exits abnormally.  Checked with the following script:

  for i in $(git grep -l socketpair); do
          if ! grep -q 'close.*\[' $i; then echo $i; fi
  done

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agofips: enable %FORCE_SESSION_HASH by default under FIPS mode
Daiki Ueno [Tue, 21 Feb 2023 06:35:37 +0000 (15:35 +0900)] 
fips: enable %FORCE_SESSION_HASH by default under FIPS mode

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agopriority: add %FORCE_SESSION_HASH modifier
Daiki Ueno [Tue, 21 Feb 2023 05:46:09 +0000 (14:46 +0900)] 
priority: add %FORCE_SESSION_HASH modifier

This adds a new priority string modifier %FORCE_SESSION_HASH, which
requires to negotiate extended master secret and aborts the connection
if the peer does not send the extension in hello messages.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'master' into 'master'
Daiki Ueno [Tue, 7 Mar 2023 05:34:56 +0000 (05:34 +0000)] 
Merge branch 'master' into 'master'

add gnutls_pkcs7_get_signature_count test

See merge request gnutls/gnutls!1721

3 years agoadd gnutls_pkcs7_get_signature_count test
xuraoqing [Mon, 6 Mar 2023 06:42:16 +0000 (14:42 +0800)] 
add gnutls_pkcs7_get_signature_count test

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
3 years agoMerge branch 'wip/dueno/ci-fedora37' into 'master'
Daiki Ueno [Thu, 2 Mar 2023 07:50:25 +0000 (07:50 +0000)] 
Merge branch 'wip/dueno/ci-fedora37' into 'master'

.gitlab-ci.yml: switch to Fedora 37 images

See merge request gnutls/gnutls!1719

3 years ago.gitlab-ci.yml: switch to Fedora 37 images
Daiki Ueno [Thu, 2 Mar 2023 04:24:22 +0000 (13:24 +0900)] 
.gitlab-ci.yml: switch to Fedora 37 images

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'master' into 'master'
Daiki Ueno [Tue, 28 Feb 2023 08:52:10 +0000 (08:52 +0000)] 
Merge branch 'master' into 'master'

remove unused extern variables

See merge request gnutls/gnutls!1718

3 years agoMerge branch 'wip/dueno/perl-path' into 'master'
Daiki Ueno [Tue, 28 Feb 2023 06:04:38 +0000 (06:04 +0000)] 
Merge branch 'wip/dueno/perl-path' into 'master'

doc: Don't depend on /usr/bin/perl in the Makefile.am.

See merge request gnutls/gnutls!1717

3 years agodoc: Don't depend on /usr/bin/perl in the Makefile.am.
Christopher Baines [Tue, 20 Sep 2022 09:33:45 +0000 (11:33 +0200)] 
doc: Don't depend on /usr/bin/perl in the Makefile.am.

Instead, work if perl is on the $PATH. I hit this problem on GNU Guix
which doesn't use the /usr/bin directory.

Signed-off-by: Christopher Baines <mail@cbaines.net>
3 years agoremove unused extern variables
xuraoqing [Tue, 28 Feb 2023 03:40:11 +0000 (11:40 +0800)] 
remove unused extern variables

Signed-off-by: xuraoqing <xuraoqing@huawei.com>
3 years agoMerge branch 'PCT-DH-keygen' into 'master'
Daiki Ueno [Mon, 27 Feb 2023 14:59:38 +0000 (14:59 +0000)] 
Merge branch 'PCT-DH-keygen' into 'master'

pk: extend pair-wise consistency to cover DH key generation

See merge request gnutls/gnutls!1707

3 years agopk: extend pair-wise consistency to cover DH key generation
Pedro Monreal [Thu, 16 Feb 2023 16:02:38 +0000 (17:02 +0100)] 
pk: extend pair-wise consistency to cover DH key generation

Perform SP800 56A (rev 3) 5.6.2.1.4 Owner Assurance of Pair-wise
Consistency check, even if we only support ephemeral DH, as it is
required by FIPS 140-3 IG 10.3.A.

Signed-off-by: Pedro Monreal <pmgdeb@gmail.com>
Co-authored-by: Daiki Ueno <ueno@gnu.org>
3 years agoMerge branch 'master' into 'master'
Daiki Ueno [Mon, 27 Feb 2023 05:37:50 +0000 (05:37 +0000)] 
Merge branch 'master' into 'master'

fix possible memory leakage

See merge request gnutls/gnutls!1714