Commit Graph
19656 Commits
Author SHA1 Message Date
Tobias Brunner 1454bd7bcf testing: Make per-CPU SAs scenarios more predictable by pinning IRQs to vCPUs
This ensures that packets on sun are processed on a particular CPU and
not randomly on one, which causes expected SAs not to get created or
other weird things.
2025-12-03 11:42:54 +01:00
Tobias Brunner b0e4a7d015 github: Use AWS-LC 1.65.0 for tests 2025-11-21 10:51:38 +01:00
Tobias Brunner 831d8454df Use wolfSSL 5.8.4 for tests
Also remove the --enable-md4 option.  We never supported MD4 via wolfSSL,
as it's not available via the hash API we use (would require explicit
MD4-specific functions and structures).
2025-11-21 10:49:18 +01:00
Tobias Brunner 3a5fb9175b Merge branch 'swanctl-names'
Increases buffers in settings and swanctl to allow longer connection
names (up to the limit of 256 characters imposed by VICI).  The limit
for names is now also enforced when generating VICI messages.

Closes strongswan/strongswan#2936
2025-11-20 15:54:57 +01:00
Tobias Brunner 80e2cf44a3 swanctl: Allow connection and child config names to be longer
VICI imposes an upper limit of 256 characters for names, which we should
allow for connection and child configs.
2025-11-19 10:50:06 +01:00
Tobias Brunner 9fe4f9fc9f settings: Increase buffer size for key patterns/parts when looking up settings
The buffer size for individual parts of a key now match the maximum length
of names in VICI. The full pattern should accommodate several long names
(e.g. for connections and child connections in swanctl) even if no
printf-specifiers are used.
2025-11-19 10:37:55 +01:00
Tobias Brunner 9b0b1cb24e vici: Enforce maximum length for names when building a message
Otherwise, an integer overflow will shorten the name and cause
unpredictable outcomes.
2025-11-19 10:30:39 +01:00
Tobias Brunner 641af25b10 Merge branch 'revocation-fetcher'
Combines concurrent requests for the same CRL URI by multiple threads.
So only the first thread actually fetches it, the others wait for that
result.  This is particularly helpful if the CRL can currently not
be fetched due to DNS or HTTP/LDAP timeouts as it prevents each thread
from having to wait for the complete timeouts, which reduces the number
of SAs that can concurrently be established.

A negative result is cached for a while (currently 3 times the fetch
timeout, i.e. 30 seconds by default) so requests can fail quickly and
threads can continue establishing SAs if they use a relaxed revocation
policy.

Closes strongswan/strongswan#2918
2025-11-13 18:56:57 +01:00
Martin Willi df6977d4cf revocation: Block only one thread per URL after a previous CRL fetch failed
If a CRL server is unresponsive, all threads trying to fetch this CRL will
block execution. If a recent previous attempt to fetch the CRL failed, it
is likely that it will fail again. While it makes sense to retry fetching
the CRL on demand with one thread, it hardly does to block additional
threads while the first one is blocked during the fetch.

So remember the timestamp of the last CRL fetch failure per URL, and do
not block more than one thread in the CRL fetch for some time. This time
is a multiple of the configured fetch timeout, so that it works well for
any configured value. With the default configuration, a failing CRL fetch
will impact concurrent CRL fetches for the same URL for 30s.
2025-11-13 18:15:15 +01:00
Martin Willi 330a7d1963 revocation: Synchronize CRL fetches of multiple threads to the same URL
When handling many connection attempts from peers using the same CA, a slow
or non-responsive CRL distribution point can lead to concurrent fetches of
the same CRL by multiple threads. This is not only inefficient, but results
in all threads blocking for the full fetch timeout, potentially blocking
all threads in the pool.

As a first step, synchronize CRL fetches using a global mutex and a per-URL
condvar, so threads can wait for the CRL if another is already fetching it.
This reduces the number of useless concurrent CRL fetches, and allows threads
joining the party late to get blocked only until the first fetch completes
or times out.

The URL entry is preserved in the hashtable after completing the fetch.
This will allow subsequent optimizations to store the last fetch result
and act accordingly. The CRL itself is not, as CRLs can be rather large
and caching them can be done using existing mechanisms controlled via
corresponding options.
2025-11-13 18:15:15 +01:00
Martin Willi 119dfc2c38 revocation: Move CRL/OCSP fetch operations to a dedicated fetcher helper
Before adding stateful CRL fetching extensions, refactor CRL fetching to
a helper class for better separation. While there are currently no plans
to extend OCSP fetching, move it as well for consistency.
2025-11-13 18:15:15 +01:00
Martin Willi f739f7a075 revocation: Pass "this" parameter along CRL/OCSP verification functions
As future commits will require shared state during fetch operations, a common
context is required. So pass along the "this" parameter in various revocation
functions.
2025-11-13 18:15:15 +01:00
Tobias Brunner 041d0642a1 github: Use AWS-LC 1.64.0 for tests 2025-11-13 14:09:23 +01:00
Tobias Brunner 5e410617d4 Merge branch 'android-updates'
Fixes edge-to-edge layout issues with the settings and application
selection Activities.
2025-10-30 17:13:38 +01:00
Tobias Brunner 8155ea920c android: New release after fixing edge-to-edge layout issues 2025-10-30 17:12:54 +01:00
Tobias Brunner a4f32a5a46 android: Fix edge-to-edge layout issues with settings and app selection
Using FrameLayout for the settings instead of the recommended
FragmentContainerView because the latter makes handling insets more
complicated (fitsSystemWindows doesn't work as the fragment is responsible
for handling insets but how that should work with PreferenceFragmentCompat
is unclear).

Fixes: 2404b2bee6 ("android: Apply UI changes for edge-to-edge views in Android 15+")
2025-10-30 16:55:05 +01:00
Tobias Brunner 3741d24a25 Merge branch 'android-updates'
This fixes the vulnerability in the eap-mschapv2 plugin and an issue
with the filename of log files.  In the released app, the OpenSSL version
is also increased in order to support ML-KEM.
2025-10-27 15:37:11 +01:00
Tobias Brunner d8ff59d02f android: New release after fixing eap-mschapv2 and log file issues
OpenSSL is also updated in the released version of the app.
2025-10-27 15:13:02 +01:00
Tobias Brunner 5d98463eed android: Fix querying display name of the log file
The previous code did not necessarily provide it (in particular if the
size, or anything else, was queried as first column).
2025-10-27 14:39:55 +01:00
Tobias Brunner 69381576d7 android: Use Docker's recommended syntax for env variables 2025-10-27 14:39:55 +01:00
Andreas Steffen 472dcd8bb5 Version bump to 6.0.3 2025-10-27 14:02:59 +01:00
Tobias Brunner 1014d74e4b NEWS: Add info about CVE-2025-62291 2025-10-27 14:02:59 +01:00
Tobias Brunner c687ada6a6 eap-mschapv2: Fix length check for Failure Request packets on the client
For message lengths between 6 and 8, subtracting HEADER_LEN (9) causes
`message_len` to become negative, which is then used in calls to malloc()
and memcpy() that both take size_t arguments, causing an integer
underflow.

For 6 and 7, the huge size requested from malloc() will fail (it exceeds
PTRDIFF_MAX) and the returned NULL pointer will cause a segmentation
fault in memcpy().

However, for 8, the allocation is 0, which succeeds.  But then the -1
passed to memcpy() causes a heap-based buffer overflow (and possibly a
segmentation fault when attempting to read/write that much data).
Fortunately, if compiled with -D_FORTIFY_SOURCE=3 (the default on e.g.
Ubuntu), the compiler will use __memcpy_chk(), which prevents that buffer
overflow and causes the daemon to get aborted immediately instead.

Fixes: f98cdf7a47 ("adding plugin for EAP-MS-CHAPv2")
Fixes: CVE-2025-62291
2025-10-27 14:02:59 +01:00
Tobias Brunner 9ef637e782 eap-mschapv2: Fix length check for successful responses on the client
While wrong, this isn't an issue in practice as AUTH_RESPONSE_LEN is
long enough that subtracting HEADER_LEN is fine.

Fixes: f98cdf7a47 ("adding plugin for EAP-MS-CHAPv2")
2025-10-27 14:02:59 +01:00
Andreas Steffen 4cf88da4d7 Version bump 6.0.3rc1 2025-10-24 15:21:52 +02:00
Tobias Brunner ba2bc3f4fe vici: Add event listener of Python bindings to release tarball
Fixes: 4e065a9624 ("vici: Add decorators to Python bindings to simplify listening for events")
2025-10-24 15:15:45 +02:00
Tobias Brunner d3a05165d4 NEWS: Add news for 6.0.3 2025-10-17 17:20:13 +02:00
Tobias Brunner eaf0c22e8e Fixed some typos, courtesy of codespell 2025-10-17 17:20:13 +02:00
Tobias Brunner 7c74925fa1 pkcs11: Fix comment
Fixes: e9fa338e23 ("pkcs11: Improve detection of already unwrapped CKA_EC_POINTs")
2025-10-17 17:20:13 +02:00
Tobias Brunner 6b6bec7295 Merge branch 'python-decorators'
Adds decorators to simplify listening for events.

References strongswan/strongswan#2772
2025-10-16 15:05:22 +02:00
Tobias Brunner 4840507d7a vici: Allow callers of listen() to distinguish between disconnects and intended breaks 2025-10-08 16:53:01 +02:00
Tobias Brunner 8bfdf2fb60 vici: Export timeout in event listener of Python bindings
This allows running periodic tasks (e.g. check some outside condition)
and stop listening by raising the StopListening exception.
2025-10-07 09:22:40 +02:00
Tobias Brunner 79da117283 vici: Provide a way to stop listening and re-connect in Python bindings
This allows re-connecting to a new session in a disconnect listener and
continue listening without having to return from listen().  The exception
can also be used to stop listening after some condition (e.g. to wait
until a specific SA got created and then stop).
2025-10-07 09:22:38 +02:00
Tobias Brunner 4e065a9624 vici: Add decorators to Python bindings to simplify listening for events 2025-10-07 09:20:57 +02:00
Tobias Brunner a24429c678 appveyor: Change OpenSSL directory on Windows Server 2019 image
The default OpenSSL version has changed to 1.1.1 and the -v111 dir was
removed.
2025-10-06 14:45:49 +02:00
Tobias Brunner 404111b46f Merge branch 'vici-alerts'
Exposes alerts via vici protocol.

Closes strongswan/strongswan#2894
2025-10-02 10:22:51 +02:00
Martin Willi f5f04b7d20 bus: Clarify that ALERT_TS_NARROWED is issued for local narrowing as well 2025-10-02 10:22:36 +02:00
Martin Willi 86a50d1618 child-create: Raise an ALERT_TS_MISMATCH when receiving TS_UNACCEPTABLE
When sending a TS_UNACCEPTABLE notify, a ALERT_TS_MISMATCH is sent, but
not when receiving one. This seems inconsistent compared to proposal
mismatch handling, so extend the child_create task to raise such an alert.
2025-10-02 10:22:36 +02:00
Martin Willi d46529fe2d vici: Raise alert events from the bus alert listener hook
The bus alert infrastructure is currently exposed through the error-notify
plugin using a dedicated socket using a rather archaic message format.
Vici clients would need a dedicated socket connection just to receive such
alert messages, making their implementation more complex.

With vici, it is rather trivial to expose bus alerts through a dedicated
event message that vici clients may subscribe to. Add such an "alert"
event type to vici. Alert names are mapped to strings for simple consumption by
clients.

For now, the error-notify string message is omitted from events, as it mostly
contains static information without much value; instead add the IKE_SA details
for alerts associated to an IKE_SA. Other alert specific data may be added in
the future if needed; preferably using a structured format instead of the
arbitrary string messages used by error-notify. To allow future extensions,
wrap IKE_SA details under a dedicated "ike-sa" property.
2025-10-02 10:22:32 +02:00
Tobias Brunner b83aed1362 libtls: Use correct constant in error message
Closes strongswan/strongswan#2896

Fixes: e731396280 ("tls-server: Check if peer sent hash and signature algorithms")
2025-10-02 10:02:49 +02:00
Tobias Brunner eb2d8768d8 github: Use OpenSSL 3 for macOS builds and enable additional plugins
The Homebrew formula has been using OpenSSL 3 for a while.  The eap-peap
and pkcs11 plugins also have been enabled in the formula.  The dhcp plugin
is enabled to test the port (the farp plugin was already enabled since
its port to FreeBSD/macOS).  The drbg plugin is enabled to run the ML-KEM
test vectors.
2025-10-02 09:03:37 +02:00
Tobias Brunner 6a55de1fa2 github: Build on macOS 14 instead of the deprecated macOS 13
While macos-13 was running on Intel, both macos-latest (macOS 15) and
macos-14 run on ARM64.  While there are Intel-based images for 14 and 15,
they will only be available until August 2027 (and there aren't any Intel
devices anymore anyway).
2025-10-01 19:08:51 +02:00
Tobias Brunner d0770e5362 github: Use OpenSSL 3.6.0 for tests 2025-10-01 19:08:49 +02:00
Tobias Brunner 61daa338c7 vici: Remove deprecated license classifier in Python metadata 2025-10-01 19:08:34 +02:00
Tobias Brunner bfed29705e Merge branch 'android-updates'
This fixes GUI-related compatibility issues with Android 16 and allows
(pre-)selecting on-device certificates/keys with managed profiles.  Also
fixes a typo in the managed config description that prevented
split-tunneling settings from working.
2025-10-01 15:19:18 +02:00
Tobias Brunner 74a4700b6d android: New release after updating target SDK and allowing cert selection in managed profiles 2025-10-01 15:18:27 +02:00
Tobias Brunner ce8b5ff394 android: Fix typo for split-tunneling settings in managed config description
We use the American spelling "tunneling" throughout the app.
2025-10-01 14:47:02 +02:00
Tobias Brunner cde39f4c1a android: Make a certificate alias pre-selectable in managed profiles
This allows associating a pre-installed certificate/key with a VPN
profile.  For instance, one locally generated on the device via
SCEP/ETS by the MDM.  It only works if the app is granted access to the
certificate/key (alias) by the MDM.

For now, users may still select a different certificate if one is
available (since this requires the certificate to be installed as
user-selectable there might not be).
2025-09-30 16:51:08 +02:00
Tobias Brunner 11f043c3de android: Prompt the user to edit the profile if no certificate is selected 2025-09-30 16:51:08 +02:00
Tobias Brunner 1a16b2c0cb android: Don't print "null" if no user certificate is selected 2025-09-30 11:26:41 +02:00