19079 Commits

Author SHA1 Message Date
Tobias Brunner
a24993213e keymat_v2: Add method to calculate IntAuth for IKE_INTERMEDIATE exchanges 2024-08-07 16:20:18 +02:00
Tobias Brunner
b8358936aa message: Add rules for IKE_FOLLOWUP_KE exchanges 2024-08-07 16:20:18 +02:00
Tobias Brunner
414db6cab1 ike-header: Add IKE_FOLLOWUP_KE exchange type 2024-08-07 16:20:18 +02:00
Tobias Brunner
041358976b notify-payload: Add notify types for multiple key exchanges 2024-08-07 16:20:18 +02:00
Tobias Brunner
aedf73f7cf ikev2: Reject IKE_INTERMEDIATE requests after IKE_AUTH
We currently only support these exchanges for additional key exchanges,
so once we have the final keys derived and the ike-init task is removed,
we don't expect any more of them.
2024-08-07 16:20:18 +02:00
Tobias Brunner
25f2cdfc56 message: Add rules for IKE_INTERMEDIATE exchanges 2024-08-07 16:20:18 +02:00
Tobias Brunner
a45d454e94 ike-header: Add IKE_INTERMEDIATE exchange type 2024-08-07 16:20:18 +02:00
Tobias Brunner
cc9ab450d6 notify-payload: Add notify type for IKE_INTERMEDIATE exchange 2024-08-07 16:20:18 +02:00
Tobias Brunner
3e0495745c proposal-substructure: Encode additional key exchange methods 2024-08-07 16:20:18 +02:00
Tobias Brunner
9cc5f4a511 proposal: Make all key exchange transforms optional in ESP/AH proposals 2024-08-07 16:20:18 +02:00
Tobias Brunner
fb6b8c833b proposal: Skip all KE transforms if PROPOSAL_SKIP_KE given 2024-08-07 16:20:18 +02:00
Tobias Brunner
2e059e0c27 transform: Add helper to check if transform type negotiates key exchange 2024-08-07 16:20:18 +02:00
Tobias Brunner
22550bd262 transform: Add additional key exchange transform types 2024-08-07 16:20:18 +02:00
Tobias Brunner
a7f617ab33 kernel-pfkey: Fix list of extension type names on FreeBSD
The list was extended earlier this year.
2024-08-07 15:09:45 +02:00
Tobias Brunner
abdc7878a4 Merge branch 'sa-dir'
Configures the direction of IPsec SAs in the Linux kernel if
possible (6.10+).
2024-08-07 15:00:56 +02:00
Tobias Brunner
22eded1da4 kernel-netlink: Set replay window 0 if kernel supports SA direction attribute
The kernel now allows a 0 replay window with ESN for SAs that are
explicitly tagged as outbound SAs.  But not just that, it actually
rejects outbound SAs with replay windows > 0.  So we add a version check
to control the replay window size.  Note that adding the attribute
unconditionally would be fine even for older kernels, but if somebody
backports the direction patches, the installation of outbound SAs might
fail if the replay window is not adjusted accordingly.
2024-08-07 14:41:28 +02:00
Tobias Brunner
661f6bd0ad kernel-netlink: Add SA direction attribute 2024-08-07 14:41:28 +02:00
Tobias Brunner
2601fabbb4 kernel-netlink: Only disable DF-flag copying on outbound SAs
This will cause errors on inbound SAs if the SA direction attribute is
used.
2024-08-07 14:41:28 +02:00
Tobias Brunner
dc8fa1b3e8 kernel-netlink: Add missing names for XFRM message types and attributes 2024-08-07 14:41:28 +02:00
Tobias Brunner
b05628dd2d include: Update XFRM header for SA direction attribute 2024-08-07 14:41:28 +02:00
Thomas Egerer
84bd011752 ike-sa: Add address family specific configuration of fragment size
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2024-08-07 14:19:41 +02:00
Tobias Brunner
9b9cf2001f android: Fix import of an already existing VPN profile 2024-08-07 08:58:12 +02:00
Tobias Brunner
740cbb2c0a Merge branch 'android-14'
Updates target SDK to Android 14 (34) and fixes compatibility issues.
android-2.5.2
2024-08-06 18:02:18 +02:00
Tobias Brunner
fe1c9dedb7 android: New release after updating target SDK and fixing some compatibility issues 2024-08-06 18:01:54 +02:00
Tobias Brunner
6064209872 android: Increase targetSdkVersion to 34 (Android 14) 2024-08-06 18:01:54 +02:00
Tobias Brunner
880e273985 android: Avoid using deprecated ViewCompat methods 2024-08-06 18:01:54 +02:00
Tobias Brunner
01c81ca15f android: Replace deprecated Observer/Observable with PropertyChangeListener etc.
Kinda misusing the interface as there is no specific property, but
otherwise seems like a 1:1 replacement.
2024-08-06 18:01:54 +02:00
Tobias Brunner
51f746161d android: Add workaround for a bug preventing background service starts from TileService
When targeting Android 14, we get a "Background activity launch blocked!"
exception when trying to start the connection in the background (closing
the drawer works).  Which is apparently a bug:

  https://issuetracker.google.com/issues/305035828

The workaround here is kinda ugly.  In particular, because it's not
possible anymore since a few versions to open a dialog that allows users
to directly grant the required permission to the app.  We can only open
the generic settings dialog where users have to search for the app and
grant the permission themselves (we could add a dialog with an explanation
similar to the one for the power whitelist if necessary).  Hopefully this
gets fixed at some point (the current beta of Android 15 still has the
same bug, though).
2024-08-06 18:01:54 +02:00
Tobias Brunner
3286f75ffe android: Use PendingIntent-version of startActivityAndCollapse()
The other version has been deprecated and throws an exception when
targeting Android 14+.
2024-08-06 18:01:54 +02:00
Tobias Brunner
38160c5cb7 android: Explicitly mark receiver as not exported during registration 2024-08-06 18:01:54 +02:00
Tobias Brunner
9c4ceced1c android: Declare foreground service type for VpnService instance
Required for Android 14 (34).  Since no other type fits we use specialUse,
which also requires a new permission and a description for why we use it.
2024-08-06 18:01:54 +02:00
Tobias Brunner
4f2e65f3d0 android: Fix label for name field in managed profiles
The field is not actually optional.
2024-08-06 18:01:54 +02:00
Tobias Brunner
81041b55d2 android: Fix crash when opening list of apps for new profiles
Fixes: 150dc5ab6401 ("android: Make selected apps read-only")
2024-08-06 18:01:54 +02:00
Tobias Brunner
8a14c20ec7 android: Update dependencies 2024-08-06 18:01:54 +02:00
Tobias Brunner
7b78e35ff6 android: Update Gradle plugin 2024-08-06 18:01:54 +02:00
Matteo Carnelos
bed04baf21 init: Add Wants= dependencies to systemd units
If no other units have dependencies on network-online.target or
syslog.target they might not get initialized resulting in a possibly
non-ideal startup order.

Closes strongswan/strongswan#2279
2024-08-06 15:16:30 +02:00
Tobias Brunner
59a4c9c416 ike-auth: Default IDi/IDr to subject DN instead of IP if a certificate is available
This avoids sending a likely unconfirmed identity if no identity is
configured and received (in case of IDr).

Closes strongswan/strongswan#2353
2024-07-30 14:27:15 +02:00
Tobias Brunner
e9a7c9822d ike-sa: Assign function pointers for mediation extension separately
Using preprocessor directives in calls of function-like macros is
not recommended as it might lead to undefined behavior.
2024-07-30 10:29:36 +02:00
Tobias Brunner
72f9a21b22 Merge branch 'vici-reload-actions'
This improves the behavior when reloading or unloading connections that
have `start` included in their `start_actiton`.

Closes strongswan/strongswan#2324
2024-07-30 10:27:50 +02:00
Tobias Brunner
56b6eeb385 testing: Add ikev2/start-action-start scenario
This tests the behavior for configs with start_action=start during
reloads of the config (updates/removal).
2024-07-26 16:56:32 +02:00
Tobias Brunner
7bfaa9acb6 vici: Improve handling of start action when reloading configs
The previous code had some issues because it handled each child config
separately.  Not only was this quite inefficient because all IKE_SAs had
to be enumerated for every config, it also caused problems with the check
for other CHILD_SAs in order to decide whether to delete the IKE_SA or
not.  Because CHILD_SAs are deleted with an INFORMATIONAL exchange, they
are not immediately gone.  This caused a race condition and with more
than one child config and SAs the IKE_SA could be kept because it
could appear as if other, unrelated CHILD_SAs were still there.

Another race condition, which is fixed by the previous commit, occurred
when only changing child configs.  Then it could happen that the code
deemed the IKE_SA empty and a delete for it was queued.  If that happened
while the IKE_SA was deleting one of the CHILD_SAs (or was busy with some
other exchange), the IKE_SA was not switched to IKE_DELETING.  So it
looked usable and create-child tasks for the updated configs might have
gotten queued.  Unfortunately, once the ike-delete task is eventually
executed, these tasks would be gone and the replacement CHILD_SAs never
created.  This commit additionally avoids actually deleting the IKE_SA
even if all child configs change or get removed if any new CHILD_SAs are
to be initiated.
2024-07-26 16:40:57 +02:00
Tobias Brunner
da00a04f60 ike-sa-manager: Avoid initiating CHILD_SAs on IKE_SAs with queued DELETE
The IKE_SA might be busy with a different task while a request to
terminate it is getting queued, we don't want to use such an IKE_SA to
initiate new CHILD_SAs as these tasks will get lost once the IKE_SA is
terminated.
2024-07-26 11:34:44 +02:00
Tobias Brunner
07ce6b44c5 testing: Enable IPv6 guest-to-guest communication
Not sure what changed, but without this setting, ND packets would not
get through to other hosts connected to the same bridge.
2024-07-26 11:34:44 +02:00
Tobias Brunner
0602ed1043 unit-tests: Fix compiler warning with empty message assertion
The empty array of rules for `assert_message_empty()` and the resulting
size 0 triggers warnings like these:

  allocation of insufficient size '0' for type 'listener_message_rule_t' with size '12'

Using calloc() with `nmemb` set to 0 triggers the same warning.
2024-07-15 16:55:29 +02:00
Tobias Brunner
6eec5cc07d daemon: Use correct argument order for calloc() to fix compiler warning
The number of elements is the first argument, their size the second.
The previous code triggered the following warning:

  'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
2024-07-12 14:00:15 +02:00
Tobias Brunner
574bfad1c0 backtrace: Fix compiler warning on Windows
This change avoids a "variable 'got' might be clobbered by 'longjmp' or
'vfork'" warning with -Wextra.
2024-07-12 11:48:03 +02:00
Tobias Brunner
d759bd9efa Use wolfSSL 5.7.2 for tests 2024-07-11 15:57:12 +02:00
Tobias Brunner
c4bce2b79b testing: Enable mgf1 plugin for scenarios where FreeRADIUS uses PSS signatures
Looks like a cipher suite without DHE was selected previously.

Could be a side-effect of dc1085734f34 ("testing: Remove unnecessary
FreeRADIUS dh_file option as recommended in the log").
2024-06-26 14:56:22 +02:00
Tobias Brunner
a9ced3ccb4 testing: Fix IP pool scenarios after changing base address
Fixes: 2b11764b705d ("mem-pool: Adjust the base address if it's the network ID")
2024-06-26 14:56:22 +02:00
Maxim Uvarov
dd256e730d testing: Enable error code checks for load-testconfig
Errors in load-testconfig are hidden due to not checking scp
return code and mute all errors. Add -e to trap script on
any errors in this script.

References strongswan/strongswan#2310

Signed-off-by: Maxim Uvarov <muvarov@gmail.com>
2024-06-26 14:55:52 +02:00