19377 Commits

Author SHA1 Message Date
Tobias Brunner
523067e6db init: Only install legacy service unit if starter/stroke is enabled
Closes strongswan/strongswan#2722
2025-04-14 11:54:42 +02:00
Tobias Brunner
8ae00c334a 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
2025-04-14 11:40:59 +02:00
Tobias Brunner
57e74f64b3 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.
2025-04-14 11:39:44 +02:00
Tobias Brunner
d54a29cc5c github: Use OpenSSL 3.5.0 to test ML-KEM 2025-04-14 11:38:48 +02:00
Tobias Brunner
b914333ab4 openssl: Add support for ML-KEM with OpenSSL 3.5 2025-04-14 11:38:48 +02:00
Tobias Brunner
f2e88b169f leak-detective: Whitelist OpenSSL 3.5 functions 2025-04-14 11:38:48 +02:00
Tobias Brunner
fd17d154e5 github: Build OpenSSL from the Git repository instead of a tarball
This is more flexible and allows test builds against branches.
2025-04-14 11:38:48 +02:00
Tobias Brunner
defbabd724 tty: Produce colored output in CI environments 2025-04-10 09:33:19 +02:00
Tobias Brunner
245ea0597d vici: Increase buffer to hold uint64_t when parsing packet limits 2025-04-10 08:31:10 +02:00
Thomas Egerer
ed8c08fbe7 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>
2025-04-10 08:31:10 +02:00
Tobias Brunner
9fe58c83fb 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.
2025-04-10 08:31:10 +02:00
Tobias Brunner
8cb36be188 swanctl: Document "none" keyword for ESP proposals 2025-04-10 08:31:10 +02:00
Tobias Brunner
46674e64c1 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).
2025-04-10 08:31:09 +02:00
Tobias Brunner
8679d91c81 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.
2025-04-10 08:31:09 +02:00
Tobias Brunner
07978c16b3 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)
	{
	}
2025-04-10 08:31:09 +02:00
Tobias Brunner
6ed63be612 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.
2025-04-10 08:31:09 +02:00
Tobias Brunner
b0a4b7f2dd daemon: Add facility to register custom init/deinit functions
Same as the previous commit but with access to the daemon.
2025-04-10 08:31:09 +02:00
Tobias Brunner
a6f4146f45 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.
2025-04-10 08:31:09 +02:00
Tobias Brunner
1a20502573 github: Add compile test with --without-testable-ke option 2025-04-10 08:31:09 +02:00
Tobias Brunner
6cbd93838b 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.
2025-04-10 08:31:09 +02:00
Thomas Egerer
a7c285bc50 auth-cfg: Add lower case enum names for auth_rule_t
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2025-04-10 08:31:09 +02:00
Thomas Egerer
af9095fdd9 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>
2025-04-10 08:31:09 +02:00
Thomas Egerer
ee4e93419b gitignore: Add *.i and *.s files
Ignore a couple of compiler generated temp files.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2025-04-10 08:31:09 +02:00
Tobias Brunner
0bccc287d6 Doxyfile: Exclude OpenSSL sources of Android app
They can produce warnings and we don't want to include documentation for
these anyway.
2025-04-10 08:31:09 +02:00
Tobias Brunner
cdefe52494 github: Set type in issue templates 2025-04-10 08:31:09 +02:00
Tobias Brunner
d7305a556f 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.
2025-04-10 08:31:09 +02:00
Tobias Brunner
353d5c130b 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.
2025-04-07 14:54:48 +02:00
Tobias Brunner
d7eb3ed92e testing: Make ocsp.cgi in ikev2-multi-ca/ocsp-signers scenario executable 2025-04-07 14:54:48 +02:00
Tobias Brunner
a1ab256756 testing: Add some network utilities to the base image 2025-04-04 12:06:59 +02:00
Tobias Brunner
022f2d5f30 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`.
2025-04-04 12:06:59 +02:00
Tobias Brunner
02c43fa6e4 testing: Move removal of charon.pid into posttest section
Fixes: a103f3a2849f ("testing: Add options to only run pre- or posttest scripts of a scenario")
2025-04-04 12:06:59 +02:00
Tobias Brunner
08428f6b5d 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")
2025-04-04 12:06:59 +02:00
Tobias Brunner
5e4dedfc20 Merge branch 'android-always-on-managed'
Fixes an issue with initiating managed profiles as Always-on VPN.

Closes strongswan/strongswan#2756
android-2.5.5
2025-04-04 08:57:12 +02:00
Tobias Brunner
8036b3f932 android: New release after fixing Always-on VPN with managed profiles 2025-04-03 16:35:47 +02:00
Tobias Brunner
d87be9b981 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.
2025-04-03 16:19:53 +02:00
Tobias Brunner
11978ddd39 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).
2025-03-19 10:22:37 +01:00
Tobias Brunner
d5d2568ff0 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.
2025-03-19 10:22:37 +01:00
Tobias Brunner
38d89f57f0 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.
2025-03-19 10:22:37 +01:00
Tobias Brunner
a7b5de5690 pki: Fix signature of help() to match that of a callback in command_t 2025-03-19 10:22:37 +01:00
Tobias Brunner
2553357f85 github: Use AWS-LC 1.48.5 for tests 2025-03-18 08:32:52 +01:00
Tobias Brunner
1f222f5dfb testing: Install iperf3 instead of iperf 2025-03-14 11:49:48 +01:00
Tobias Brunner
a103f3a284 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.
2025-03-14 11:49:42 +01:00
Tobias Brunner
25ec2bc43d Don't reference 5.9 in URLs to docs.strongswan.org 2025-03-11 10:26:31 +01:00
Tobias Brunner
378c75cb2e nm: Version bump to 1.6.2 2025-03-11 09:57:54 +01:00
Andreas Steffen
1e8cca4004 Version bump to 6.0.1 6.0.1 2025-03-10 19:19:37 +01:00
Andreas Steffen
5a74d796a8 testing: Adapted ha/active-passive tests 2025-03-10 19:18:40 +01:00
Tobias Brunner
fcaee9e123 vici: Document ICMP type/code traffic selector restrictions 2025-03-05 10:55:51 +01:00
Tobias Brunner
3c3a545bfe NEWS: Add news for 6.0.1 2025-03-05 08:50:44 +01:00
Tobias Brunner
4e2cf58961 receiver: Properly clean up if hasher or RNG can't be created 2025-03-04 15:30:25 +01:00
Tobias Brunner
380ec66c92 winhttp: Properly destroy linked list if connection can't be opened 2025-03-04 15:27:53 +01:00