Commit Graph
19597 Commits
Author SHA1 Message Date
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 b1275f26a6 github: Use latest SonarQube action
Updating this although the fixed security issue only affects Windows
builds.
2025-09-26 15:34:28 +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
Andreas Steffen 2b13873c0f Version bump to 6.0.3dr1 2025-09-22 18:57:54 +02:00
Tobias Brunner 7af0caeee1 Merge branch 'testing-trixie'
Use Debian trixie as base image for testing.
2025-09-18 11:27:38 +02:00
Tobias Brunner 1043fa32de testing: Add delay after qemu-nbd -c
Seems that there is a delay before the disk can be used when using newer
QEMU versions (e.g. on Debian trixie). We get errors like these:

  sfdisk: cannot open /dev/nbd0: Inappropriate ioctl for device

or

  mount: /srv/strongswan-testing/build/loop: special device /dev/nbd0p1 does not exist.

A sleep before the next command seems to help.

Also see [1].

[1] https://gitlab.com/qemu-project/qemu/-/issues/1413
2025-09-18 11:13:32 +02:00
Tobias Brunner e9ebe49d44 testing: Add option to run tests without leak detective
This new option allows to disable leak detective to reduce the runtime
during development.  Either only for the command line (swanctl, pki etc.)
or optionally also for the daemon(s).

Disabling leak detective only for the CLI tools already brings a
considerable reduction in runtime (from 48m to 38m on my dev host) as
there are many such calls in the post-test stage.  Any leaks in those
tools are also a lot less of an issue than leaks in the daemon.  So using
this during development should be fine as long as a full test run is done
regularly (in particular before releases).  Disabling leak detective
completely further reduces the runtime (to 30m on my dev host). But that
should probably only be used for functional regression tests after
verifying new code didn't introduce new leaks.

This also fixes the service script which is used for charon-tkm since
16fcdb460a ("charon-tkm: Don't use starter/stroke with charon-tkm anymore").
2025-09-18 11:13:32 +02:00
Tobias Brunner 906205b7ee testing: Use Debian trixie to test TKM 2025-09-18 11:13:32 +02:00
Tobias Brunner a0a5bd7669 testing: Use Debian trixie 2025-09-18 11:13:32 +02:00
Tobias Brunner f3cc9bec18 testing: Use proper directory for slapd PID files 2025-09-18 11:13:32 +02:00
Tobias Brunner d8a1747fa1 libimcv: Add Debian 13 (trixie) to database 2025-09-18 11:13:32 +02:00
Tobias Brunner 3aa7e1d418 testing: Increase memory for guest hosts to run Debian trixie
While some increase was necessary anyway because the idle system requires
about 5-10 MiB more memory, the main issue is resolving the code line and
function name in case of a memory leak.  Calling addr2line requires a lot
more memory than before.  Using backtraces via libbfd doesn't help either
because the trigger is the bfd_find_nearest_line() call we use as well.
And because we'd try to resolve all symbols that way (for whitelisting),
the memory overhead would be even higher and affect every shutdown, even
if no leak occurred.  It also causes a significant time overhead (running
all tests took 75m instead of 48m).

I also tested switching to ASAN/LSAN.  The peak memory usage is slightly
higher than when using libbfd, but enabling it also increased the runtime
overhead a lot (the daemon and swanctl both required about 10-20 MiB more
memory, not just during the shutdown).
2025-09-18 11:13:32 +02:00
Tobias Brunner 1767ba2a13 testing: Add support for Debian trixie base images 2025-09-18 11:13:32 +02:00
Tobias Brunner 518b8e4286 testing: Use pipx to install swidGenerator on Debian trixie
We could use the same approach on bookworm (if the base image is updated),
but just use the old approach there for now.
2025-09-18 11:13:32 +02:00
Tobias Brunner fa1cd74712 testing: Install required packages in venv of updated strongTNC
Update revision for some dependency updates.  While python3-setuptools is
installed on the system, the venv apparently can't use it.  legacy-cgi is
required to use that old Django version with newer Python releases.
2025-09-18 11:13:32 +02:00
Tobias Brunner ecc2e35713 testing: Update TKM RPC to be compatible with newer compilers 2025-09-18 11:13:32 +02:00
Tobias Brunner b4a51f1719 testing: Use newer version of TKM on trixie
The API for libgmpada has change with 1.6 in a way that's not
backwards-compatible.  So we use a different revision that includes
the required changes depending on the Debian version.

This also adds support for esa_select(), to support seamless rekeyings,
which requires updating xfrm-ada as well.
2025-09-18 11:13:32 +02:00
Tobias Brunner ddeb3c463e testing: Run commands in chroot in a login shell
Similar to the previous commit, this ensures we have the same environment
we do later on the system.
2025-09-18 11:13:32 +02:00
Tobias Brunner 870aa75eed testing: Start a login shell in chroot script
This ensures we have the same environment (e.g. stuff from /etc/profile.d)
as when logging in via SSH later.
2025-09-18 11:13:32 +02:00
Tobias Brunner b998695344 testing: Ignore unknown memory in leak detective
This is set in two locations for systemd services and login shells. The
memory is freed by OPENSSL_cleanup().
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 a9e3db6b79 testing: Pass base image codename to application Makefiles
Some might require it to use different revisions or commands.
2025-09-18 11:13:32 +02:00
Tobias Brunner b51731e197 testing: Mount /proc in the chroot to make systemctl happy 2025-09-18 11:13:27 +02:00
Tobias Brunner a418666f59 testing: Use new recommended approach to install key for custom apt repository
apt-key add is deprecated (and not available in trixie) as it makes the
available for all sources.  The recommended approach makes the key very
specifically available for just our repository.
2025-09-18 11:12:22 +02:00
Tobias Brunner 2025f630df testing: Remove unnecessary workaround for DHCP 2025-09-18 11:12:22 +02:00
Tobias Brunner acaf4b2d17 testing: Move sysctl settings to sysctl.d and add some memory settings
Debian trixie doesn't provide a 99-sysctl.conf symlink in that directory
anymore.  The memory settings are also useful there as the default of
one changed and overbooking helps when forking a process with large
memory footprint (e.g. the IKE daemon).
2025-09-18 11:12:22 +02:00
Tobias Brunner 5e85ce17a2 testing: Remove xconsole config for rsyslogd
This produces a warning and we don't have X.
2025-09-18 11:12:22 +02:00
Tobias Brunner 2eef6b242b github: Use AWS-LC 1.61.1 for tests 2025-09-18 08:29:39 +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 e33dddffea github: Use latest SonarQube action 2025-09-15 17:46:03 +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 cfb5e46a98 Merge branch 'plugin-versions'
This adds a symbol with the current version number to all existing
plugins (the PLUGIN_DEFINE() macro makes this easy).  The version is
checked when a plugin is loaded from a file in order to prevent loading
old plugins from any previous build, which could cause all sorts of
issues.

References strongswan/strongswan#2835
2025-08-22 16:49:31 +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 b36da850b5 github: Only run CI for latest commit in a branch, cancel old runs 2025-08-22 12:21:50 +02:00
Tobias Brunner 7b90dc93c0 libipsec: Run unit tests with TESTS_PLUGINS if specified 2025-08-22 12:11:11 +02:00
Tobias Brunner 9da68ec9f5 libtls: Fix double-free when enumerating private keys 2025-08-22 12:07:55 +02:00