]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
2 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

2 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

2 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

2 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

2 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

2 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

2 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.

2 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")
2 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>
2 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

2 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

2 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

2 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.

2 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

2 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>
2 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

2 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.

2 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.

2 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.

2 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

2 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).

2 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).

2 months agoMerge branch 'android-reauth-fix' android-2.5.4
Tobias Brunner [Thu, 27 Feb 2025 10:23:52 +0000 (11:23 +0100)] 
Merge branch 'android-reauth-fix'

Fixes issues with reauthentication, in particular, to reestablish the
SA if MOBIKE is disabled.  The app currently can't handle
make-before-break reauthentication.  In part because necessary events are
currently not triggered.  So for now, we switch back to the classic
reauthentication approach.

2 months agoandroid: New release after fixing reauthentication regression
Tobias Brunner [Tue, 25 Feb 2025 12:40:54 +0000 (13:40 +0100)] 
android: New release after fixing reauthentication regression

2 months agoandroid: Disable make-before-break reauthentication
Tobias Brunner [Tue, 25 Feb 2025 11:15:20 +0000 (12:15 +0100)] 
android: Disable make-before-break reauthentication

The service implementation with its handling of reauth callbacks and
no-DNS TUN device etc. can't handle make-before-break reauthentication
at the moment.

2 months agogithub: Remove runs on Ubuntu 20.04
Tobias Brunner [Fri, 21 Feb 2025 13:41:44 +0000 (14:41 +0100)] 
github: Remove runs on Ubuntu 20.04

They will start to fail on certain days in March before the images are
removed on April 1st.

2 months agogithub: Check test vectors with output in crypto plugin tests
Tobias Brunner [Fri, 21 Feb 2025 13:09:34 +0000 (14:09 +0100)] 
github: Check test vectors with output in crypto plugin tests

This way we see what was actually tested. Increasing the verbosity for
the general test run produces too much output.

2 months agotest-vectors: Add a soft dependency on DRBG used for KEM tests
Tobias Brunner [Fri, 21 Feb 2025 10:06:17 +0000 (11:06 +0100)] 
test-vectors: Add a soft dependency on DRBG used for KEM tests

Depending on the loaded plugins, it's not necessary. So it's not a hard
dependency.

2 months agogmp: Declare dependency on DRBG to generate private keys
Tobias Brunner [Fri, 21 Feb 2025 10:06:02 +0000 (11:06 +0100)] 
gmp: Declare dependency on DRBG to generate private keys

2 months agocirrus: Use FreeBSD 13.4 and 14.2
Tobias Brunner [Thu, 20 Feb 2025 14:51:38 +0000 (15:51 +0100)] 
cirrus: Use FreeBSD 13.4 and 14.2

2 months agogithub: Use OpenSSL 3.4.1 for tests
Tobias Brunner [Tue, 19 Sep 2023 14:43:47 +0000 (16:43 +0200)] 
github: Use OpenSSL 3.4.1 for tests

There was an issue with OPENSSL_armcap_P in Android's static build for
OpenSSL 3.1.1+. This was finally fixed with this release (and was also
backported to older versions).

2 months agogithub: Use AWS-LC 1.46.1 for tests
Tobias Brunner [Wed, 19 Feb 2025 08:06:40 +0000 (09:06 +0100)] 
github: Use AWS-LC 1.46.1 for tests

2 months agoandroid: Move annotation to method where startActivityAndCollapse() is called
Tobias Brunner [Thu, 20 Feb 2025 10:58:38 +0000 (11:58 +0100)] 
android: Move annotation to method where startActivityAndCollapse() is called

Fixes: 5237bf3a5c6f ("android: Suppress deprecation warning because of startActivityAndCollapse()")
2 months agoMerge branch 'android-passwords' android-2.5.3
Tobias Brunner [Thu, 20 Feb 2025 10:08:29 +0000 (11:08 +0100)] 
Merge branch 'android-passwords'

Adds support to import passwords via managed configuration and profile
files. Also fixes several deprecation warnings.

Closes strongswan/strongswan#2589
Closes strongswan/strongswan#2642
Closes strongswan/strongswan#2643

2 months agoandroid: New release after adding support for passwords in managed configs and profil...
Tobias Brunner [Tue, 4 Feb 2025 09:12:58 +0000 (10:12 +0100)] 
android: New release after adding support for passwords in managed configs and profile files

Also fixes some bugs and deprecation warnings.

2 months agoandroid: Imported VPN profile files may contain passwords
Tobias Brunner [Tue, 18 Feb 2025 12:26:08 +0000 (13:26 +0100)] 
android: Imported VPN profile files may contain passwords

A warning is displayed to the users, reminding them that there is a
cleartext password in the file.

2 months agoandroid: Consistently use *Start/End in layouts and remove redundant old settings
Tobias Brunner [Tue, 18 Feb 2025 11:11:43 +0000 (12:11 +0100)] 
android: Consistently use *Start/End in layouts and remove redundant old settings

2 months agoandroid: Suppress deprecation warning because of stopForeground()
Tobias Brunner [Wed, 5 Feb 2025 16:02:42 +0000 (17:02 +0100)] 
android: Suppress deprecation warning because of stopForeground()

2 months agoandroid: Suppress deprecation warning because of startActivityAndCollapse()
Tobias Brunner [Wed, 5 Feb 2025 16:00:25 +0000 (17:00 +0100)] 
android: Suppress deprecation warning because of startActivityAndCollapse()

2 months agoandroid: Handle deprecated getParcelable* and getSerializable methods
Tobias Brunner [Wed, 5 Feb 2025 15:35:39 +0000 (16:35 +0100)] 
android: Handle deprecated getParcelable* and getSerializable methods

2 months agoandroid: Suppress warning in implementation only used for Android < 33
Tobias Brunner [Wed, 5 Feb 2025 15:27:57 +0000 (16:27 +0100)] 
android: Suppress warning in implementation only used for Android < 33

2 months agoandroid: Replace deprecated onBackPressed() and enable predictive back gestures
Tobias Brunner [Wed, 5 Feb 2025 15:13:13 +0000 (16:13 +0100)] 
android: Replace deprecated onBackPressed() and enable predictive back gestures

Doesn't really make a difference it seems.

2 months agoandroid: Replace deprecated fragment menu APIs
Tobias Brunner [Wed, 5 Feb 2025 14:27:37 +0000 (15:27 +0100)] 
android: Replace deprecated fragment menu APIs

2 months agoandroid: Ignore empty strings for settings in managed profiles
Tobias Brunner [Tue, 4 Feb 2025 14:53:46 +0000 (15:53 +0100)] 
android: Ignore empty strings for settings in managed profiles

Unspecified settings should be set to null, while some MDMs might send
them as empty strings, which could cause issues (like an empty password
or trying to parse an empty DNS server address).

2 months agoandroid: Allow setting the password in managed profiles
Tobias Brunner [Tue, 4 Feb 2025 14:33:33 +0000 (15:33 +0100)] 
android: Allow setting the password in managed profiles

To avoid complicated changes in the UI, users can still update it.  But
the default, if they clear the field, will be the managed password.

2 months agoandroid: Properly deinit library if parsing an IP fails
Tobias Brunner [Tue, 4 Feb 2025 13:07:37 +0000 (14:07 +0100)] 
android: Properly deinit library if parsing an IP fails

This can happen with empty strings, which might be set for managed
profiles, which caused the refcounting to be askew and the resolver not
to work after connecting once because it was flushed and disabled.

2 months agoandroid: Update NDK version and enable support for 16KiB page tables
Tobias Brunner [Mon, 3 Feb 2025 12:21:41 +0000 (13:21 +0100)] 
android: Update NDK version and enable support for 16KiB page tables

2 months agoandroid: Fix updating password for managed profiles
Tobias Brunner [Fri, 31 Jan 2025 07:27:55 +0000 (08:27 +0100)] 
android: Fix updating password for managed profiles

Without data source set on the profile, this caused the app to crash
with a null pointer dereference when it is updated.

2 months agounit-tests: Document additional supported env variables
Tobias Brunner [Mon, 10 Feb 2025 14:41:52 +0000 (15:41 +0100)] 
unit-tests: Document additional supported env variables

3 months agoMerge branch 'nm-gui-ts'
Tobias Brunner [Fri, 7 Feb 2025 12:26:23 +0000 (13:26 +0100)] 
Merge branch 'nm-gui-ts'

Adds fields for local and remote TS to the GUI.

Closes strongswan/strongswan#2580

3 months agonm: Add German translation for traffic selector fields
Tobias Brunner [Fri, 7 Feb 2025 10:48:41 +0000 (11:48 +0100)] 
nm: Add German translation for traffic selector fields

3 months agonm: Expose local-ts 2580/head
Jiří Matěják [Tue, 7 Jan 2025 18:47:45 +0000 (19:47 +0100)] 
nm: Expose local-ts

Signed-off-by: Jiří Matěják <matejak@merica.cz>
3 months agonm: Expose remote-ts
Jiří Matěják [Sun, 22 Dec 2024 02:45:28 +0000 (03:45 +0100)] 
nm: Expose remote-ts

Signed-off-by: Jiří Matěják <matejak@merica.cz>
3 months agocharon-nm: Add option to configure local traffic selectors
Tobias Brunner [Tue, 12 Nov 2024 12:56:16 +0000 (13:56 +0100)] 
charon-nm: Add option to configure local traffic selectors

Closes strongswan/strongswan#2084

3 months agogithub: Use AWS-LC 1.45.0 for tests
Tobias Brunner [Thu, 6 Feb 2025 07:29:09 +0000 (08:29 +0100)] 
github: Use AWS-LC 1.45.0 for tests

3 months agoUse Botan 3.7.1 for tests
Tobias Brunner [Wed, 5 Feb 2025 13:14:40 +0000 (14:14 +0100)] 
Use Botan 3.7.1 for tests

3 months agoMerge branch 'dhcp-receive'
Tobias Brunner [Fri, 31 Jan 2025 10:21:04 +0000 (11:21 +0100)] 
Merge branch 'dhcp-receive'

This fixes a regression introduced with pf_handler_t in 5.9.14.  It also
binds the packet sockets correctly to the configured interface, and adds
an option for the dhcp plugin that allows binding the send and receive
sockets to different interfaces.

3 months agodhcp: Add option to bind the receive socket to a different interface
Tobias Brunner [Wed, 29 Jan 2025 16:23:31 +0000 (17:23 +0100)] 
dhcp: Add option to bind the receive socket to a different interface

This can be useful if the DHCP server runs on the same server. On Linux,
the response is then sent via `lo`, so packets won't be received if both
sockets are bound to e.g. a bridge interface.

3 months agopf-handler: Correctly bind packet socket to an interface
Tobias Brunner [Thu, 30 Jan 2025 13:40:33 +0000 (14:40 +0100)] 
pf-handler: Correctly bind packet socket to an interface

Binding such sockets via SO_BINDTODEVICE does not work at all. Instead,
bind() has to be used, as described in the packet(7) man page.

3 months agopf-handler: Accept loopback interfaces as packet source
Tobias Brunner [Mon, 27 Jan 2025 08:40:56 +0000 (09:40 +0100)] 
pf-handler: Accept loopback interfaces as packet source

In some setups the responses from the DHCP server are sent via lo, which
does not have an address of type `ARPHRD_ETHER` (the address length is
the same, though, just all zeros, by default).  Note that the dhcp plugin
doesn't actually care for the MAC address or interface details, that's
only used by the farp plugin.

Fixes: 187c72d1afdc ("dhcp: Port the plugin to FreeBSD/macOS")
3 months agoikev2: Handle INVALID_SYNTAX after IKE_AUTH by deleting IKE_SA
Nathan Tran [Tue, 28 Jan 2025 05:48:35 +0000 (21:48 -0800)] 
ikev2: Handle INVALID_SYNTAX after IKE_AUTH by deleting IKE_SA

When serving as a responder and receiving an INFORMATIONAL exchange
containing INVALID_SYNTAX after IKE_AUTH, the IKE_SA should be deleted.
Currently, it only gets deleted after receiving AUTHENTICATION_FAILED.
RFC7296 section 2.21.2 says:

 In an IKE_AUTH exchange, or in the INFORMATIONAL exchange immediately
 following it (in case an error happened when processing a response to
 IKE_AUTH), the UNSUPPORTED_CRITICAL_PAYLOAD, INVALID_SYNTAX, and
 AUTHENTICATION_FAILED notifications are the only ones to cause the
 IKE SA to be deleted or not created, without a Delete payload.

Closes strongswan/strongswan#2636

3 months agosonarcloud: Ignore that we don't define loop variables inside the loop
Tobias Brunner [Tue, 21 Jan 2025 14:13:55 +0000 (15:13 +0100)] 
sonarcloud: Ignore that we don't define loop variables inside the loop

Also add the official description for the other ignored rules.

3 months agoopenssl: Require min version 3.0.0 for HKDF to support larger MODP groups and nonces
Nathan Tran [Wed, 8 Jan 2025 16:28:25 +0000 (08:28 -0800)] 
openssl: Require min version 3.0.0 for HKDF to support larger MODP groups and nonces

Also enables the `kdf` plugin automatically if building against an older
version of OpenSSL.

Closes strongswan/strongswan#2602

Co-authored-by: Tobias Brunner <tobias@strongswan.org>
3 months agoplugin-loader: Properly support compilation without dlopen()/dlsym() etc.
Tobias Brunner [Mon, 13 Jan 2025 16:09:15 +0000 (17:09 +0100)] 
plugin-loader: Properly support compilation without dlopen()/dlsym() etc.

This only works if plugins are built monolithically and linked statically.

Closes strongswan/strongswan#2615

3 months agosw-collector: Fix build with DEBUG_LEVEL < 1
Tobias Brunner [Mon, 13 Jan 2025 14:02:18 +0000 (15:02 +0100)] 
sw-collector: Fix build with DEBUG_LEVEL < 1

3 months agopts: Fix build with DEBUG_LEVEL < 1
Tobias Brunner [Mon, 13 Jan 2025 12:29:58 +0000 (13:29 +0100)] 
pts: Fix build with DEBUG_LEVEL < 1

3 months agolibtnccs: Fix build with DEBUG_LEVEL < 1
Tobias Brunner [Mon, 13 Jan 2025 11:51:30 +0000 (12:51 +0100)] 
libtnccs: Fix build with DEBUG_LEVEL < 1

3 months agoeap-sim-file: Fix build with DEBUG_LEVEL < 1
Tobias Brunner [Mon, 13 Jan 2025 13:38:54 +0000 (14:38 +0100)] 
eap-sim-file: Fix build with DEBUG_LEVEL < 1

3 months agosimaka-manager: Fix build with DEBUG_LEVEL < 1
Tobias Brunner [Mon, 13 Jan 2025 11:02:17 +0000 (12:02 +0100)] 
simaka-manager: Fix build with DEBUG_LEVEL < 1

3 months agogmp: Fix build with DEBUG_LEVEL < 1
Tobias Brunner [Mon, 13 Jan 2025 10:36:32 +0000 (11:36 +0100)] 
gmp: Fix build with DEBUG_LEVEL < 1

3 months agooptionsfrom: Fix build with DEBUG_LEVEL < 1
Tobias Brunner [Fri, 10 Jan 2025 17:52:45 +0000 (18:52 +0100)] 
optionsfrom: Fix build with DEBUG_LEVEL < 1

3 months agocredential-factory: Fix build with DEBUG_LEVEL < 1
Tobias Brunner [Fri, 10 Jan 2025 15:30:44 +0000 (16:30 +0100)] 
credential-factory: Fix build with DEBUG_LEVEL < 1

Newer versions of clang complain here.

3 months agotnc-imv: Add missing argument to IMV recommendations constructor
Tobias Brunner [Fri, 10 Jan 2025 14:43:11 +0000 (15:43 +0100)] 
tnc-imv: Add missing argument to IMV recommendations constructor

This avoids the following warning/error:

tnc_imv_manager.c:244:39: error: passing arguments to 'tnc_imv_recommendations_create' without a prototype is deprecated in all versions of C and is not supported in C23 [-Werror,-Wdeprecated-non-prototype]
  244 |         return tnc_imv_recommendations_create(this->imvs);
      |                                              ^

3 months agoctr: Remove parameter-less constructor prototype
Tobias Brunner [Thu, 9 Jan 2025 15:05:39 +0000 (16:05 +0100)] 
ctr: Remove parameter-less constructor prototype

Useless and causes a compiler warning/error:

  error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent declaration [-Werror,-Wdeprecated-non-prototype]

3 months agocoverage: Exclude generated static proposal keywords
Tobias Brunner [Fri, 10 Jan 2025 16:23:19 +0000 (17:23 +0100)] 
coverage: Exclude generated static proposal keywords

The lines in the gperf-generated proposal_keywords_static.c are now
mapped to the (much shorter) .txt source file, which causes mismatches
like these:

  genhtml: ERROR: no data for line:190, TLA:GNC, file:/home/runner/work/strongswan/strongswan/src/libstrongswan/crypto/proposal/proposal_keywords_static.txt

We could ignore "unmapped" errors in genhtml, but since the file is
generated anyway, we can also exclude it from the results and still
get such errors in case this happens for other files.  Another alternative
would be to remove the `#line` macros in the generated file.  Then the
coverage of the actual C file would get reported (but again, it's
generated, so there isn't much value in it).

Also updated the branch coverage option as the one with `lcov_` prefix
is deprecated.

3 months agocoverage: Use atomic profiling updates to avoid issues with multi-threaded test cases
Tobias Brunner [Fri, 10 Jan 2025 15:03:53 +0000 (16:03 +0100)] 
coverage: Use atomic profiling updates to avoid issues with multi-threaded test cases

3 months agolibrary: Exclude the check_memwipe() function from AddressSanitizer
Tobias Brunner [Thu, 9 Jan 2025 14:20:45 +0000 (15:20 +0100)] 
library: Exclude the check_memwipe() function from AddressSanitizer

Newer versions of AddressSanitizer (e.g. in Ubuntu 24.04) will report
this now as stack-use-after-return.

3 months agogithub: Don't install the NDK as root
Tobias Brunner [Thu, 9 Jan 2025 13:35:53 +0000 (14:35 +0100)] 
github: Don't install the NDK as root

On the Ubuntu 24.04 image, this causes the /home/runner/.config/.android
directory to be owned by root, which lets the build fail later.

3 months agogithub: Enable SRP in OpenSSL build for clang AddressSanitizer build
Tobias Brunner [Fri, 10 Jan 2025 14:14:11 +0000 (15:14 +0100)] 
github: Enable SRP in OpenSSL build for clang AddressSanitizer build

On Ubuntu 24.04, llvm-symbolizer-18, which is used to resolve symbols
in backtraces, links libcurl.so.4 for some reason.  And that in turn
requires SRP.  If our custom build doesn't provide it, we get stuff
like this

  /usr/bin/llvm-symbolizer-18: symbol lookup error: /lib/x86_64-linux-gnu/libcurl.so.4: undefined symbol: SSL_CTX_set_srp_password, version OPENSSL_3.0.0

and the symbols are not resolved and can't be whitelisted.

This also makes sure ASan is actually disabled if our own leak-detective
is used.

3 months agogithub: Adapt to switch to Ubuntu 24.04 for ubuntu-latest
Tobias Brunner [Thu, 9 Jan 2025 13:21:10 +0000 (14:21 +0100)] 
github: Adapt to switch to Ubuntu 24.04 for ubuntu-latest

3 months agoconstraints: Exclude self-signed root CAs without policies from policy validation
Tobias Brunner [Wed, 8 Jan 2025 12:51:21 +0000 (13:51 +0100)] 
constraints: Exclude self-signed root CAs without policies from policy validation

Self-signed trust anchors are not part of the certificate path validation
according to RFC 8280, section 6.1:

  When the trust anchor is provided in the form of a self-signed
  certificate, this self-signed certificate is not included as part of
  the prospective certification path.

But policies in them could still be used, as stated in section 6.2:

  Where a CA distributes self-signed certificates to specify trust
  anchor information, certificate extensions can be used to specify
  recommended inputs to path validation.  For example, a policy
  constraints extension could be included in the self-signed
  certificate to indicate that paths beginning with this trust anchor
  should be trusted only for the specified policies.  [...]
  Implementations that use self-signed certificates to specify trust
  anchor information are free to process or ignore such information.

So unconditionally enforcing that self-signed root certificates contain
the policies is probably too strict.  Often they won't contain the
extension at all.  With this change, we allow that but still enforce the
policies in case such a certificate contains them.  The other
policy-related constraints are also enforced still should they be
contained.

Closes strongswan/strongswan#2601

4 months agogithub: Use AWS-LC 1.41.1 for tests
Tobias Brunner [Wed, 11 Dec 2024 15:00:08 +0000 (16:00 +0100)] 
github: Use AWS-LC 1.41.1 for tests

4 months agovici: Add pyproject.toml file to declare build backend
Tobias Brunner [Wed, 11 Dec 2024 15:27:42 +0000 (16:27 +0100)] 
vici: Add pyproject.toml file to declare build backend

4 months agocirrus: Fix vici Python build on Alpine
Tobias Brunner [Wed, 11 Dec 2024 16:11:24 +0000 (17:11 +0100)] 
cirrus: Fix vici Python build on Alpine

4 months agotesting: Ignore errors when dumping our routing table
Tobias Brunner [Tue, 10 Dec 2024 15:48:40 +0000 (16:48 +0100)] 
testing: Ignore errors when dumping our routing table

Some scenarios disable route installation and if they are executed before
any scenarios that don't, there won't be a rule for table 220 and we get
"FIB table does not exist" errors.

4 months agovici: Update Python build
Tobias Brunner [Mon, 9 Dec 2024 14:21:52 +0000 (15:21 +0100)] 
vici: Update Python build

Directly calling setup.py is deprecated (apparently has been for a while,
but now we get large warnings).  Direct installation is also discouraged.
So this removes that option.  The built wheel (the old egg format is not
used/built anymore) can be installed manually in a venv or the like.

4 months agovici: Update supported Python versions
Tobias Brunner [Mon, 9 Dec 2024 10:29:59 +0000 (11:29 +0100)] 
vici: Update supported Python versions

4 months agogithub: Update chunk_from_chars() CodeQL query to new data flow API
Tobias Brunner [Wed, 11 Dec 2024 12:53:00 +0000 (13:53 +0100)] 
github: Update chunk_from_chars() CodeQL query to new data flow API

4 months agopubkey: Remove unused set_subject() method
Tobias Brunner [Fri, 6 Dec 2024 10:52:37 +0000 (11:52 +0100)] 
pubkey: Remove unused set_subject() method

If not properly used (i.e. before sharing the object), this was not
thread-safe.  So better remove it and force users to create immutable
objects.

4 months agovici: Delay creation of raw public keys until we know the identity
Tobias Brunner [Fri, 6 Dec 2024 10:33:37 +0000 (11:33 +0100)] 
vici: Delay creation of raw public keys until we know the identity

The previous approach had two drawbacks:

First, it caused duplicate public keys because when the `certificate_t`
object was created and added to the credential set it had no subject
assigned yet.  So it defaulted to the key ID.  However, all previously
loaded keys had their subject already changed to an identity, so there
never was a match and new objects were always added whenever a config
with raw public keys was loaded.

Second, the subject was replaced in a way that's not thread-safe on an
object that's already shared in the public credential set.  So other
threads could potentially access the `identification_t` object that's
destroyed during that process.

References strongswan/strongswan#853
Closes strongswan/strongswan#2561

5 months agotesting: Include ML-KEM crypto tests rw-cert scenario
Andreas Steffen [Fri, 6 Dec 2024 13:38:14 +0000 (14:38 +0100)] 
testing: Include ML-KEM crypto tests rw-cert scenario

5 months agochild-create: Fix double free of list of labels after migrate
Rob Shearman [Thu, 14 Nov 2024 13:15:36 +0000 (13:15 +0000)] 
child-create: Fix double free of list of labels after migrate

If a migrate of a child-create occurs then labels_i and labels_r are
freed, but the pointers are left set. If the task is subsequently
destroyed without being reused, then both of these will be double
freed.

Fix this by setting labels_i and labels_r to NULL in the migrate
method after freeing, similar to other fields that are freed.

Closes strongswan/strongswan#2552

Fixes: f9b895b49f49 ("child-create: Add support to handle security labels")
5 months agoswanctl: Document keX_ prefix and replace DH with KE
Tobias Brunner [Wed, 4 Dec 2024 14:14:21 +0000 (15:14 +0100)] 
swanctl: Document keX_ prefix and replace DH with KE

5 months agonm: Version bump to 1.6.1
Tobias Brunner [Tue, 3 Dec 2024 13:36:47 +0000 (14:36 +0100)] 
nm: Version bump to 1.6.1

5 months agofile-logger: Don't log <> if ike_name is disabled and no IKE_SA is available 6.0.0
Tobias Brunner [Tue, 3 Dec 2024 08:04:34 +0000 (09:04 +0100)] 
file-logger: Don't log <> if ike_name is disabled and no IKE_SA is available

Fixes: a2fba6db4a17 ("file-logger: Add option to log messages as JSON objects")
5 months agotesting: Use a single scp command to restore defaults
Tobias Brunner [Mon, 2 Dec 2024 18:18:56 +0000 (19:18 +0100)] 
testing: Use a single scp command to restore defaults

This is a bit faster than two sequential calls.

5 months agotesting: Improve replacing IP addresses in test files
Tobias Brunner [Mon, 2 Dec 2024 18:07:51 +0000 (19:07 +0100)] 
testing: Improve replacing IP addresses in test files

There are a lot of files without patterns and running them all through
sed is quite slow.  Using grep first makes this quicker (about 0.5s per
test).  Ignoring PEM files is also helpful.

5 months agotesting: Log timestamps relative to the start of the test
Tobias Brunner [Fri, 29 Nov 2024 19:04:45 +0000 (20:04 +0100)] 
testing: Log timestamps relative to the start of the test

Makes it easier to compare multiple runs against each other.

5 months agotesting: Collect test results with an on-guest script in parallel
Tobias Brunner [Fri, 29 Nov 2024 17:24:18 +0000 (18:24 +0100)] 
testing: Collect test results with an on-guest script in parallel

In particular the swanctl calls all take a while and this allows doing
them in parallel if multiple hosts are involved. This reduces the runtime
of each test by 1-3 seconds.

5 months agotesting: Use an on-guest script to cleanup/initialize and run them in parallel
Tobias Brunner [Fri, 29 Nov 2024 17:15:58 +0000 (18:15 +0100)] 
testing: Use an on-guest script to cleanup/initialize and run them in parallel

This is a bit quicker than doing this with separate SSH calls for each
host sequentially (up to half a second per test).