Commit Graph
19850 Commits
Author SHA1 Message Date
Arthur ChanandTobias Brunner 615e7ad9ab oss-fuzz: Add new fuzzer targeting libtls
Closes strongswan/strongswan#3004

Signed-off-by: Arthur Chan <[email protected]>
Co-authored-by: Tobias Brunner <[email protected]>
2026-05-29 15:30:42 +02:00
Tobias Brunner 5185b6f6e8 swanctl: Add option to only list a specific connection with --list-conns 2026-05-28 16:54:06 +02:00
Tobias Brunner 5b56e56e72 Merge branch 'vici-proposals'
Adds IKE and IPsec proposals to the `list-conn` VICI event.  Currently
not printed in `swanctl --list-conns` to keep the output compact (`--raw`
can be used to see the proposals).

Closes strongswan/strongswan#3067
2026-05-28 16:27:37 +02:00
Tobias Brunner b3ef007d28 vici: Return proposals in a more structured way
This allows clients to distinguish between algorithms of different
transform types more easily.  The names are similar to those used
when returning the algorithms of the selected proposal in list-sas (except
for `ke` instead of `dh` and `sn` instead of `esn` to reflect the
latest IETF/IANA changes).
2026-05-28 14:40:25 +02:00
Mathijs Smit c70ab88363 vici: Include proposals in connection listings
Signed-off-by: Mathijs Smit <[email protected]>
2026-05-28 14:40:25 +02:00
Tobias Brunner eb9e44f783 ike-cfg: Add flag to suppress log message when retrieving proposals 2026-05-28 14:40:25 +02:00
Tobias Brunner 60adb95f58 child-cfg: Add flag to suppress log message when retrieving proposals 2026-05-28 14:40:25 +02:00
Tobias Brunner bff405c349 oid: Fix confusing identifiers for elliptic curves over prime fields
SECT (indicating a binary field) was incorrectly used in constants for
the SECP (prime field) curves.
2026-05-28 13:30:07 +02:00
Tobias Brunner 5fcf1fc0ef public-key: Fix mapping of RSA with PKCS#1 v1.5 and SHA3-512 to OID
Fixes: 40f2589abf ("gmp: Support of SHA-3 RSA signatures")
2026-05-28 13:21:22 +02:00
Tobias Brunner 172c2a39d2 configure: Fix check for option that indicates if plugins are packaged separately
The option was renamed with 7f9f9bd375 ("Fixed some typos, courtesy of
codespell"), the check was not.

Fixes: dd7b0283ef ("plugin-loader: Add option to change log message if plugin is not found")
2026-05-28 12:34:12 +02:00
Tobias Brunner 96627b4af5 github: Fix typo when enabling curve25519 plugin for gcrypt tests
Doesn't make a difference as the configure script also accepts the option
with a single dash.
2026-05-28 12:33:24 +02:00
Tobias Brunner 6f99862da8 github: Move permissions to the individual jobs
SonarQube complains about workflow-level "allow" permissions.
2026-05-27 13:31:51 +02:00
Tobias Brunner 5a2ed87945 github: Increase the time CIFuzz is running the fuzzers
Several new fuzzers were added since this workflow was created (in
particular due to the plugin split).
2026-05-27 12:38:27 +02:00
Arthur Chan 50fc4c24a6 fuzz: Add fuzzer targeting RADIUS messages
Closes strongswan/strongswan#3027

Signed-off-by: Arthur Chan <[email protected]>
2026-05-27 12:36:26 +02:00
Arthur Chan a5bcaa70ed fuzz: Add fuzzer targeting VICI messages
Closes strongswan/strongswan#3026

Signed-off-by: Arthur Chan <[email protected]>
2026-05-27 12:32:40 +02:00
Tobias Brunner a76bd171f8 github: Add a note regarding vulnerability reports to issue template
Also updated the version numbers in the template.
2026-05-22 14:33:28 +02:00
Tobias Brunner dc8b479eb8 ike-init: Fix key derivation if SA is reset after IKE_INTERMEDIATE retransmits
Because the `derived` flag was not reset (it's set after the initial
IKE_SA_INIT exchange), no keys would get derived when sending
IKE_INTERMEDIATE during the next try.  As there is then no `aead_t`
available, encrypting the message would fail and the initiation would
remain stuck.

Fixes: 0d49ddec2e ("ike-init: Add support for multiple key exchanges")
2026-05-22 14:33:28 +02:00
Tobias Brunner 18a94525a7 Revert "testing: Ignore unknown memory in leak detective"
This reverts commit b998695344.

Seems like this is not necessary anymore.  Possibly because of
8ff3238027 ("openssl: Prevent OpenSSL from using posix_memalign() if
LD is enabled").
2026-05-22 14:33:28 +02:00
Thomas Jarosch f0a489f7e2 credential-manager: Check certificate expiry also for trusted self-signed certs
This serves as a defense-in-depth measure against forgotten
configs/credentials.
2026-05-22 14:33:28 +02:00
Thomas Jarosch 0d17838b99 credential-manager: Check expiry also for last cert in incomplete trust chain
While the validity of a pre-trusted certificate for which an issuer is
found is enforced via `check_certificate()`, the validity of such a
certificate in an incomplete trust chain, or rather that of the last
certificate in such a chain, was not enforced.  This fixes that
inconsistency.
2026-05-22 14:33:28 +02:00
Tobias Brunner 95f615a603 unit-tests: Replace expired self-signed TLS certificates 2026-05-22 14:33:28 +02:00
Tobias Brunner 9ac3db8e63 swid-gen: Use process_t to avoid potential command injection
In a targeted request, the software ID is provided by the IMV.  If no
database is used (which is not the recommended setup), the ID is not
validated and could potentially contain special characters.  With the
previous command string construction and use of popen(), which runs a
shell, that could potentially allow running arbitrary commands.
2026-05-19 17:27:33 +02:00
Tobias Brunner ac703e48c3 ike-init: Destroy KE object after each derivation during initial exchanges
This fixes error handling in build_r_multi_ke() so we don't incorrectly
reuse the object from the previous exchange if we don't receive a KE
payload.
2026-05-19 17:27:33 +02:00
Tobias Brunner 158b4c4aa4 child-rekey: Avoid potential use-after-free for deleted SPIs array 2026-05-19 17:27:33 +02:00
Tobias Brunner ea569867d2 tun-device: Fix setting IPv6 address on Linux
Unlike `struct ifreq` that's used for IPv4, `struct in6_ifreq` contains
not a `struct sockaddr[_in6]` but only a `struct in6_addr`.

Setting addresses like this is currently not used on Linux (the feature
was added to install virtual IPs on FreeBSD/macOS).

Fixes: fccc76449d ("tun-device: Fix handling of IPv6 addresses")
2026-05-19 17:27:33 +02:00
Tobias Brunner 7bdd4bf77b swanctl: Make sure options array passed to getopt_long() ends with a NULL entry 2026-05-19 17:27:33 +02:00
Tobias Brunner a1ad9e39fc pki: Make sure options array passed to getopt_long() ends with a NULL entry 2026-05-19 17:27:33 +02:00
Tobias Brunner 4950a37e56 pts: Fix error string if mandatory DH group is unavailable
Fixes: 0841280cdd ("libimcv: Fix build with DEBUG_LEVEL < 3")
2026-05-19 17:27:33 +02:00
Tobias Brunner 3b224a70ba xof: Fix mapping for SHA3-512 to a corresponding MGF1 identifier
Fixes: 3b7c49bc31 ("mgf1: Support of RSA PSS with SHA3 hash")
2026-05-19 17:27:33 +02:00
Tobias Brunner a26dd3da33 openssl: Check that EC keys don't have explicit params for internally loaded keys
Keys loaded via generic loader (KEY_ANY) or from a PKCS#12 file (or an
engine) don't go through the openssl_ec_private_key_load() constructor
that checks for explicit parameters.
2026-05-19 17:27:33 +02:00
Tobias Brunner ab19f691c7 botan: Fix registration of ECDSA signature/verification plugin features
This was broken since the Botan 3 release, which removed the EMSA1
class and the define.  The "EMSA1()" wrapper when signing/verifying is
technically not necessary anymore since then (it's deprecated but still
accepted).  But to still support Botan 2, we keep that in for now.
2026-05-19 17:27:33 +02:00
Tobias Brunner 15879eaddd github: Use AWS-LC 1.73.0 for tests 2026-05-19 17:27:33 +02:00
Tobias Brunner 7e7629499f receiver: Avoid unaligned memory access in COOKIE verification
This access could be an issue on platforms with strict alignment
requirements.
2026-05-19 17:27:33 +02:00
Tobias Brunner 8f22345542 dhcp: Fix potential OOB read when parsing DHCP messages
The missing parentheses around the additions when calculating optlen
in the previous code can cause an out-of-bound read of up to 228 bytes
if no DHCP_OPTEND is found in the message (the calculation basically
evaluated to `- 20 + 8 + 240`).

Since the buffer for the received packet (via pf_handler_t) is located
on the stack, this shouldn't cause much of an issue in practice.
2026-05-19 17:27:33 +02:00
Tobias Brunner 7faf93b701 github: Evict old entries from ccache
We don't want to build old versions using these caches, so we don't
need old entries (if header files change, there could be lots of
differences that increase the cache size unnecessarily).
2026-05-19 17:24:22 +02:00
Tobias Brunner 3b902ea59b github: Use separate caches for custom-built dependencies
These are shared by many tests, in particular the "all", "coverage",
"no-dbg" and "no-testable-ke" tests, which each would otherwise require
their own large cache.

Similarly, the "codeql" and "sonarcloud" tests rely on the same
dependencies but only the latter uses ccache for the strongSwan build.

Also reduce the maximum size per cache for all workflows to keep them
in check over time (some could even be set lower, we'll have to see
how this develops).
2026-05-12 16:34:22 +02:00
Tobias Brunner 821ba89961 github: Remove most builds with leak detective
As mentioned in the previous commit, ASAN does a fine job detecting leaks
during the tests.  We just add a single LD-enabled build of the "default"
test here to test the basic functionality.
And we continue to use leak detective in our testing environment to keep
the memory requirements low.

We don't need a separate cache for the "apidoc" test and while the
"dist" test is similar as well, it builds in a different directory,
which means that config.h causes a cache miss for everything but the
configure checks.
2026-05-12 08:37:40 +02:00
Tobias Brunner afe51f19e7 github: Always build OpenSSL with SRP support
The special handling caused a significant diff between builds with and
without LD, which made ccache less effective as we only store the cache
once for the build without LD.

However, despite this change, while it previously was the case that the
LD vs. non-LD builds didn't differ much, that's not the case anymore
nowadays.  In particular the --disable-asan option and the BFD-based
backtraces for the native OpenSSL builds (e.g. default or openssl-sys)
cause quite a significant diff.  As cache storage is limited, we keep
the current behavior for now.  But it might be an option to reduce or
even remove the LD builds in the future as ASAN seems do the job pretty
well and we still use LD in the testing environment.
2026-05-11 19:11:09 +02:00
Tobias Brunner a4b7d57c79 github: Only store a cache for large custom-built crypto libs
The others are either included already in the "all" build (to which we
now switch) or they have a relatively small diff to that (e.g. gcrypt
only differs in that relatively small plugin).  For the "openssl-sys"
build, we can rely on the "default" build but only on ubuntu-latest as
we don't build that on ubuntu-22.04.
2026-05-11 19:11:09 +02:00
Tobias Brunner 134b942494 github: Disable TRAP caching for CodeQL workflow
This creates a cache entry of ~590 MB whenever master is built.  Not sure
if it actually provides any speed up.
2026-05-08 15:48:06 +02:00
Tobias Brunner c85901e2f2 github: Fix ref in cache cleanup workflow 2026-05-08 15:30:13 +02:00
Tobias Brunner 9c140dd45c github: Add workflow to remove cache entries once a branch is deleted 2026-05-08 14:45:25 +02:00
Tobias Brunner daa0b109da github: Only store (and delete) caches for branches not PRs 2026-05-08 14:42:30 +02:00
Tobias Brunner 93cf3de1fc Use Botan 3.12.0 for tests 2026-05-08 12:00:15 +02:00
Tobias Brunner 77cc45dc6f github: Simplify the CodeQL workflow
It doesn't look like ccache will be supported anytime soon.  So just
remove all that unnecessary boilerplate.
2026-05-08 12:00:04 +02:00
Tobias Brunner 9854392a1f github: Don't restore just any cache for the Linux tests
If e.g. an "all" cache is restored for a "default", "apidoc" or a simple
crypto test, the cache will be a lot larger than necessary.
2026-05-07 18:01:30 +02:00
Tobias Brunner e4a15e5518 github: Let diff report if the active transforms are identical
Since the check is skipped if no reference file is found, this makes it
clear that files were actually compared.
2026-05-07 11:22:55 +02:00
Tobias Brunner 3a44941d2c github: Remove commit ID from cache keys and manually evict old entries
Let's try this again :)  Since cache entries with the same key are not
updated/replaced and there is no option to do so, we manually delete the
previous entry for the current branch.

This reduces the cache storage for active branches, which can cause
caches of the master branch to get evicted, which in turn will slow down
builds of not only master but also new branches as they can't fall back
on those caches.

Permission has to be explicitly granted in order to delete the cache
entries when not using the legacy all-write tokens that are the default
for old repositories.

The continue-on-error option is set for the step that deletes the old
cache entry as it's expected that cache-hit will be true for a new feature
branch when restoring the cache from the master branch.  However, because
there won't be anything to delete for this branch yet, the command will
fail.  The --succeed-on-no-caches option of the command unfortunately
only works with --all.

For the Linux tests, several jobs use the same cache key.  So there is
a chance that two jobs try to store a new entry concurrently, which will
fail (it works if there was a cache hit and they are slightly off as
previous entries are first deleted).  To avoid that, we store the cache
only for one particular config.

Also made sure that the "openssl" test does not remove "openssl-3/4"
caches by adding a suffix to the former.

For alpine, the repository had to be set explicitly as gh wasn't able to
determine it (didn't detect the Git working dir).
2026-05-07 10:52:08 +02:00
Tobias Brunner 94443ebad1 github: Disable fail-fast strategy instead of using continue-on-error
While continue-on-error can be configured more specifically (e.g. also
would allow to handle "default" and "printf-builtin" tests that rely
on debug symbols), it also lets the workflow succeed if any of these
jobs fail.  That's not ideal if there is an actual error and not
just an intermittent package sync problem.
2026-05-06 17:43:46 +02:00
Tobias Brunner 4acf09644c github: Add build against OpenSSL 4.0.0 2026-05-06 10:46:43 +02:00