Commit Graph
15167 Commits
Author SHA1 Message Date
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
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 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 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
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 61daa338c7 vici: Remove deprecated license classifier in Python metadata 2025-10-01 19:08:34 +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
Tobias Brunner 4918e681ee android: Allow selecting a user certificate for managed profiles
This is only enabled for profiles that are not distributed with a
certificate.
2025-09-30 11:26:41 +02:00
Tobias Brunner eac76a1a5a android: Explicitly pull in androidx.localbroadcastmanager
Seems to not get pulled in automatically anymore.  This has actually been
deprecated for years apparently.  Unfortunately, it's not that easy to
replace, so keep it for now.
2025-09-30 11:26:41 +02:00
Tobias Brunner e26d974fe3 android: Remove redundant namespace and fix indentation in state fragment layout 2025-09-30 11:26:40 +02:00
Tobias Brunner 357b93e99d android: Use correct title for proxy server port field in managed configs 2025-09-30 11:26:40 +02:00
Tobias Brunner 3bf34f1cd5 android: Simplify theme definition due to minSdkVersion 2025-09-30 11:26:40 +02:00
Tobias Brunner 13426bd2ea android: Remove obsolete TargetApi attribute 2025-09-30 11:26:40 +02:00
Tobias Brunner 59b74c767a android: Update syntax for three values Gradle warns about
Others seem to be fine or even get an explicit error if changed, like
targetSdkVersion.
2025-09-30 11:26:40 +02:00
Tobias Brunner 19ef347628 android: Increase targetSdkVersion to 36 (Android 16) 2025-09-30 11:26:40 +02:00
Tobias Brunner 86508cdf2b android: Update NDK version 2025-09-30 11:26:40 +02:00
Tobias Brunner 2404b2bee6 android: Apply UI changes for edge-to-edge views in Android 15+
When targeting Android 15, edge-to-edge is the default and when targeting
Android 16, apps can't opt-out from this anymore.  So we update our views
and enable edge-to-edge also for older versions (avoids the black bar
behind the system UI at the bottom).  For most views we just use automatic
margins via android:fitsSystemWindows (or programmatically via
setDecorFitsSystemWindows).  However, for the profile lists and log views,
we take some extra measures that allow the lists to go behind the bottom
system UI.  Appropriate padding is applied at the bottom of the lists so
the last item(s) can be scrolled into full view.
2025-09-30 11:26:40 +02:00
Tobias Brunner 216a9dbb8d android: Avoid crash if read-only profile selection dialog is hidden 2025-09-30 11:26:40 +02:00
Tobias Brunner 3eb2f58a51 android: Update dependencies 2025-09-30 11:26:40 +02:00
Tobias Brunner ff5fc29285 android: Update Gradle plugin 2025-09-30 11:26:40 +02:00
Tobias Brunner b3011e8e87 Remove support for MD2
No part of IKE/IPsec or X.509 uses MD2 anymore, so there really is no
reason to still support it (unlike MD4 that is used in EAP-MSCHAPv2,
MD5 that's used in EAP-MD5, or SHA-1 that's used for e.g. NAT-D hashes).

It caused test vectors to fail on systems where OpenSSL is built with
MD2 support but has it disabled at runtime.
2025-09-23 15:59:35 +02:00
Tobias Brunner d8a1747fa1 libimcv: Add Debian 13 (trixie) to database 2025-09-18 11:13:32 +02:00
Tobias Brunner 0e768233f2 leak-detective: Include OpenSSL symbol seen on Debian trixie 2025-09-18 11:13:32 +02:00
Tobias Brunner ac0272cad1 host: Don't try to resolve %any* keywords with mismatched address family
While host_create_from_string_and_family() usually replaces %any*
keywords, this fails if the address family doesn't match (e.g. %any4 with
AF_INET6).  There is no point in trying to resolve these keywords via
DNS as % is no valid character for host names.

Closes strongswan/strongswan#2880
2025-09-16 10:14:26 +02:00
Tobias Brunner 45f5a7a698 curl: Fix types enforced by compiler check in newer libcurl headers 2025-09-15 16:51:42 +02:00
Tobias Brunner c4b32aab04 plugin-loader: Check version of loaded plugins
This prevents loading plugins from older builds that can cause all sorts
of issues as they might access struct members in different locations.

We don't check the version for statically linked plugins.
2025-08-22 15:32:39 +02:00
Tobias Brunner 5cab5672e7 Define plugin version in all existing plugins 2025-08-22 15:32:39 +02:00
Tobias Brunner d087c349b4 plugin: Add macro to define plugin version and constructor 2025-08-22 15:32:39 +02:00
Tobias Brunner 1b551a9bfd plugin-loader: Don't prevent dynamic linking in addition to static constructors
When built with static plugins and constructors, we might still want to
be able to load external plugins.

Fixes: d860c26e95 ("plugin-loader: Properly support compilation without dlopen()/dlsym() etc.")
2025-08-22 15:32:39 +02:00
Tobias Brunner e9fa338e23 pkcs11: Improve detection of already unwrapped CKA_EC_POINTs
If an uncompressed point is already unwrapped (incorrect but some tokens/
modules do this) and therefore still looks like an ASN.1 octet string,
there could be false positives with the previous checks that lead to
mangled points.

By ensuring that we unwrapped the complete ASN.1 chunk, we can already
reduce the false positive rate when the assumed length is smaller than
the chunk, which we previously accepted but isn't the case in correctly
encoded points.

And while we already checked that the first byte indicates a valid point
type/encoding, there could still be false positives.  We can avoid those
with some checks on the length of the unwrapped point.  In particular,
enforcing a multiple of 4/8 should fail for valid unwrapped points where
three bytes were removed in the process (ASN.1 tag and length, point
encoding).

Closes strongswan/strongswan#2872
2025-08-22 15:31:25 +02:00
Tobias Brunner abadd47736 charon-cmd: Cache shared secret under identities if available
We won't have identities for private key passwords, but we do for EAP
identities and they might get reused if redirected.
2025-08-22 15:27:00 +02:00
Tobias Brunner d662a69d9d ike-sa-manager: Avoid deadlock due to race condition during shutdown
If an entry is added while we wait for a checked out SA in flush() (e.g.
due to an action performed by that SA), new entries might get inserted
before the one we wait for.  If that was the first entry in the row, we
didn't correctly update the table and the new entries were basically lost
by overwriting the first entry in the row.  As the SA count was still
increased but the new entries couldn't get enumerated, the daemon wasn't
terminated properly but was stuck in the loop in flush().
2025-08-22 15:26:59 +02:00
Tobias Brunner 3e0123526f trap-manager: Migrate tracked IKE SA in case of redirect during IKE_AUTH 2025-08-22 15:26:59 +02:00
Tobias Brunner ee668ae91e controller: Migrate tracked IKE SA in case of redirect during IKE_AUTH 2025-08-22 15:26:59 +02:00
Tobias Brunner 3a9120373d ike-sa: Avoid reusing established IKE_SAs that got redirected
These will get terminated by the peer after a while.  So we don't want
to reuse them.
2025-08-22 15:26:59 +02:00
Tobias Brunner 2f0a0fef3d vici: Fix indentation for some add_kv() calls 2025-08-22 15:22:33 +02:00
Mathias Aerts a24dc2e9ad vici: Include configured local and remote ports in list-conns
Closes strongswan/strongswan#2869
2025-08-22 15:22:13 +02:00
Tobias Brunner 7b90dc93c0 libipsec: Run unit tests with TESTS_PLUGINS if specified 2025-08-22 12:11:11 +02:00