Commit Graph
19678 Commits
Author SHA1 Message Date
Tobias Brunner 7fa4d54b3c array: Handle recursive calls to array_sort() if qsort_r() is not supported
Such a recursive call occurs when sorting the array of Child SAs inside
an IKE SA that causes comparisons of the child configs and their
proposals, which in turn creates a merged array of all transform types
and that uses array_sort() and array_bsearch().

Closes strongswan/strongswan#2926

Fixes: 8e7f379f71 ("ike-sa: Sort CHILD_SAs by CPU ID")
2026-01-22 18:14:58 +01:00
Tobias Brunner d0c36baef9 charon-cmd: Add support for childless IKE SA initiation
References strongswan/strongswan#1594
2026-01-15 14:12:43 +01:00
Tobias Brunner e248fac362 charon-cmd: Only use loose identity matching if no IDr is configured 2026-01-15 14:10:59 +01:00
Tobias Brunner 757dce2ed3 charon-cmd: Add support for PSK authentication with IKEv2
Can be useful for testing purposes (e.g. some public test servers use
PSKs).
2026-01-15 14:10:35 +01:00
Jean-François Hren 5aacf5c7b6 trap-manager: Use latest seq when creating an acquire entry
Closes strongswan/strongswan#2975

Fixes: 79815b4e67 ("trap-manager: Set seq. no. for CHILD_SAs not initiated by an acquire")
2026-01-05 18:14:38 +01:00
Tobias Brunner d68044b216 identification: Add support for organizationIdentifier in DNs
These are e.g. used in eIDAS certificates.
2026-01-05 10:50:24 +01:00
Tobias Brunner f79504994a agent: Fix compiler warning when building with clang
Fixes: 8b467ad39a ("agent: Add option to open socket as specific user")
2025-12-12 15:59:38 +01:00
Tobias Brunner 9d242a4f7d ip-packet: Fix compiler warning seen on FreeBSD 15
We explicitly use untoh16() so this warning isn't relevant:

  ip_packet.c:313:42: error: taking address of packed member 'ip_len' of class or structure 'ip' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
2025-12-12 15:58:31 +01:00
Tobias Brunner db6eca56d7 cirrus: Use FreeBSD 15.0 and 14.3 2025-12-12 15:58:31 +01:00
Tobias Brunner d20a0116b2 Use Botan 3.10.0 for tests
Clean up leak-detective whitelist for newer Botan versions but add
`botan_private_key_load` as `botan_privkey_load*` won't show up anymore
without bfd-backtraces due to inlining if we don't call it directly.

Ref: https://github.com/randombit/botan/discussions/4868
2025-12-12 15:58:31 +01:00
Tobias Brunner 1ff9533348 github: Use AWS-LC 1.65.1 for tests 2025-12-12 15:58:31 +01:00
Tobias Brunner ca37563c55 nm: Version bump to 1.6.4 2025-12-12 15:35:57 +01:00
Andreas Steffen d1c259f44b Version bump to 6.0.4 2025-12-12 15:32:29 +01:00
Tobias Brunner 858934550a NEWS: Add news for 6.0.4 2025-12-10 18:34:20 +01:00
Tobias Brunner d7608ca192 nm: Pass back the username auth-dialog runs as to access ssh-agent socket
This ensures we access the socket as user who NM ran the auth-dialog for,
especially for system-wide connections where the connection does not
mention a user.

We also make sure we don't use the cached socket and user of a previous
connection attempt, because system-wide connections might be used by
different users.
2025-12-10 18:34:19 +01:00
Tobias Brunner 7cc8973db7 charon-nm: Pass configured user when connecting to SSH/GPG agent
This prevents an attack similar to the one fixed previously where a
user passes the path to credentials of another user, in this case the
path to the agent socket of that user.
2025-12-10 18:34:19 +01:00
Tobias Brunner 8b467ad39a agent: Add option to open socket as specific user
This can prevent an attack where user A passes the path to user B's
ssh-agent socket to the daemon that is running as root.
2025-12-10 18:34:19 +01:00
Tobias Brunner a768f57286 nm: Create safe copies of files for user-specific connections
This ensures that only certificates/private keys accessible by the
configured user are accessed and prevents attackers from misusing
other user's credentials.

Also removed setting NM_VERSION_MIN_REQUIRED, which suppresses deprecation
warnings that were added with newer API versions, and
NM_VERSION_MAX_ALLOWED, which warns if using functions added in newer
API versions, so we always build against the latest API available.

But we check explicitly for the required function so this works with
older NM versions and automatically will use it if the function is
backported.

Note that we can't use BUILD_FROM_FILE to read the temporary files as that
uses mmap() which SELinux policies prevent us from using at the location
these files are stored ([/var]/run/NetworkManager/cert/).

Fixes: CVE-2025-9615
2025-12-10 17:12:31 +01:00
Tobias Brunner 84a5208d98 child-rekey: Prevent crash if peer rekeys a Child SA twice before sending a delete
Some (Windows) peers have been seen to initiate a second rekeying for the
same Child SA.  Presumably, this happens if a rekey request from us for
the same old Child SA arrives while it waits for the response to its
first rekey request.  Once we receive the delete for the old SA, we
conclude the rekeying with the second replacement.  However, the first
replacement remained linked to the old SA.  So this change prevents a
crash once the peer sends a delete for that first replacement (which it
seems to do after about 5 minutes).

References strongswan/strongswan#2944
Closes strongswan/strongswan#2945
2025-12-10 17:10:29 +01:00
Andreas Steffen 96468d2891 Merge branch 'master' into testing-per-cpu-sas 2025-12-08 08:46:51 +01:00
Andreas Steffen 909f52875e Version bump to 6.0.4rc1 2025-12-08 08:22:18 +01:00
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
Jean-François Hren f25b1aca8b credential-manager: Fix leaked signature params if self-signed cert is untrusted
Closes strongswan/strongswan#2954
2025-12-01 19:18:53 +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