]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
5 months agoVersion bump to 6.0.0rc1 6.0.0rc1
Andreas Steffen [Mon, 25 Nov 2024 10:11:17 +0000 (11:11 +0100)] 
Version bump to 6.0.0rc1

5 months agotesting: Added ML-KEM test cases
Andreas Steffen [Sat, 23 Nov 2024 15:53:02 +0000 (16:53 +0100)] 
testing: Added ML-KEM test cases

5 months agotesting: Fixed typos
Andreas Steffen [Sat, 23 Nov 2024 14:06:37 +0000 (15:06 +0100)] 
testing: Fixed typos

5 months agogithub: Install pkgconf instead of pkg-config on macOS
Tobias Brunner [Fri, 22 Nov 2024 14:19:04 +0000 (15:19 +0100)] 
github: Install pkgconf instead of pkg-config on macOS

The package was apparently renamed/transitioned, but that doesn't really
work properly (causes a symlink issue when installing via pkg-config).

5 months agoml: Fix compilation with some compilers
Tobias Brunner [Fri, 22 Nov 2024 13:42:34 +0000 (14:42 +0100)] 
ml: Fix compilation with some compilers

Some (older) compilers complain that "variable-sized object may not be
initialized".

5 months agofuzz: Fix build after changing default plugins
Tobias Brunner [Sat, 5 Nov 2022 14:24:49 +0000 (15:24 +0100)] 
fuzz: Fix build after changing default plugins

5 months agotraffic-selector: Add workaround for possibly bogus warning with GCC 14
Tobias Brunner [Fri, 25 Oct 2024 10:48:52 +0000 (12:48 +0200)] 
traffic-selector: Add workaround for possibly bogus warning with GCC 14

When compiling with -O3 with GCC 14, we get the following warning/error:

/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: error: '__builtin_memcpy' offset [0, 3] is out of the bounds [0, 0] [-Werror=array-bounds=]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~

Which seems completely bogus as that array has a fixed size of 16 and
some weird workarounds remove the warning (e.g. adding an assignment
to `subset->netbits` before the `memcpy()`).  This is also the only
place GCC complains about and we use `memcpy()` all over the place
in this file to set those addresses.

Closes strongswan/strongswan#2509

5 months agoNEWS: Add some news for 6.0.0
Tobias Brunner [Thu, 15 Jun 2023 12:04:46 +0000 (14:04 +0200)] 
NEWS: Add some news for 6.0.0

5 months agolibcharon: Enable make_before_break option by default
Andreas Steffen [Wed, 4 Jan 2023 17:31:00 +0000 (18:31 +0100)] 
libcharon: Enable make_before_break option by default

5 months agoMerge commit 'default-plugins'
Tobias Brunner [Fri, 22 Nov 2024 13:17:17 +0000 (14:17 +0100)] 
Merge commit 'default-plugins'

Changes the default crypto plugins from the built-in ones to openssl.

5 months agoDefine new default plugins
Andreas Steffen [Sat, 22 Oct 2022 09:29:33 +0000 (11:29 +0200)] 
Define new default plugins

5 months agotesting: Migrated wolfssl scenarios
Andreas Steffen [Fri, 21 Oct 2022 18:38:16 +0000 (20:38 +0200)] 
testing: Migrated wolfssl scenarios

5 months agotesting: Migrated tnc scenarios to new default plugins
Andreas Steffen [Fri, 21 Oct 2022 18:19:11 +0000 (20:19 +0200)] 
testing: Migrated tnc scenarios to new default plugins

5 months agotesting: Migrated tkm scenarios to new default plugins
Andreas Steffen [Fri, 21 Oct 2022 18:07:14 +0000 (20:07 +0200)] 
testing: Migrated tkm scenarios to new default plugins

5 months agotesting: Migrated sql scenarios to new default plugins
Andreas Steffen [Thu, 20 Oct 2022 20:13:14 +0000 (22:13 +0200)] 
testing: Migrated sql scenarios to new default plugins

5 months agotesting: Migrated route-based scenarios to new default plugins
Andreas Steffen [Thu, 20 Oct 2022 14:51:31 +0000 (16:51 +0200)] 
testing: Migrated route-based scenarios to new default plugins

5 months agotesting: Migrated pfkey scenarios to new default plugins
Andreas Steffen [Thu, 20 Oct 2022 14:29:34 +0000 (16:29 +0200)] 
testing: Migrated pfkey scenarios to new default plugins

5 months agotesting: Migrated p2pnat scenarios to new default plugins
Andreas Steffen [Thu, 20 Oct 2022 08:21:27 +0000 (10:21 +0200)] 
testing: Migrated p2pnat scenarios to new default plugins

5 months agotesting: Migrated libipsec scenarios to new default plugins
Andreas Steffen [Thu, 20 Oct 2022 08:17:32 +0000 (10:17 +0200)] 
testing: Migrated libipsec scenarios to new default plugins

5 months agotesting: Migrated ha scenarios to new default plugins
Andreas Steffen [Thu, 20 Oct 2022 07:39:46 +0000 (09:39 +0200)] 
testing: Migrated ha scenarios to new default plugins

5 months agotesting: Migrated gcrypt-ikev2 scenarios
Andreas Steffen [Thu, 20 Oct 2022 02:54:56 +0000 (04:54 +0200)] 
testing: Migrated gcrypt-ikev2 scenarios

5 months agotesting: Migrated botan scenarios
Andreas Steffen [Thu, 20 Oct 2022 02:15:28 +0000 (04:15 +0200)] 
testing: Migrated botan scenarios

5 months agotesting: Migrated af-alg scenarios
Andreas Steffen [Wed, 19 Oct 2022 08:57:22 +0000 (10:57 +0200)] 
testing: Migrated af-alg scenarios

5 months agotesting: Migrated ike scenarios to new default plugins
Andreas Steffen [Wed, 19 Oct 2022 07:11:54 +0000 (09:11 +0200)] 
testing: Migrated ike scenarios to new default plugins

5 months agotesting: Migrated ikev1-stroke to new default plugins
Andreas Steffen [Wed, 19 Oct 2022 07:02:37 +0000 (09:02 +0200)] 
testing: Migrated ikev1-stroke to new default plugins

5 months agotesting: Migrated ikev2-stroke scenarios to new default plugins
Andreas Steffen [Wed, 19 Oct 2022 06:01:27 +0000 (08:01 +0200)] 
testing: Migrated ikev2-stroke scenarios to new default plugins

5 months agotesting: Migrated ipv6-stroke scenarios to new default plugins
Andreas Steffen [Wed, 19 Oct 2022 05:25:26 +0000 (07:25 +0200)] 
testing: Migrated ipv6-stroke scenarios to new default plugins

5 months agotesting: Migrated ipv6 scenarios to new default plugins
Andreas Steffen [Wed, 19 Oct 2022 05:20:18 +0000 (07:20 +0200)] 
testing: Migrated ipv6 scenarios to new default plugins

5 months agotesting: Distributed openssl-ikev1 scenarios
Andreas Steffen [Tue, 18 Oct 2022 19:40:36 +0000 (21:40 +0200)] 
testing: Distributed openssl-ikev1 scenarios

5 months agotesting: Migrated ikev1-algs scenarios to new default plugins
Andreas Steffen [Tue, 18 Oct 2022 19:24:40 +0000 (21:24 +0200)] 
testing: Migrated ikev1-algs scenarios to new default plugins

5 months agotesting: Migrated ikev1 scenarios to new default plugins
Andreas Steffen [Tue, 18 Oct 2022 19:11:38 +0000 (21:11 +0200)] 
testing: Migrated ikev1 scenarios to new default plugins

5 months agotesting: Distributed openssl-ikev2 scenarios
Andreas Steffen [Tue, 18 Oct 2022 17:15:08 +0000 (19:15 +0200)] 
testing: Distributed openssl-ikev2 scenarios

5 months agotesting: Migrated ikev2-algs scenarios to new default plugins
Andreas Steffen [Tue, 18 Oct 2022 17:41:49 +0000 (19:41 +0200)] 
testing: Migrated ikev2-algs scenarios to new default plugins

5 months agotesting: Migrated ikev2 scenarios to new default plugins
Andreas Steffen [Tue, 18 Oct 2022 15:44:30 +0000 (17:44 +0200)] 
testing: Migrated ikev2 scenarios to new default plugins

5 months agoml: Store decoded public/private key and matrix A on initiator
Tobias Brunner [Mon, 28 Oct 2024 14:12:32 +0000 (15:12 +0100)] 
ml: Store decoded public/private key and matrix A on initiator

While this does require quite a bit of memory, on initiators there are
usually fewer concurrent SAs getting created so this should be less of
an issue than on a gateway that handles lots of SAs as responder.

The speed up is about 30% on the initiator during the decapsulation,
while the key generation does take a bit more time (about 3%).

5 months agoml: Add software implementation of ML-KEM
Tobias Brunner [Mon, 21 Oct 2024 08:38:14 +0000 (10:38 +0200)] 
ml: Add software implementation of ML-KEM

This follows FIPS 203 relatively closely but takes some ideas from the
reference implementation.  In particular, how to avoid potential
side-channels via direct C division/modulo operations.  However, it just
uses Barrett reduction (no Montgomery reduction) and no negative
coefficients to avoid number format conversions and keep the
implementation clearer.

5 months agomemory: Add helper function to conditionally copy data in constant time
Tobias Brunner [Tue, 29 Oct 2024 17:33:00 +0000 (18:33 +0100)] 
memory: Add helper function to conditionally copy data in constant time

5 months agomgf1: Support of RSA PSS with SHA3 hash
Andreas Steffen [Thu, 5 Jan 2023 14:10:32 +0000 (15:10 +0100)] 
mgf1: Support of RSA PSS with SHA3 hash

5 months agontru: Remove legacy NTRU key exchange method
Andreas Steffen [Wed, 18 Nov 2020 09:39:28 +0000 (10:39 +0100)] 
ntru: Remove legacy NTRU key exchange method

5 months agonewhope: Remove legacy Newhope key exchange method
Andreas Steffen [Tue, 17 Nov 2020 18:27:20 +0000 (19:27 +0100)] 
newhope: Remove legacy Newhope key exchange method

5 months agobliss: Remove legacy BLISS signatures
Andreas Steffen [Mon, 16 Nov 2020 19:22:21 +0000 (20:22 +0100)] 
bliss: Remove legacy BLISS signatures

5 months agoopenssl: Add ML-KEM support with AWS-LC
Gerardo Ravago [Fri, 4 Oct 2024 14:26:16 +0000 (10:26 -0400)] 
openssl: Add ML-KEM support with AWS-LC

This registers support for the ML_KEM_{512,768,1024} key exchange
algorithms in the `openssl` plugin when built using AWS-LC as the
libcrypto. To do this, we introduce the `openssl_kem` source files
which implement the key exchange algorithm using the Key Encapsulation
Mechanism (KEM) API. Future KEM algorithms can be implemented
generically using this interface by substituting the appropriate NIDs.

It also supports both seeded (via DRBG) and unseeded modes depending
on the user's requirements for KATs or entropy sources.

It should be noted that this does not add support for KEM algorithms
within upstream OpenSSL and is API incompatible. Future work will need
to condition out the incompatibilities as-appropriate. However, the
high-level logic should be the same for all KEMs and KEM APIs.

References strongswan/strongswan#2228
Closes strongswan/strongswan#2490

5 months agobotan: Add support for ML-KEM
Tobias Brunner [Tue, 8 Oct 2024 09:51:42 +0000 (11:51 +0200)] 
botan: Add support for ML-KEM

5 months agoUse Botan 3.6.1 for tests
Tobias Brunner [Wed, 23 Oct 2024 14:48:36 +0000 (16:48 +0200)] 
Use Botan 3.6.1 for tests

With 3.6.0 support for ML-KEM was added.

5 months agobotan: Add support for AES in ECB mode to support DRBG_CTR_AES
Tobias Brunner [Wed, 23 Oct 2024 15:14:56 +0000 (17:14 +0200)] 
botan: Add support for AES in ECB mode to support DRBG_CTR_AES

This DRBG is used to test ML-KEM.

5 months agobotan: Fix include issue that prevented parsing public keys
Tobias Brunner [Wed, 23 Oct 2024 14:45:32 +0000 (16:45 +0200)] 
botan: Fix include issue that prevented parsing public keys

Botan stopped including build.h in ffi.h with 3.4.0, so we have to
add this here explicitly to check for the enabled key types.

5 months agowolfssl: Add support for ML-KEM
Tobias Brunner [Fri, 4 Oct 2024 09:24:49 +0000 (11:24 +0200)] 
wolfssl: Add support for ML-KEM

5 months agoUse wolfSSL 5.7.4 for tests
Tobias Brunner [Mon, 28 Oct 2024 09:34:08 +0000 (10:34 +0100)] 
Use wolfSSL 5.7.4 for tests

This adds support for ML-KEM etc.

5 months agotest-vectors: Add ML-KEM test vectors
Tobias Brunner [Thu, 3 Oct 2024 11:50:21 +0000 (13:50 +0200)] 
test-vectors: Add ML-KEM test vectors

The vectors are generated using the `kat_kem` utility of the liboqs
project and then converted using the `nist_kem_kat` script.

5 months agoscripts: Add script formatting NIST KEM KAT records into ke_test vectors
Andreas Steffen [Tue, 5 Nov 2019 11:16:49 +0000 (12:16 +0100)] 
scripts: Add script formatting NIST KEM KAT records into ke_test vectors

5 months agodh-speed: Use method call order compatible with KEMs
Tobias Brunner [Tue, 8 Oct 2024 14:36:47 +0000 (16:36 +0200)] 
dh-speed: Use method call order compatible with KEMs

Also prints the speed of the derivation (or decapsulation) for the
initiator.

5 months agokey-exchange: Document how the interface is used with KEMs
Tobias Brunner [Mon, 7 Oct 2024 09:56:40 +0000 (11:56 +0200)] 
key-exchange: Document how the interface is used with KEMs

5 months agokey-exchange: Joint ke_test_vector format for DH and KEM
Andreas Steffen [Mon, 4 Nov 2019 21:22:47 +0000 (22:22 +0100)] 
key-exchange: Joint ke_test_vector format for DH and KEM

Both Diffie-Hellman (DH) and Key Encapsulation Mechanism (KEM) based
key exchange methods use a common ke_test_vector format. The
set_seed() function is used to provide deterministic private key
material for the crypto tests.

5 months agokey-exchange: Add identifiers for ML-KEM algorithms
Tobias Brunner [Thu, 3 Oct 2024 07:31:40 +0000 (09:31 +0200)] 
key-exchange: Add identifiers for ML-KEM algorithms

6 months agoswanctl: Document soft lifetime defaults if hard lifetimes are configured
Tobias Brunner [Wed, 30 Oct 2024 11:07:04 +0000 (12:07 +0100)] 
swanctl: Document soft lifetime defaults if hard lifetimes are configured

6 months agomem-pool: Fix issue with make-before-break reauth and multiple IKE_SAs
Tobias Brunner [Mon, 30 Sep 2024 10:26:05 +0000 (12:26 +0200)] 
mem-pool: Fix issue with make-before-break reauth and multiple IKE_SAs

If uniqueness checks are disabled and multiple IKE_SAs with the same
identities are created, an offline lease could have gotten reassigned
during a make-before-break reauthentication if such an SA was closed
earlier.  Checking for an online lease for the same client (IP/port)
first ensures that the correct IP is reassigned during the
reauthentication.

References strongswan/strongswan#2472

6 months agofile-logger: Take options as a struct and combine ms/us suffix options
Tobias Brunner [Wed, 9 Oct 2024 15:53:39 +0000 (17:53 +0200)] 
file-logger: Take options as a struct and combine ms/us suffix options

References strongswan/strongswan#2475

6 months agofile-logger: Add support to log timestamp in microseconds
Tobias Brunner [Wed, 9 Oct 2024 15:40:55 +0000 (17:40 +0200)] 
file-logger: Add support to log timestamp in microseconds

Closes strongswan/strongswan#2475

6 months agofile-logger: Add option to log messages as JSON objects
Tobias Brunner [Thu, 25 Apr 2024 15:09:48 +0000 (17:09 +0200)] 
file-logger: Add option to log messages as JSON objects

Closes strongswan/strongswan#2222

6 months agosocket-default: Always open IPv4 sockets before IPv6 sockets
Tobias Brunner [Fri, 18 Oct 2024 07:14:27 +0000 (09:14 +0200)] 
socket-default: Always open IPv4 sockets before IPv6 sockets

Since we now open sockets for each address family independently (via
IPV6_V6ONLY) and without SO_REUSEADDR, it could happen with the previous
order on Linux that opening the port that was allocated as ephemeral
port for IPv6 was already used by a different process for IPv4.

Most IPv6 sockets on ephemeral ports will not have IPV6_V6ONLY set, so
the same port is also reserved for IPv4.  Therefore, it's save to assume
that any ephemeral port we first get for IPv4 is free for IPv6.

References strongswan/strongswan#2494

6 months agoopenssl: Add support for new API to squeeze data from XOFs
Tobias Brunner [Thu, 23 Nov 2023 14:36:45 +0000 (15:36 +0100)] 
openssl: Add support for new API to squeeze data from XOFs

This new API doesn't require a temporary buffer and generating a lot
of already consumed output.

6 months agoleak-detective: Whitelist OpenSSL 3.2 function
Tobias Brunner [Wed, 20 Mar 2024 13:52:16 +0000 (14:52 +0100)] 
leak-detective: Whitelist OpenSSL 3.2 function

6 months agocertificate_printer: Fix spacing for additional CRL/OCSP URIs
Andreas Steffen [Thu, 17 Oct 2024 08:46:27 +0000 (10:46 +0200)] 
certificate_printer: Fix spacing for additional CRL/OCSP URIs

Multiple occurences of CRL and OCSP URIs where not indented correctly.

6 months agonm: Update build files and switch from intltool to gettext
Tobias Brunner [Tue, 15 Oct 2024 14:59:10 +0000 (16:59 +0200)] 
nm: Update build files and switch from intltool to gettext

gnome-common has been deprecated, so has intltool.  This follows GNOME's
recommended migration paths.

6 months agoRevert "conf: Add support for escaping dots in section/option names"
Tobias Brunner [Tue, 15 Oct 2024 10:44:02 +0000 (12:44 +0200)] 
Revert "conf: Add support for escaping dots in section/option names"

This reverts commit 84a3077e780e7b25bf536da42a583bdc18448362.

Support for dots in names of settings was removed quite a while ago and
now the \. sequence caused `SyntaxWarning: invalid escape sequence`.

6 months agowolfssl: Don't undef PARSE_ERROR as headers included later might refer to it
Tobias Brunner [Fri, 4 Oct 2024 09:23:28 +0000 (11:23 +0200)] 
wolfssl: Don't undef PARSE_ERROR as headers included later might refer to it

7 months agovici-config: Same order for default ESP proposals if unset or set to "default"
Tobias Brunner [Wed, 2 Oct 2024 08:33:05 +0000 (10:33 +0200)] 
vici-config: Same order for default ESP proposals if unset or set to "default"

The order was different when not setting `esp_proposals` or explicitly
configuring `default`.

Fixes: 33412158f58c ("ike: Send AEAD ESP default proposal first")
7 months agogenerator: Make debug log for payload substructure rules more clear
Tobias Brunner [Wed, 2 Oct 2024 08:06:41 +0000 (10:06 +0200)] 
generator: Make debug log for payload substructure rules more clear

Similar to the previous commit.  Instead of

  generating rule 10 (1258)

followed by (or not if the list is empty)

  generating payload of type PROPOSAL_SUBSTRUCTURE

we now get

  generating rule 10 LIST of PROPOSAL_SUBSTRUCTURE

in the debug log.

7 months agoparser: Make debug log for payload substructure rules more clear
Tobias Brunner [Wed, 2 Oct 2024 07:57:14 +0000 (09:57 +0200)] 
parser: Make debug log for payload substructure rules more clear

Instead of this

  parsing rule 10 (1258)

we now see this

  parsing rule 10 LIST of PROPOSAL_SUBSTRUCTURE

in the debug log. Particularly useful if the list is empty as there won't
be a message like this following it:

  x bytes left, parsing recursively PROPOSAL_SUBSTRUCTURE

7 months agoMerge branch 'tun-device-ipv6'
Tobias Brunner [Wed, 25 Sep 2024 14:12:49 +0000 (16:12 +0200)] 
Merge branch 'tun-device-ipv6'

Adds support for IPv6 addresses on TUN devices, in particular, to support
virtual IPv6 addresses on FreeBSD/macOS.

Closes strongswan/strongswan#2465

7 months agokernel-pfroute: Route via interface if we don't have a next hop
Tobias Brunner [Tue, 28 Sep 2021 08:10:04 +0000 (10:10 +0200)] 
kernel-pfroute: Route via interface if we don't have a next hop

Compared to RTA_IFP, the format is different when passing an interface
as RTA_GATEWAY, it requires the interface's address and not its name.

7 months agotun-device: Fix handling of IPv6 addresses
Tobias Brunner [Fri, 27 Aug 2021 16:18:09 +0000 (18:18 +0200)] 
tun-device: Fix handling of IPv6 addresses

struct ifreq can't be used for IPv6 as the ifr_addr member is not large
enough.  Actually, configuring an IPv6 address via an AF_INET socket won't
work anyway.  And unfortunately, it's not standardized how IPv6 addresses
are installed, so we have to do this quite differently on Linux and on BSD.
However, we already use SIOCAIFADDR for IPv4 on newer FreeBSD systems,
which wasn't the case when this patch was originally created in 2014.

7 months agoMerge branch 'tkm-multi-ke'
Tobias Brunner [Thu, 19 Sep 2024 13:20:31 +0000 (15:20 +0200)] 
Merge branch 'tkm-multi-ke'

Adds support for multiple key exchanges to charon-tkm.

7 months agotesting: Add TKM scenarios with multiple key exchanges
Tobias Brunner [Wed, 17 Nov 2021 13:43:38 +0000 (14:43 +0100)] 
testing: Add TKM scenarios with multiple key exchanges

7 months agocharon-tkm: Add tests with multiple key exchanges
Tobias Brunner [Wed, 24 Nov 2021 14:53:19 +0000 (15:53 +0100)] 
charon-tkm: Add tests with multiple key exchanges

7 months agocharon-tkm: Adapt to interface changes to support multiple key exchanges
Stefan Berghofer [Thu, 29 Jul 2021 14:25:15 +0000 (14:25 +0000)] 
charon-tkm: Adapt to interface changes to support multiple key exchanges

Also includes ESA flags.

Co-authored-by: Tobias Brunner <tobias@strongswan.org>
7 months agoMerge branch 'vici-reload-tasks'
Tobias Brunner [Thu, 19 Sep 2024 08:11:49 +0000 (10:11 +0200)] 
Merge branch 'vici-reload-tasks'

Consider queued child-creating tasks when reloading configs that have
`start` as start action.  Besides some possible corner cases it fixes
handling IKE_SAs that are current getting established and have no
established CHILD_SAs yet.

Closes strongswan/strongswan#2418

7 months agovici-config: Consider queued tasks when terminating IKE/CHILD_SAs
Tobias Brunner [Tue, 3 Sep 2024 14:15:02 +0000 (16:15 +0200)] 
vici-config: Consider queued tasks when terminating IKE/CHILD_SAs

This is particularly important for IKE_SAs that are not yet established,
which would get terminated as they have no established CHILD_SAs yet.

Fixes: 72f9a21b22e9 ("Merge branch 'vici-reload-actions'")
7 months agoquick-mode: Allow "aborting" task if it's currently active
Tobias Brunner [Tue, 3 Sep 2024 14:09:54 +0000 (16:09 +0200)] 
quick-mode: Allow "aborting" task if it's currently active

Basically the same as the previous commit.

7 months agochild-create: Allow "aborting" task if it's currently active
Tobias Brunner [Tue, 3 Sep 2024 14:05:44 +0000 (16:05 +0200)] 
child-create: Allow "aborting" task if it's currently active

We can't actually abort an active exchange, but we can delete the SA
immediately after its creation.

7 months agoquick-mode: Add getter for child config
Tobias Brunner [Tue, 3 Sep 2024 12:51:28 +0000 (14:51 +0200)] 
quick-mode: Add getter for child config

7 months agochild-create: Add getter for child config
Tobias Brunner [Tue, 3 Sep 2024 12:51:46 +0000 (14:51 +0200)] 
child-create: Add getter for child config

7 months agochecksum: Avoid compiler warning/error when building monolithic
Tobias Brunner [Fri, 6 Sep 2024 08:16:10 +0000 (10:16 +0200)] 
checksum: Avoid compiler warning/error when building monolithic

References strongswan/strongswan#2446

7 months agogithub: Update AWS-LC to 1.35.0 for tests
Tobias Brunner [Wed, 18 Sep 2024 06:49:52 +0000 (08:49 +0200)] 
github: Update AWS-LC to 1.35.0 for tests

7 months agoarray: Don't use realloc() with zero size in array_compress()
Thomas Egerer [Fri, 6 Sep 2024 11:29:40 +0000 (13:29 +0200)] 
array: Don't use realloc() with zero size in array_compress()

The behavior of realloc(3) with zero size was apparently implementation
defined.  While glibc documents the behavior as equivalent to free(3),
that might not apply to other C libraries.  With C17, this behavior has
been deprecated, and with C23, the behavior is now undefined.  It's also
why valgrind warns about this use.

Hence, when array_compress() would call realloc() with a zero size, we
now call free() explicitly and set the pointer to NULL.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
8 months agocert-enroll: Fixed typo
Andreas Steffen [Sat, 7 Sep 2024 15:13:00 +0000 (17:13 +0200)] 
cert-enroll: Fixed typo

This typo prevented the cert-enroll script from successfully
signalling a detected change of the sub CA certificate.

8 months agogithub: Use more verbose output for apt-get calls
Tobias Brunner [Thu, 5 Sep 2024 08:46:39 +0000 (10:46 +0200)] 
github: Use more verbose output for apt-get calls

With -qq we don't see any detailed error messages.

8 months agoike-cfg: Only consider port information if the IP matches
Tobias Brunner [Wed, 4 Sep 2024 13:08:47 +0000 (15:08 +0200)] 
ike-cfg: Only consider port information if the IP matches

Otherwise, all configs would be considered to even some degree as the
ports usually match.

Closes strongswan/strongswan#2441

Fixes: 9228a5109b8d ("ike-cfg: Consider port information in IKE config match")
9 months agokey-exchange: Pass prefix array directly, not a pointer to it
Tobias Brunner [Thu, 8 Aug 2024 09:19:16 +0000 (11:19 +0200)] 
key-exchange: Pass prefix array directly, not a pointer to it

9 months agochild-create: Remove redundant variable assignment
Tobias Brunner [Thu, 8 Aug 2024 09:18:24 +0000 (11:18 +0200)] 
child-create: Remove redundant variable assignment

9 months agoMerge branch 'multi-ke'
Tobias Brunner [Wed, 7 Aug 2024 14:20:42 +0000 (16:20 +0200)] 
Merge branch 'multi-ke'

This adds support for multiple key exchanges (no KEMs yet as none are
standardized so far).  Work on this started over five years ago and went
through multiple iterations (first our own protocol, then standardized
extensions in different variations).

IKE_INTERMEDIATE exchanges, defined RFC 9242, are used to transport
multiple KE payloads between the IKE_SA_INIT and IKE_AUTH exchanges.
To rekey IKE and CHILD_SAs with multiple key exchanges, IKE_FOLLOWUP_KE
exchanges are used, as defined in RFC 9370.

In proposals, additional key exchange methods are configured via `keX_`
prefix, where X is a number between 1 and 7.  For example, `ke1_ecp256`
adds ECP_256 as additional KE method.  As with regular key exchanges,
peers have to agree on a method for each round unless no algorithms are
defined by both or `keX_none` is configured to make that round explicitly
optional.

Also changed is how rekey collisions are handled, which makes CHILD_SAs
properly trackable via child_rekey() hook.

9 months agotesting: Add ikev2/rw-cert-multi-ke scenario
Tobias Brunner [Thu, 6 Jun 2024 15:48:38 +0000 (17:48 +0200)] 
testing: Add ikev2/rw-cert-multi-ke scenario

9 months agounit-tests: Ensure listeners can track SAs via ike/child_updown/rekey()
Tobias Brunner [Fri, 9 Sep 2022 16:34:29 +0000 (18:34 +0200)] 
unit-tests: Ensure listeners can track SAs via ike/child_updown/rekey()

Previously, it could happen that child_rekey() was triggered twice for
the same "old" SA.  For listeners that would mean they'd loose track as
they'd be tracking a new SA that wasn't relevant anymore and for which
no updown event would ever get triggered (it was the redundant SA in a
collision).  This new assert ensures that events are triggered in a
predictable way and listeners can track SAs properly.

9 months agoikev2: Make CHILD_SAs properly trackable during rekey collisions
Tobias Brunner [Mon, 22 Aug 2022 13:43:16 +0000 (15:43 +0200)] 
ikev2: Make CHILD_SAs properly trackable during rekey collisions

As the winner of a rekey collision, we previously always triggered the
child_rekey() event once when creating the redundant SA on behalf of the
peer in the passive child-rekey task and then a second time when
creating the winning SA in the active task.  However, both calls passed
the replaced CHILD_SA as "old". This made tracking CHILD_SAs impossible
because there was no transition from the redundant, "new" SA of the
first event to the "new", winning SA of the second.  Of course, when the
second event was triggered, the redundant SA might not have existed
anymore because the peer is expected to delete it, which could happen
before the CREATE_CHILD_SA response arrives at the initiator.

This refactoring ensures that the child_rekey() event is triggered in
a way that makes the CHILD_SAs trackable in all reasonable (and even
some unreasonable) scenarios.  The event is generally only triggered
once after installing the outbound SA for the new/winning CHILD_SA.
This can be when processing the CREATE_CHILD_SA in the active child-rekey
task, or when processing the DELETE for the old SA in a passive
child-delete task.  There are some cases where the event is still
triggered twice, but it is now ensured that listeners can properly
transition to the winning SA.

Some corner cases are now also handled correctly, e.g. if a responder's
DELETE for the new CHILD_SA arrives before its CREATE_CHILD_SA response
that actually creates it on the initiator.  Also handled properly are
responders of rekeyings that incorrectly send a DELETE for the old
CHILD_SA (previously this caused both, the new and the old SA, to get
deleted).

9 months agoike-init: Indicate support for IKE_INTERMEDIATE
Tobias Brunner [Tue, 5 Nov 2019 15:42:58 +0000 (16:42 +0100)] 
ike-init: Indicate support for IKE_INTERMEDIATE

9 months agoproposal: Prevent selection of duplicate key exchange methods
Tobias Brunner [Fri, 16 Jul 2021 11:52:19 +0000 (13:52 +0200)] 
proposal: Prevent selection of duplicate key exchange methods

All additional (and the initial) key exchanges must use a different method.

9 months agoproposal: Add helper to check if additional key exchanges are contained
Tobias Brunner [Tue, 5 Nov 2019 16:03:42 +0000 (17:03 +0100)] 
proposal: Add helper to check if additional key exchanges are contained

9 months agoproposal: Accept NONE for additional key exchanges also for IKE proposals
Tobias Brunner [Thu, 22 Oct 2020 11:13:00 +0000 (13:13 +0200)] 
proposal: Accept NONE for additional key exchanges also for IKE proposals

9 months agounit-tests: Add tests for CHILD_SA rekeying with multiple key exchanges
Tobias Brunner [Mon, 29 Jun 2020 12:13:53 +0000 (14:13 +0200)] 
unit-tests: Add tests for CHILD_SA rekeying with multiple key exchanges

9 months agounit-tests: Add tests for CHILD_SA creation with multiple key exchanges
Tobias Brunner [Fri, 26 Jun 2020 12:12:47 +0000 (14:12 +0200)] 
unit-tests: Add tests for CHILD_SA creation with multiple key exchanges