]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
2 weeks agotesting: Add ikev2/per-cpu-sas-encap-transport scenario per-cpu-sas
Tobias Brunner [Wed, 16 Jun 2021 07:45:57 +0000 (09:45 +0200)] 
testing: Add ikev2/per-cpu-sas-encap-transport scenario

Tests transport mode and UDP encapsulation with random source ports.
Interestingly, the responder always uses the same SA to respond (maybe
due to the cache on the policy).

2 weeks agotesting: Add ikev2/per-cpu-sas-encap scenario
Tobias Brunner [Tue, 15 Jun 2021 09:13:35 +0000 (11:13 +0200)] 
testing: Add ikev2/per-cpu-sas-encap scenario

Basically the same as the one without UDP encapsulation, but here the
outbound SAs use random source ports.

2 weeks agokernel-netlink: Suppress NAT mapping updates for per-CPU SAs
Tobias Brunner [Tue, 22 Apr 2025 09:19:34 +0000 (11:19 +0200)] 
kernel-netlink: Suppress NAT mapping updates for per-CPU SAs

As we set the remote port to 0, we'd get a mapping change message with
every packet. Setting the threshold avoids all kernel messages after the
first, which we suppress explicitly as well.

2 weeks agochild-sa: Configure UDP encapsulation for per-CPU SAs
Tobias Brunner [Tue, 15 Jun 2021 09:11:14 +0000 (11:11 +0200)] 
child-sa: Configure UDP encapsulation for per-CPU SAs

As the kernel does not support processing UDP-encapsulated and plain ESP
for the same SA, we require forcing UDP encapsulation if there is no NAT.

2 weeks agovici: Make UDP encapsulation for per-CPU SAs configurable
Tobias Brunner [Tue, 15 Jun 2021 09:10:40 +0000 (11:10 +0200)] 
vici: Make UDP encapsulation for per-CPU SAs configurable

2 weeks agochild-cfg: Add flag to enable UDP encapsulation for per-CPU SAs
Tobias Brunner [Tue, 15 Jun 2021 07:46:31 +0000 (09:46 +0200)] 
child-cfg: Add flag to enable UDP encapsulation for per-CPU SAs

2 weeks agotesting: Add per-CPU SA test scenario
Tobias Brunner [Wed, 2 Jun 2021 15:07:01 +0000 (17:07 +0200)] 
testing: Add per-CPU SA test scenario

2 weeks agotesting: Configure multiple virtual CPUs for moon and sun
Tobias Brunner [Mon, 31 May 2021 14:46:41 +0000 (16:46 +0200)] 
testing: Configure multiple virtual CPUs for moon and sun

This allows testing per-CPU SAs by e.g. pinging over a specific CPU
via taskset.

2 weeks agotesting: Enable SMP support for latest kernels
Tobias Brunner [Mon, 31 May 2021 15:09:28 +0000 (17:09 +0200)] 
testing: Enable SMP support for latest kernels

2 weeks agoswanctl: Report per-CPU information in --list-sas
Tobias Brunner [Thu, 20 May 2021 08:32:09 +0000 (10:32 +0200)] 
swanctl: Report per-CPU information in --list-sas

2 weeks agovici: Report per-CPU SA information
Tobias Brunner [Thu, 20 May 2021 08:19:41 +0000 (10:19 +0200)] 
vici: Report per-CPU SA information

2 weeks agovici: Make per-CPU CHILD_SAs configurable
Tobias Brunner [Thu, 20 May 2021 08:12:30 +0000 (10:12 +0200)] 
vici: Make per-CPU CHILD_SAs configurable

2 weeks agokernel-netlink: Forward CPU ID from acquires
Tobias Brunner [Thu, 20 May 2021 08:04:46 +0000 (10:04 +0200)] 
kernel-netlink: Forward CPU ID from acquires

2 weeks agotrap-manager: Add support to handle acquires for per-CPU SAs
Tobias Brunner [Thu, 20 May 2021 07:46:55 +0000 (09:46 +0200)] 
trap-manager: Add support to handle acquires for per-CPU SAs

2 weeks agokernel-handler: Log CPU ID that's passed with an acquire
Tobias Brunner [Mon, 26 Sep 2022 14:55:00 +0000 (16:55 +0200)] 
kernel-handler: Log CPU ID that's passed with an acquire

2 weeks agokernel-interface: Optionally pass CPU ID for which an acquire was triggered
Tobias Brunner [Mon, 26 Sep 2022 14:47:46 +0000 (16:47 +0200)] 
kernel-interface: Optionally pass CPU ID for which an acquire was triggered

2 weeks agoike-sa: Accept optional CPU ID when initiating CHILD_SAs
Tobias Brunner [Wed, 19 May 2021 13:11:53 +0000 (15:11 +0200)] 
ike-sa: Accept optional CPU ID when initiating CHILD_SAs

2 weeks agoike-sa: Sort CHILD_SAs by CPU ID
Tobias Brunner [Thu, 20 May 2021 07:41:54 +0000 (09:41 +0200)] 
ike-sa: Sort CHILD_SAs by CPU ID

This might make debugging easier and also ensures that a possible
fallback SA without CPU ID is established first when reestablishing
an IKE_SA.  Because even if such an SA is established first initially,
that might change later depending on when per-CPU SAs are rekeyed.

2 weeks agochild-rekey: Maintain per-CPU values during rekeying
Tobias Brunner [Wed, 19 May 2021 10:00:39 +0000 (12:00 +0200)] 
child-rekey: Maintain per-CPU values during rekeying

2 weeks agochild-create: Add support to negotiate per-CPU SAs
Tobias Brunner [Wed, 19 May 2021 08:59:03 +0000 (10:59 +0200)] 
child-create: Add support to negotiate per-CPU SAs

2 weeks agoupdown: Don't call the script for per-CPU SAs
Tobias Brunner [Mon, 31 May 2021 14:12:27 +0000 (16:12 +0200)] 
updown: Don't call the script for per-CPU SAs

Rules are installed for the fallback SA that has no CPU ID assigned.

2 weeks agoha: Ignore per-CPU CHILD_SAs
Tobias Brunner [Mon, 31 May 2021 13:26:27 +0000 (15:26 +0200)] 
ha: Ignore per-CPU CHILD_SAs

These only work on initiators (with trap policies), which is something
the plugin doesn't support.

2 weeks agoforecast: Ignore per-CPU CHILD_SAs
Tobias Brunner [Mon, 31 May 2021 13:21:46 +0000 (15:21 +0200)] 
forecast: Ignore per-CPU CHILD_SAs

Not sure if this combination does make sense as the plugin itself would
be a major bottleneck.

Similar to the connmark plugin, PREROUTING rules list SPIs or UDP ports,
which would be necessary for all SAs while the OUTPUT rules would only be
required once.

2 weeks agoconnmark: Ignore per-CPU CHILD_SAs
Tobias Brunner [Mon, 31 May 2021 13:06:41 +0000 (15:06 +0200)] 
connmark: Ignore per-CPU CHILD_SAs

The combination probably doesn't make much sense.

The OUTPUT rules would definitely only be required once, while the INPUT
and PREROUTING rules list individual SPIs and/or UDP ports, which would
be necessary for all SAs.

By the way, the rules in PREROUTING might actually not be necessary
anymore if the set_mark_in option was used for such SAs.

2 weeks agochild-sa: Add support for per-CPU SAs
Tobias Brunner [Tue, 11 May 2021 15:55:21 +0000 (17:55 +0200)] 
child-sa: Add support for per-CPU SAs

The CPU ID is also set on inbound SAs as it can be used to configure RSS
or some eBPF program.

2 weeks agokernel-netlink: Add support to enable per-CPU acquires on policies
Tobias Brunner [Tue, 11 May 2021 14:24:38 +0000 (16:24 +0200)] 
kernel-netlink: Add support to enable per-CPU acquires on policies

2 weeks agokernel-netlink: Add support to set CPU ID on SA
Tobias Brunner [Tue, 11 May 2021 14:07:39 +0000 (16:07 +0200)] 
kernel-netlink: Add support to set CPU ID on SA

2 weeks agoipsec-types: Add identifier for the maximum (=no) CPU ID
Tobias Brunner [Mon, 10 May 2021 14:28:15 +0000 (16:28 +0200)] 
ipsec-types: Add identifier for the maximum (=no) CPU ID

2 weeks agoinclude: Add XFRM identifiers for per-CPU SAs/acquires
Tobias Brunner [Mon, 10 May 2021 14:23:20 +0000 (16:23 +0200)] 
include: Add XFRM identifiers for per-CPU SAs/acquires

2 weeks agochild-cfg: Add flag to enable per-CPU SAs
Tobias Brunner [Tue, 11 May 2021 12:46:29 +0000 (14:46 +0200)] 
child-cfg: Add flag to enable per-CPU SAs

2 weeks agonotify-payload: Add notify types for per-resource CHILD_SAs
Tobias Brunner [Tue, 11 May 2021 12:21:25 +0000 (14:21 +0200)] 
notify-payload: Add notify types for per-resource CHILD_SAs

2 weeks agotesting: Include the kernel build number
Tobias Brunner [Thu, 17 Apr 2025 08:03:56 +0000 (10:03 +0200)] 
testing: Include the kernel build number

2 weeks agokernel-pfkey: Don't use TS from acquire in tunnel mode acquires-seq
Tobias Brunner [Tue, 8 Apr 2025 07:02:12 +0000 (09:02 +0200)] 
kernel-pfkey: Don't use TS from acquire in tunnel mode

The addresses are actually the endpoints of the SA, not information on
the matched packet (except that the RFC says to set the ports and
protocol of the packet in the source address, which the Linux kernel
doesn't do).  So these are useless, unless transport mode is used, where
the addresses are needed for the wildcard trap policy use case.

The RFC mentions a PROXY address (a single one, not two), that could
apparently be something like the source address in tunnel mode.
However, the description of how this is used in the RFC is quite weird
and neither Linux nor FreeBSD send such an attribute in SADB_ACQUIRE.

2 weeks agotesting: Add ikev2/net2net-route-narrow scenario
Tobias Brunner [Mon, 24 Mar 2025 13:02:25 +0000 (14:02 +0100)] 
testing: Add ikev2/net2net-route-narrow scenario

2 weeks agochild-create: Consider previous TS when checking for duplicates
Tobias Brunner [Wed, 2 Apr 2025 12:49:58 +0000 (14:49 +0200)] 
child-create: Consider previous TS when checking for duplicates

2 weeks agochild-sa: Add helper to check if a list of TS match negotiated TS
Tobias Brunner [Wed, 2 Apr 2025 12:39:38 +0000 (14:39 +0200)] 
child-sa: Add helper to check if a list of TS match negotiated TS

2 weeks agochild-create: Maintain traffic selectors during rekeying/reauthentication
Tobias Brunner [Tue, 1 Apr 2025 15:33:35 +0000 (17:33 +0200)] 
child-create: Maintain traffic selectors during rekeying/reauthentication

If we don't do this, narrowed SAs would default to the wide configured
traffic selectors and the peer won't know if/how to narrow.

2 weeks agochild-create: Use more generic method to pass information from previous SA
Tobias Brunner [Tue, 1 Apr 2025 15:28:28 +0000 (17:28 +0200)] 
child-create: Use more generic method to pass information from previous SA

Besides the previous key exchange method, this will allow us to also
reuse the previous traffic selectors.  Some data is still passed in
separate methods as some are set even when there is no previous SA and
others are not set in all cases.

The interface for queue_child() now optionally takes the previous
Child SA to handle both recreations and initiations from scratch.

2 weeks agochild-cfg: Use traffic selector list
Tobias Brunner [Tue, 1 Apr 2025 08:02:31 +0000 (10:02 +0200)] 
child-cfg: Use traffic selector list

2 weeks agotraffic-selector-list: Add helper class to manage a collection of TS
Tobias Brunner [Tue, 25 Mar 2025 11:43:26 +0000 (12:43 +0100)] 
traffic-selector-list: Add helper class to manage a collection of TS

Provides functions to optionally resolve dynamic TS and to narrow
them based on a list of supplied TS.

3 weeks agotrap-manager: Set seq. no. for CHILD_SAs not initiated by an acquire
Tobias Brunner [Mon, 24 Mar 2025 17:03:42 +0000 (18:03 +0100)] 
trap-manager: Set seq. no. for CHILD_SAs not initiated by an acquire

This fixes cases where `start_action = trap|start` is used and an acquire
is triggered while the SA is initiated (granted if narrowing is expected,
that's not a recommended configuration as the responder can only use
the first config when there is no packet TS).  The resulting second
create-child task will potentially get dropped by the duplicate check,
so the temporary state won't get removed and traffic is blocked until
that expires, neither can acquires get triggered for traffic that doesn't
match the initial SA's policies.

3 weeks agochild-create: Trigger CHILD_INSTALLING event after setting traffic selectors
Tobias Brunner [Mon, 24 Mar 2025 16:56:46 +0000 (17:56 +0100)] 
child-create: Trigger CHILD_INSTALLING event after setting traffic selectors

This was the case before bce0c5fd74a0 ("child-create: Update CHILD_SA IP
addresses before installation") and allows listeners to consider the
traffic selectors of the SA that's about to get installed.

3 weeks agochild-create: Use helper to compare packet TS against CHILD_SAs
Tobias Brunner [Mon, 24 Mar 2025 15:48:19 +0000 (16:48 +0100)] 
child-create: Use helper to compare packet TS against CHILD_SAs

3 weeks agochild-sa: Add helper to check if two TS match negotiated TS
Tobias Brunner [Mon, 24 Mar 2025 15:47:54 +0000 (16:47 +0100)] 
child-sa: Add helper to check if two TS match negotiated TS

3 weeks agoacquire-job: Use helpers to manage acquire data
Tobias Brunner [Mon, 24 Mar 2025 14:53:19 +0000 (15:53 +0100)] 
acquire-job: Use helpers to manage acquire data

3 weeks agokernel-listener: Add helpers to clone/destroy acquire data
Tobias Brunner [Mon, 24 Mar 2025 14:53:00 +0000 (15:53 +0100)] 
kernel-listener: Add helpers to clone/destroy acquire data

3 weeks agochild-create: Consider triggering TS when checking for duplicate
Tobias Brunner [Mon, 24 Mar 2025 14:32:57 +0000 (15:32 +0100)] 
child-create: Consider triggering TS when checking for duplicate

3 weeks agovici: Include reqid when listing trap policies
Tobias Brunner [Fri, 21 Mar 2025 13:51:08 +0000 (14:51 +0100)] 
vici: Include reqid when listing trap policies

3 weeks agokernel-netlink: Add support for acquire sequence numbers
Tobias Brunner [Wed, 19 Mar 2025 15:27:39 +0000 (16:27 +0100)] 
kernel-netlink: Add support for acquire sequence numbers

Note that while PF_KEYv2 also uses sequence numbers to identify acquires,
which we currently don't use correctly by the way, it does not include
information about the packet that triggered an acquire.  What we receive
in src and dst, and currently forward as traffic selectors, are actually
the designated endpoints of the SA. So especially in tunnel mode this is
useless to do narrowing on the responder (these addresses might not even
match the configured TS).

3 weeks agokernel-interface: Change reqid if seq. nos. are supported and narrowing occurred
Tobias Brunner [Thu, 20 Mar 2025 13:52:32 +0000 (14:52 +0100)] 
kernel-interface: Change reqid if seq. nos. are supported and narrowing occurred

With the sequence numbers we don't have to maintain the reqid to delete
the temporary state.

One exception is with labels.  There we currently only install trap
policies with the generic label.  SAs created from those don't have
policies installed, so we have to reuse the reqid of the trap even if
narrowing occurs.

And as before, we reuse the reqid without checking traffic selectors if
sequence numbers are not supported.

Note that if a CHILD_SA is manually initiated (i.e. has no sequence
number assigned) right before an acquire is triggered, there are several
possible outcomes depending on whether narrowing occurs.  If there is no
narrowing, the same reqid is assigned and the kernel will remove the
temporary SA when the SA is installed (no seq => reqid match).
Afterwards, the queued duplicate CHILD_SA is destroyed and the acquire
state in the trap manager gets removed.  If there is narrowing, a new
reqid is allocated, so the installation of the SA will not remove the
temporary state.  However, due to the narrowing, the duplicate check
fails and when the duplicate is installed (with sequence number), the
temporary state is deleted (as is the state in the trap manager).

3 weeks agochild-cfg: Use separate method to get configured traffic selectors
Tobias Brunner [Wed, 19 Mar 2025 14:34:58 +0000 (15:34 +0100)] 
child-cfg: Use separate method to get configured traffic selectors

Optionally with "dynamic" traffic selectors resolved.  A new method
is added for those cases where we actually want to select potentially
narrowed traffic selectors using a supplied list.  The latter now also
always logs details, while the former does not.

3 weeks agotrap-manager: Use sequence numbers to identify acquires
Tobias Brunner [Wed, 19 Mar 2025 13:20:46 +0000 (14:20 +0100)] 
trap-manager: Use sequence numbers to identify acquires

Either use the sequence number from the kernel (and potentially update
it if the acquire was retriggered), or generate our own sequence
numbers, which simplifies matching acquires to established/destroyed
CHILD_SAs.

3 weeks agoike: Support optional acquire sequence numbers when creating CHILD_SAs
Tobias Brunner [Wed, 19 Mar 2025 12:28:44 +0000 (13:28 +0100)] 
ike: Support optional acquire sequence numbers when creating CHILD_SAs

3 weeks agochild-sa: Store and propagate optional acquire sequence number
Tobias Brunner [Wed, 19 Mar 2025 12:28:12 +0000 (13:28 +0100)] 
child-sa: Store and propagate optional acquire sequence number

3 weeks agokernel-interface: Add members for optional acquire sequence number
Tobias Brunner [Wed, 19 Mar 2025 12:27:20 +0000 (13:27 +0100)] 
kernel-interface: Add members for optional acquire sequence number

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

3 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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.

4 weeks 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

4 weeks 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

4 weeks 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>
4 weeks 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.

4 weeks 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

4 weeks 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).

4 weeks 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.

4 weeks 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)
{
}

4 weeks 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.

4 weeks 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.

4 weeks 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.

4 weeks 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

4 weeks 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.

4 weeks 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>
4 weeks 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>
4 weeks 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>
4 weeks 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.

4 weeks 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

4 weeks 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.

4 weeks 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.

4 weeks 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

5 weeks 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

5 weeks 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`.

5 weeks 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")
5 weeks 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")
5 weeks 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

5 weeks 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

5 weeks 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.

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

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

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

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