]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
2 months agovici: Document that the log event only receives messages on level 0 and 1
Tobias Brunner [Thu, 22 May 2025 12:05:51 +0000 (14:05 +0200)] 
vici: Document that the log event only receives messages on level 0 and 1

2 months agoMerge branch 'initiate-cancel'
Tobias Brunner [Mon, 19 May 2025 15:21:57 +0000 (17:21 +0200)] 
Merge branch 'initiate-cancel'

Allow proper shutdown if a deadlock is caused by too many concurrent
blocking initiation requests.

References strongswan/strongswan#2776

2 months agovici: Make threads handling requests get canceled explicitly
Tobias Brunner [Tue, 13 May 2025 14:47:13 +0000 (16:47 +0200)] 
vici: Make threads handling requests get canceled explicitly

Threads initiating SAs can get stuck on the semaphore in
wait_for_listener() during shutdown if the corresponding job is never
executed.  A particular case when this can happen is if more initiations
are triggered than worker threads are available.  This causes a (known)
deadlock as no workers are free anymore to process jobs (for inbound
messages or timeouts etc.), including the one to initiate an SA.
This change at least allows a proper shutdown.

2 months agovici: Don't pass stack variable to thread cleanup handler
Tobias Brunner [Tue, 13 May 2025 14:43:07 +0000 (16:43 +0200)] 
vici: Don't pass stack variable to thread cleanup handler

The variable seems to get overwritten during cleanup, causing a
segmentation fault because either the pointer and/or the length is
invalid.

2 months agocontroller: Avoid memory leak if initiate job is never executed
Tobias Brunner [Tue, 13 May 2025 14:35:40 +0000 (16:35 +0200)] 
controller: Avoid memory leak if initiate job is never executed

This can happen if the daemon is terminated while an initiation is
pending.

2 months agouci: Remove obsolete and broken plugin
Tobias Brunner [Mon, 19 May 2025 13:49:58 +0000 (15:49 +0200)] 
uci: Remove obsolete and broken plugin

The plugin was apparently broken for years because it uses functions that
don't exist anymore.  It was quite limited anyway, so it was never really
used in OpenWrt to begin with (instead they generate configs in a custom
init script).

2 months agoconfigure: Add missing dependency of lib-prefix.m4
Tobias Brunner [Tue, 13 May 2025 15:51:09 +0000 (17:51 +0200)] 
configure: Add missing dependency of lib-prefix.m4

Fixes: 7ec0101250bf ("Include lib-prefix.m4 directly and remove gettext dependency")
2 months agoconfigure: Simplify inclusion of M4 macros
Tobias Brunner [Tue, 13 May 2025 15:50:35 +0000 (17:50 +0200)] 
configure: Simplify inclusion of M4 macros

2 months agoopenssl: Fix AWS-LC build
Gerardo Ravago [Mon, 12 May 2025 18:17:46 +0000 (14:17 -0400)] 
openssl: Fix AWS-LC build

The `crypt` functions defined here conflict with the `crypt` function
defined in `unistd.h` and trigger compilation errors when building
against the latest version of AWS-LC, which introduced a new transitive
include of `unistd.h` via `bio.h`.

This simply renames the function to avoid the error.

Closes strongswan/strongswan#2786

2 months agoInclude lib-prefix.m4 directly and remove gettext dependency
Tobias Brunner [Mon, 12 May 2025 15:29:54 +0000 (17:29 +0200)] 
Include lib-prefix.m4 directly and remove gettext dependency

A recent gettext release (0.25 via Homebrew) installs the M4 macros in a
different location (<prefix>/share/gettext/m4 instead of
<prefix>/share/aclocal). According to the commit messages to avoid "bad
interactions between autoreconf and autopoint".  Since we only depend
on gettext for that macro and this move makes it complicated, we can also
just integrate the macro from gnulib directly (which gettext 0.18+ relies
on anyway).

2 months agogithub: Use AWS-LC 1.51.2 for tests
Tobias Brunner [Mon, 12 May 2025 13:59:40 +0000 (15:59 +0200)] 
github: Use AWS-LC 1.51.2 for tests

2 months agoha: Fix arguments in debug statement when destroying incomplete IKE_SAs
Tobias Brunner [Mon, 12 May 2025 13:56:27 +0000 (15:56 +0200)] 
ha: Fix arguments in debug statement when destroying incomplete IKE_SAs

Closes strongswan/strongswan#2781

Fixes: 97bd0e2297ed ("ha: Destroy incomplete IKE_SAs after de-/activating a segment")
2 months agoUse wolfSSL 5.8.0 for tests
Tobias Brunner [Fri, 25 Apr 2025 06:26:58 +0000 (08:26 +0200)] 
Use wolfSSL 5.8.0 for tests

2 months agowolfssl: Update ML-KEM API for wolfSSL 5.8.0 release
Tobias Brunner [Fri, 25 Apr 2025 06:26:24 +0000 (08:26 +0200)] 
wolfssl: Update ML-KEM API for wolfSSL 5.8.0 release

3 months agotesting: Add rw-eap-id-switch scenario
Tobias Brunner [Tue, 4 Mar 2025 12:18:21 +0000 (13:18 +0100)] 
testing: Add rw-eap-id-switch scenario

3 months agoikev2: Add support to switch peer configs based on EAP-Identities
Tobias Brunner [Tue, 4 Mar 2025 10:14:14 +0000 (11:14 +0100)] 
ikev2: Add support to switch peer configs based on EAP-Identities

This changes how EAP identities are used from the config. Instead of
setting a statically configured identity != %any, an EAP-Identity
exchange is now always initiated (and required).  If the received identity
doesn't match, the peer config is switched to one with a matching
identity (wildcards are supported for that match).  This allows switching
to a config with a different EAP method or child settings based on the
EAP identity.

There is currently no "best" match.  The configs are evaluated based on
the order returned from the initial peer config lookup.

References strongswan/strongswan#2702

3 months agoandroid: Only select default ABIs when building OpenSSL
Tobias Brunner [Fri, 21 Mar 2025 07:48:34 +0000 (08:48 +0100)] 
android: Only select default ABIs when building OpenSSL

This skips the experimental RISC-V ABI in newer NDKs.

3 months agoandroid: Skip unknown ABIs when building OpenSSL
Tobias Brunner [Fri, 21 Mar 2025 07:44:15 +0000 (08:44 +0100)] 
android: Skip unknown ABIs when building OpenSSL

Newer NDKs have RISC-V as experimental ABI (not enabled by default, see
next commit).  If we don't have a mapping for a specific target, OpenSSL
falls back to 'android-arm', so that won't really work (interestingly,
it does build).

3 months agoandroid: Protect but don't keep track of sockets used for source address lookups
Tobias Brunner [Fri, 7 Mar 2025 09:14:29 +0000 (10:14 +0100)] 
android: Protect but don't keep track of sockets used for source address lookups

These sockets are closed immediately again, so no need to re-protect them
during roaming events.

References strongswan/strongswan#1691

Fixes: 6d87a8651068 ("android: Use new sockets to determine source IP")
3 months agoandroid: Remove special handling of legacy Android versions in native code
Tobias Brunner [Fri, 7 Mar 2025 09:10:56 +0000 (10:10 +0100)] 
android: Remove special handling of legacy Android versions in native code

Since minSdkVersion has been 21 for a while, we can remove some code
that was necessary for older versions.

3 months agoinit: Only install legacy service unit if starter/stroke is enabled
Tobias Brunner [Mon, 17 Mar 2025 07:10:05 +0000 (08:10 +0100)] 
init: Only install legacy service unit if starter/stroke is enabled

Closes strongswan/strongswan#2722

3 months agocharon-nm: Mark VPN connection as persistent
Tobias Brunner [Thu, 20 Mar 2025 08:26:33 +0000 (09:26 +0100)] 
charon-nm: Mark VPN connection as persistent

If this is not set, it looks like NM shuts down the VPN connection and
calls disconnect() if there is any connectivity change.

References strongswan/strongswan#2707

3 months agokernel-netlink: Enable UDP GRO
Tobias Brunner [Tue, 25 Mar 2025 12:44:44 +0000 (13:44 +0100)] 
kernel-netlink: Enable UDP GRO

This enables GRO offload for inbound ESP-in-UDP packets if the
esp4|6_offload modules are loaded.  Note that inbound ESP or ESP-in-UDP
packets won't be visible on layer 3 in Netfilter or tcpdump.

3 months agogithub: Use OpenSSL 3.5.0 to test ML-KEM
Tobias Brunner [Fri, 21 Feb 2025 15:11:04 +0000 (16:11 +0100)] 
github: Use OpenSSL 3.5.0 to test ML-KEM

3 months agoopenssl: Add support for ML-KEM with OpenSSL 3.5
Tobias Brunner [Thu, 20 Feb 2025 13:07:06 +0000 (14:07 +0100)] 
openssl: Add support for ML-KEM with OpenSSL 3.5

3 months agoleak-detective: Whitelist OpenSSL 3.5 functions
Tobias Brunner [Thu, 20 Feb 2025 10:49:37 +0000 (11:49 +0100)] 
leak-detective: Whitelist OpenSSL 3.5 functions

3 months agogithub: Build OpenSSL from the Git repository instead of a tarball
Tobias Brunner [Fri, 21 Feb 2025 15:05:51 +0000 (16:05 +0100)] 
github: Build OpenSSL from the Git repository instead of a tarball

This is more flexible and allows test builds against branches.

3 months agotty: Produce colored output in CI environments
Tobias Brunner [Thu, 10 Apr 2025 07:06:18 +0000 (09:06 +0200)] 
tty: Produce colored output in CI environments

3 months agovici: Increase buffer to hold uint64_t when parsing packet limits
Tobias Brunner [Mon, 7 Apr 2025 12:59:11 +0000 (14:59 +0200)] 
vici: Increase buffer to hold uint64_t when parsing packet limits

3 months agovici: Improve byte lifetime parsing
Thomas Egerer [Mon, 7 Apr 2025 09:43:59 +0000 (11:43 +0200)] 
vici: Improve byte lifetime parsing

Increase buffer to 32 bytes to hold uint64_t completely and check for
overflows after multiplication with size modifiers.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
3 months agoproposal: Add supported KE methods to default ESP/AH proposals, but optional
Tobias Brunner [Mon, 31 Mar 2025 14:28:47 +0000 (16:28 +0200)] 
proposal: Add supported KE methods to default ESP/AH proposals, but optional

This allows accepting clients that send proposals with non-optional KE
methods during rekeying, while still accepting clients that use the
previous non-KE default proposals.

3 months agoswanctl: Document "none" keyword for ESP proposals
Tobias Brunner [Mon, 31 Mar 2025 14:01:27 +0000 (16:01 +0200)] 
swanctl: Document "none" keyword for ESP proposals

3 months agoha: Support sync of private IKE_SA extensions and conditions
Tobias Brunner [Fri, 28 Mar 2025 15:06:58 +0000 (16:06 +0100)] 
ha: Support sync of private IKE_SA extensions and conditions

This requires a new protocol version as private extensions would enable
unrelated regular extensions, even when sending the private extension
as second attribute (which would work for conditions as they are
explicitly enabled/disabled).

3 months agoike-sa: Remove redundant setting of IKE_SA conditions after a rekeying
Tobias Brunner [Fri, 28 Mar 2025 14:50:53 +0000 (15:50 +0100)] 
ike-sa: Remove redundant setting of IKE_SA conditions after a rekeying

This was originally added with b0e40caafbd7 ("NAT-T conditions were not
inherited during IKE_SA rekeying") in 2008 when there was only a single
inherit() method.  Later the inherit_pre() method was added and then
with 094963d1b160 ("ikev2: Apply extensions and conditions before
starting rekeying") in 2014 the extensions and conditions were set
already there.

3 months agoike-sa: Add possibility to store private extensions/conditions
Tobias Brunner [Fri, 28 Mar 2025 14:06:52 +0000 (15:06 +0100)] 
ike-sa: Add possibility to store private extensions/conditions

This avoids conflicts with upstream changes if patched versions of
strongSwan require a number of private extensions and conditions.  For
example, the following extensions can be used as usual via the
`enable|supports_extension()` methods:

#define PRIVATE_EXT_1 (EXT_PRIVATE_MARKER | (1<<0))
#define PRIVATE_EXT_2 (EXT_PRIVATE_MARKER | (1<<1))

Defining an enum would also be possible but because the type won't match
the values would have to be cast to `ike_extension_t` when using the
methods.

Similarly, `COND_PRIVATE_MARKER` may be used to define private conditions
that can be used with the `set|has_condition()` methods.

Because the MSB is explicitly not set in `private_extensions|conditions`,
these members may directly be checked against private values, e.g.:

if (this->private_extensions & PRIVATE_EXT_1)
{
}

3 months agopeer-cfg: Use flags for boolean options
Tobias Brunner [Fri, 28 Mar 2025 13:06:16 +0000 (14:06 +0100)] 
peer-cfg: Use flags for boolean options

Makes it potentially easier to add new flags.

The mediation flag is not converted as the #ifdefs make it awkward.

3 months agodaemon: Add facility to register custom init/deinit functions
Tobias Brunner [Fri, 28 Mar 2025 12:51:14 +0000 (13:51 +0100)] 
daemon: Add facility to register custom init/deinit functions

Same as the previous commit but with access to the daemon.

3 months agolibrary: Add facility to register custom init/deinit functions
Tobias Brunner [Fri, 28 Mar 2025 12:49:56 +0000 (13:49 +0100)] 
library: Add facility to register custom init/deinit functions

These can be linked into the application to do initialization/cleanup
without having to modify the source code.

3 months agogithub: Add compile test with --without-testable-ke option
Tobias Brunner [Fri, 28 Mar 2025 11:23:09 +0000 (12:23 +0100)] 
github: Add compile test with --without-testable-ke option

3 months agoAdd configure option to disable testing key exchange methods
Tobias Brunner [Fri, 28 Mar 2025 11:06:37 +0000 (12:06 +0100)] 
Add configure option to disable testing key exchange methods

If this is used, the functionality to set a private key/value/seed for
key exchange methods is removed (including from the interface to avoid
accidentally forgetting to wrap implementations and uses of set_seed()).

The set_seed() method is assigned outside the INIT() macro to avoid
potentially undefined behavior (preprocessing directives in macro
arguments).

The test done by the crypto tester is a simple functionality test.

3 months agoauth-cfg: Add lower case enum names for auth_rule_t
Thomas Egerer [Wed, 26 Aug 2009 08:45:50 +0000 (10:45 +0200)] 
auth-cfg: Add lower case enum names for auth_rule_t

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
3 months agoldap: Use timeout value for synchronous calls
Thomas Egerer [Mon, 15 Jul 2019 16:32:38 +0000 (18:32 +0200)] 
ldap: Use timeout value for synchronous calls

So far, the timeout value was only used as connect timeout while a
malicious server could accept the connection and then starve us. So use
the timeout for LDAP_OPT_TIMEOUT, too, which affects all synchronous
calls.  In particular, ldap_simple_bind_s(), which has no timeout
argument like ldap_search_st().

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
3 months agogitignore: Add *.i and *.s files
Thomas Egerer [Fri, 27 May 2016 10:34:51 +0000 (12:34 +0200)] 
gitignore: Add *.i and *.s files

Ignore a couple of compiler generated temp files.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
3 months agoDoxyfile: Exclude OpenSSL sources of Android app
Tobias Brunner [Tue, 1 Apr 2025 08:00:50 +0000 (10:00 +0200)] 
Doxyfile: Exclude OpenSSL sources of Android app

They can produce warnings and we don't want to include documentation for
these anyway.

3 months agogithub: Set type in issue templates
Tobias Brunner [Fri, 4 Apr 2025 06:15:37 +0000 (08:15 +0200)] 
github: Set type in issue templates

3 months agotesting: Use blockdev instead of partprobe to load partitions
Tobias Brunner [Thu, 10 Apr 2025 06:00:18 +0000 (08:00 +0200)] 
testing: Use blockdev instead of partprobe to load partitions

This avoids a dependency on parted as blockdev is in util-linux on
Debian/Ubuntu, which is installed by default.  And it might work more
reliably.

3 months agotesting: Use tar instead of recursive scp
Tobias Brunner [Fri, 4 Apr 2025 09:07:21 +0000 (11:07 +0200)] 
testing: Use tar instead of recursive scp

It seems that scp is sometimes very slow (unclear what causes it as it's
not always the same).  Packing up the files with tar performs a lot
better in these situations.  And copying the files to multiple hosts
in parallel additionally helps to reduce the time required for these
steps.

Using --overwrite and -h preserves existing symlinks (e.g. for the users
file in /etc/freeradius/3.0) and overwrites the target file instead.
The -m option ignores timestamps when extracting the files as some target
files will be newer than the source.  Using -h when packing up files in
load-testconfig allows using symlinks in the test config dirs to files
on the host running the tests.

3 months agotesting: Make ocsp.cgi in ikev2-multi-ca/ocsp-signers scenario executable
Tobias Brunner [Mon, 7 Apr 2025 12:54:15 +0000 (14:54 +0200)] 
testing: Make ocsp.cgi in ikev2-multi-ca/ocsp-signers scenario executable

3 months agotesting: Add some network utilities to the base image
Tobias Brunner [Fri, 4 Apr 2025 06:56:16 +0000 (08:56 +0200)] 
testing: Add some network utilities to the base image

3 months agotesting: Add option for a quick rebuild of strongSwan
Tobias Brunner [Thu, 20 Mar 2025 08:23:34 +0000 (09:23 +0100)] 
testing: Add option for a quick rebuild of strongSwan

This shaves off about 1 minute of build time on my machine.  We also
don't need the separate build step and can just run `make install`.

3 months agotesting: Move removal of charon.pid into posttest section
Tobias Brunner [Fri, 21 Mar 2025 14:12:06 +0000 (15:12 +0100)] 
testing: Move removal of charon.pid into posttest section

Fixes: a103f3a2849f ("testing: Add options to only run pre- or posttest scripts of a scenario")
3 months agotesting: Fix loading test config for tests that were never run
Tobias Brunner [Wed, 26 Mar 2025 16:56:00 +0000 (17:56 +0100)] 
testing: Fix loading test config for tests that were never run

The file won't exist in the previous location until load-testconfig was
executed once.  Since it's not modified by the script it's fine to
load it directly from the original location.

Fixes: a103f3a2849f ("testing: Add options to only run pre- or posttest scripts of a scenario")
3 months agoMerge branch 'android-always-on-managed' android-2.5.5
Tobias Brunner [Fri, 4 Apr 2025 06:57:12 +0000 (08:57 +0200)] 
Merge branch 'android-always-on-managed'

Fixes an issue with initiating managed profiles as Always-on VPN.

Closes strongswan/strongswan#2756

3 months agoandroid: New release after fixing Always-on VPN with managed profiles
Tobias Brunner [Thu, 3 Apr 2025 14:35:47 +0000 (16:35 +0200)] 
android: New release after fixing Always-on VPN with managed profiles

3 months agoandroid: Fix starting a managed profile as Always-on VPN
Tobias Brunner [Thu, 3 Apr 2025 13:54:02 +0000 (15:54 +0200)] 
android: Fix starting a managed profile as Always-on VPN

The callbacks provided via ProcessLifecycleOwner are only triggered when
Activities are started.  However, when Android triggers the Always-on
VPN it directly starts our VpnService subclass, no Activity.  So the
configs were not loaded and the VPN couldn't be initiated with a managed
profile.  This ensures the config is loaded right from the start of
the app.  And by registering for modifications in onCreate() we can also
use the correct config if the app is never started in-between changes to
the managed profiles and triggering the Always-on VPN.

4 months agoCast uses of return_*(), nop() and enumerator_create_empty()
Tobias Brunner [Fri, 21 Feb 2025 16:00:44 +0000 (17:00 +0100)] 
Cast uses of return_*(), nop() and enumerator_create_empty()

As described in the previous commit, GCC 15 uses C23 by default and that
changes the meaning of such argument-less function declarations.  So
whenever we assign such a function to a pointer that expects a function
with arguments it causes an incompatible pointer type warning.  We
could define dedicated functions/callbacks whenever necessary, but this
seems like the simpler approach for now (especially since most uses of
these functions have already been cast).

4 months agocallback-job: Replace return_false() in constructors with dedicated function
Tobias Brunner [Fri, 21 Feb 2025 15:45:57 +0000 (16:45 +0100)] 
callback-job: Replace return_false() in constructors with dedicated function

Besides being clearer, this fixes issues with GCC 15.  The latter uses
C23 by default, which changes the meaning of function declarations
without parameters such as

bool return false();

Instead of "this function takes an unknown number of arguments", this
now equals (void), that is, "this function takes no arguments".  So we
run into incompatible pointer type warnings all over when using such
functions.  They could be cast to (void*) but this seems the cleaner
solution for this use case.

4 months agocharon-nm: Use CALLBACK macro for callback job's cancel implementation
Tobias Brunner [Fri, 21 Feb 2025 15:47:34 +0000 (16:47 +0100)] 
charon-nm: Use CALLBACK macro for callback job's cancel implementation

Casting to this specific function type doesn't work anymore if C23 is
used as the types mismatch.

4 months agopki: Fix signature of help() to match that of a callback in command_t
Tobias Brunner [Fri, 21 Feb 2025 16:18:35 +0000 (17:18 +0100)] 
pki: Fix signature of help() to match that of a callback in command_t

4 months agogithub: Use AWS-LC 1.48.5 for tests
Tobias Brunner [Tue, 11 Mar 2025 12:38:53 +0000 (13:38 +0100)] 
github: Use AWS-LC 1.48.5 for tests

4 months agotesting: Install iperf3 instead of iperf
Tobias Brunner [Mon, 10 Mar 2025 13:28:24 +0000 (14:28 +0100)] 
testing: Install iperf3 instead of iperf

4 months agotesting: Add options to only run pre- or posttest scripts of a scenario
Tobias Brunner [Wed, 12 Feb 2025 14:50:37 +0000 (15:50 +0100)] 
testing: Add options to only run pre- or posttest scripts of a scenario

This allows to manually do some testing without having to type commands
to set up a scenario.

Also changes how arguments are parsed (allowing to pass options mixed
with test dirs) and adds some usage output.

4 months agoDon't reference 5.9 in URLs to docs.strongswan.org
Tobias Brunner [Tue, 11 Mar 2025 09:26:31 +0000 (10:26 +0100)] 
Don't reference 5.9 in URLs to docs.strongswan.org

4 months agonm: Version bump to 1.6.2
Tobias Brunner [Tue, 11 Mar 2025 08:57:26 +0000 (09:57 +0100)] 
nm: Version bump to 1.6.2

4 months agoVersion bump to 6.0.1 6.0.1
Andreas Steffen [Mon, 10 Mar 2025 18:19:37 +0000 (19:19 +0100)] 
Version bump to 6.0.1

4 months agotesting: Adapted ha/active-passive tests
Andreas Steffen [Mon, 10 Mar 2025 18:18:40 +0000 (19:18 +0100)] 
testing: Adapted ha/active-passive tests

4 months agovici: Document ICMP type/code traffic selector restrictions
Tobias Brunner [Wed, 5 Mar 2025 09:55:51 +0000 (10:55 +0100)] 
vici: Document ICMP type/code traffic selector restrictions

4 months agoNEWS: Add news for 6.0.1
Tobias Brunner [Wed, 5 Mar 2025 07:50:44 +0000 (08:50 +0100)] 
NEWS: Add news for 6.0.1

4 months agoreceiver: Properly clean up if hasher or RNG can't be created
Tobias Brunner [Tue, 4 Mar 2025 14:30:25 +0000 (15:30 +0100)] 
receiver: Properly clean up if hasher or RNG can't be created

4 months agowinhttp: Properly destroy linked list if connection can't be opened
Tobias Brunner [Tue, 4 Mar 2025 14:27:53 +0000 (15:27 +0100)] 
winhttp: Properly destroy linked list if connection can't be opened

4 months agopkcs11: Free copied name of PKCS#11 module in error cases
Tobias Brunner [Tue, 4 Mar 2025 13:48:42 +0000 (14:48 +0100)] 
pkcs11: Free copied name of PKCS#11 module in error cases

4 months agostream-service: Avoid FD leak during deinitialization
Tobias Brunner [Tue, 4 Mar 2025 13:41:03 +0000 (14:41 +0100)] 
stream-service: Avoid FD leak during deinitialization

4 months agogcm: Properly clean up IV generator if crypter can't be created
Tobias Brunner [Tue, 4 Mar 2025 13:37:44 +0000 (14:37 +0100)] 
gcm: Properly clean up IV generator if crypter can't be created

4 months agodaemon: Properly clean up logger entries in error cases
Tobias Brunner [Tue, 4 Mar 2025 13:33:36 +0000 (14:33 +0100)] 
daemon: Properly clean up logger entries in error cases

The copied target string was not freed.

4 months agoswanctl: Fix memory leak in --load-creds if --clear fails
Tobias Brunner [Tue, 4 Mar 2025 13:30:35 +0000 (14:30 +0100)] 
swanctl: Fix memory leak in --load-creds if --clear fails

4 months agotesting: Update build recipe after changing Python build
Tobias Brunner [Tue, 4 Mar 2025 12:52:30 +0000 (13:52 +0100)] 
testing: Update build recipe after changing Python build

Fixes: 3babf1f7108d ("vici: Update Python build")
4 months agovici: Update docs after changing Python build
Tobias Brunner [Tue, 4 Mar 2025 12:50:59 +0000 (13:50 +0100)] 
vici: Update docs after changing Python build

Fixes: 3babf1f7108d ("vici: Update Python build")
4 months agoFixed some typos, courtesy of codespell
Tobias Brunner [Tue, 4 Mar 2025 12:31:26 +0000 (13:31 +0100)] 
Fixed some typos, courtesy of codespell

4 months agoVersion bump to 6.0.1rc1 6.0.1rc1
Andreas Steffen [Sun, 2 Mar 2025 16:09:14 +0000 (17:09 +0100)] 
Version bump to 6.0.1rc1

4 months agoRevert "kernel-netlink: Don't fallback to peer address as gateway"
Tobias Brunner [Mon, 3 Mar 2025 08:46:14 +0000 (09:46 +0100)] 
Revert "kernel-netlink: Don't fallback to peer address as gateway"

This reverts commit f717bb5249caea550bc6e2baeb09ca309ad83b39.

Causes issues in our testing environment. Default route via host is
preferred if no gateway is set in the installed routes.  Needs some
investigation.

References strongswan/strongswan#2548

5 months agocharon-nm: Lower default retransmission settings to restore SAs more quickly
Tobias Brunner [Fri, 28 Feb 2025 15:40:48 +0000 (16:40 +0100)] 
charon-nm: Lower default retransmission settings to restore SAs more quickly

These are the same values we use for the Android app.

References strongswan/strongswan#2696

5 months agocharon-nm: Use a DPD to check the current path
Tobias Brunner [Thu, 27 Feb 2025 08:37:25 +0000 (09:37 +0100)] 
charon-nm: Use a DPD to check the current path

If the client's network goes down for a while but the same IP address
is assigned later, it won't be aware if the server killed the IKE_SA
while it wasn't reachable.  This way, a DPD is triggered and the client
can reestablish the SA if necessary.  When roaming to a different IP,
a MOBIKE update is triggered with the same effect.

References strongswan/strongswan#2696

5 months agoconf: Document some global options for charon-nm
Tobias Brunner [Wed, 26 Feb 2025 14:06:29 +0000 (15:06 +0100)] 
conf: Document some global options for charon-nm

These have specific values for charon-nm's use case but might have to be
changed for special setups or because of conflicts.

References strongswan/strongswan#2683

5 months agoconf: Add missing modules to install config snippets
Tobias Brunner [Wed, 26 Feb 2025 13:34:12 +0000 (14:34 +0100)] 
conf: Add missing modules to install config snippets

In particular the one for charon-nm was missing.

References strongswan/strongswan#2683

5 months agoikev2: Trigger ike_reestablish_pre|post events for make-before-break reauth
Tobias Brunner [Tue, 25 Feb 2025 13:49:38 +0000 (14:49 +0100)] 
ikev2: Trigger ike_reestablish_pre|post events for make-before-break reauth

Listeners can't track those IKE_SAs otherwise.  For break-before-make
reauthentications, these events are already triggered because that is
implemented by calling reestablish() on the old IKE_SA.

5 months agoike-sa: Fix check for make-before-break when handling DELETE failure
Tobias Brunner [Tue, 25 Feb 2025 11:14:12 +0000 (12:14 +0100)] 
ike-sa: Fix check for make-before-break when handling DELETE failure

Fixes: a5e80cf5e451 ("libcharon: Enable make_before_break option by default")
5 months agoike-natd: Float to the NAT-T port early when not connecting to port 500
michael-dev [Mon, 10 Feb 2025 12:36:34 +0000 (13:36 +0100)] 
ike-natd: Float to the NAT-T port early when not connecting to port 500

When using port 4500 for IKE_SA_INIT, Windows Server 2016, 2025 and
possibly others send back all packets to the port initially used by the
client, not the one floated to before sending IKE_AUTH. So if UDP
encapsulation is used, no traffic can be received as the initial socket
can't have UDP decapsulation enabled.

tcpdump output:
```
IP <client-ip>.47547 > <server-ip>.4500: UDP-encap: ESP(spi=0xfd4e5fc2,seq=...)
IP <server-ip>.4500 > <client-ip>.57962: UDP-encap: ESP(spi=0xccc5e213,seq=...)
```

Avoid this by floating early if a non-default destination port is used.
This also ensures we don't send packets from port 500 (without non-ESP
marker) if ephemeral source ports are not used.

Closes strongswan/strongswan#2664

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
Co-authored-by: Tobias Brunner <tobias@strongswan.org>
5 months agoike-sa: Only query last use time of CHILD_SAs if UDP-encap is used
Tobias Brunner [Tue, 21 Jan 2025 16:08:44 +0000 (17:08 +0100)] 
ike-sa: Only query last use time of CHILD_SAs if UDP-encap is used

Without UDP-encapsulation, the IKE and ESP traffic is not directly related
(other than via IPs), so firewalls might no keep the state for IKE traffic
alive if there is no IKE traffic for a while and constant ESP traffic
prevents DPDs from being exchanged because inbound ESP traffic is
considered.

Closes strongswan/strongswan#1759

5 months agoeap-radius: Add support to specify and bind a specific source address
Tobias Brunner [Thu, 16 Jan 2025 10:02:13 +0000 (11:02 +0100)] 
eap-radius: Add support to specify and bind a specific source address

Using a specific address can be useful in scenarios where dynamic routing
could change the path to the RADIUS server and a changing source address
is a problem for the server.

Closes strongswan/strongswan#2598

5 months agoMerge branch 'ha-multi-ke'
Tobias Brunner [Fri, 28 Feb 2025 15:11:59 +0000 (16:11 +0100)] 
Merge branch 'ha-multi-ke'

Adds support for multiple key exchanges to the ha plugin.  Also,
because of the delayed key derivation and the not synced IntAuth
values, incomplete IKE_SAs are now destroyed during a failover.

Closes strongswan/strongswan#2550

5 months agoha: Destroy incomplete IKE_SAs after de-/activating a segment
Tobias Brunner [Fri, 6 Dec 2024 14:02:13 +0000 (15:02 +0100)] 
ha: Destroy incomplete IKE_SAs after de-/activating a segment

The node that gets activated usually won't be able to complete the
IKE_SA mainly because the IKE keys are now derived delayed, so the key
material required to process a message often won't be available (only
later IKE_AUTH messages and retransmits of earlier messages that the
active node already received and synced the keys for may be decrypted).

A second issue affects IKE_SAs with multiple key exchanges.  Because the
IntAuth value(s) are currently not synced, which are necessary to
verify/create the AUTH payloads, the IKE_AUTH exchange couldn't be
completed.

5 months agotesting: Add ha/active-passive-multi-ke scenario
Jean-François Hren [Tue, 29 Oct 2024 10:27:38 +0000 (11:27 +0100)] 
testing: Add ha/active-passive-multi-ke scenario

5 months agoha: Add support to sync IKE and Child SAs with multiple key exchanges
Tobias Brunner [Thu, 5 Dec 2024 10:55:52 +0000 (11:55 +0100)] 
ha: Add support to sync IKE and Child SAs with multiple key exchanges

Synchronization for the additional transforms in the IKE and Child SA
proposals is added.  Details of the IKE_SA synchronization are changed
to support IKE_INTERMEDIATE exchanges that cause multiple HA_IKE_ADD
messages and key derivations.  The cache has been extended to handle
multiple such messages.

Co-authored-by: Thomas Egerer <thomas.egerer@secunet.com>
5 months agokernel-netlink: Don't fallback to peer address as gateway
Tobias Brunner [Fri, 29 Nov 2024 13:57:31 +0000 (14:57 +0100)] 
kernel-netlink: Don't fallback to peer address as gateway

This doesn't really seem useful (perhaps it was before we started to
configure the outbound interface on our routes). And it can actually
cause the route installation to fail e.g. for routes over point-to-point
interfaces where we'd get "Error: Nexthop has invalid gateway" errors.

Closes strongswan/strongswan#2548

5 months agoscripts: Add support for out-of-tree builds to test script
Tobias Brunner [Fri, 28 Feb 2025 10:28:47 +0000 (11:28 +0100)] 
scripts: Add support for out-of-tree builds to test script

Can be useful when using the script locally.

5 months agovici: Fix out-of-tree builds with Perl module enabled
Tobias Brunner [Fri, 28 Feb 2025 10:55:46 +0000 (11:55 +0100)] 
vici: Fix out-of-tree builds with Perl module enabled

Not really building it out-of-tree for now, though.

5 months agogithub: Explicitly install required packages for Linux builds
Tobias Brunner [Thu, 27 Feb 2025 16:22:14 +0000 (17:22 +0100)] 
github: Explicitly install required packages for Linux builds

The runner images have some software pre-installed, which isn't the
case on regular Ubuntu images.

5 months agogithub: Use all available CPU cores when building
Tobias Brunner [Thu, 27 Feb 2025 16:21:51 +0000 (17:21 +0100)] 
github: Use all available CPU cores when building

5 months agogithub: Call Botan configure script directly
Tobias Brunner [Thu, 27 Feb 2025 16:20:12 +0000 (17:20 +0100)] 
github: Call Botan configure script directly

This should find the required Python binary automatically (`python` might
not be available if not explicitly installed).

5 months agogithub: Don't use pip3 to install Python packages anymore
Tobias Brunner [Thu, 27 Feb 2025 14:50:02 +0000 (15:50 +0100)] 
github: Don't use pip3 to install Python packages anymore

Currently, the runner images enable break-system-packages globally.
However, this workaround will be removed by the end of March.  So
we switch to installing these packages as intended via distro (the
alternative would be to use pipx, at least for tox).