]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
9 months agoMerge branch 'android-14' android-2.5.2
Tobias Brunner [Tue, 6 Aug 2024 16:02:18 +0000 (18:02 +0200)] 
Merge branch 'android-14'

Updates target SDK to Android 14 (34) and fixes compatibility issues.

9 months agoandroid: New release after updating target SDK and fixing some compatibility issues
Tobias Brunner [Mon, 5 Aug 2024 12:52:30 +0000 (14:52 +0200)] 
android: New release after updating target SDK and fixing some compatibility issues

9 months agoandroid: Increase targetSdkVersion to 34 (Android 14)
Tobias Brunner [Mon, 5 Aug 2024 12:31:32 +0000 (14:31 +0200)] 
android: Increase targetSdkVersion to 34 (Android 14)

9 months agoandroid: Avoid using deprecated ViewCompat methods
Tobias Brunner [Mon, 5 Aug 2024 12:16:51 +0000 (14:16 +0200)] 
android: Avoid using deprecated ViewCompat methods

9 months agoandroid: Replace deprecated Observer/Observable with PropertyChangeListener etc.
Tobias Brunner [Mon, 5 Aug 2024 09:51:40 +0000 (11:51 +0200)] 
android: Replace deprecated Observer/Observable with PropertyChangeListener etc.

Kinda misusing the interface as there is no specific property, but
otherwise seems like a 1:1 replacement.

9 months agoandroid: Add workaround for a bug preventing background service starts from TileService
Tobias Brunner [Mon, 5 Aug 2024 09:02:49 +0000 (11:02 +0200)] 
android: Add workaround for a bug preventing background service starts from TileService

When targeting Android 14, we get a "Background activity launch blocked!"
exception when trying to start the connection in the background (closing
the drawer works).  Which is apparently a bug:

  https://issuetracker.google.com/issues/305035828

The workaround here is kinda ugly.  In particular, because it's not
possible anymore since a few versions to open a dialog that allows users
to directly grant the required permission to the app.  We can only open
the generic settings dialog where users have to search for the app and
grant the permission themselves (we could add a dialog with an explanation
similar to the one for the power whitelist if necessary).  Hopefully this
gets fixed at some point (the current beta of Android 15 still has the
same bug, though).

9 months agoandroid: Use PendingIntent-version of startActivityAndCollapse()
Tobias Brunner [Mon, 5 Aug 2024 08:47:10 +0000 (10:47 +0200)] 
android: Use PendingIntent-version of startActivityAndCollapse()

The other version has been deprecated and throws an exception when
targeting Android 14+.

9 months agoandroid: Explicitly mark receiver as not exported during registration
Tobias Brunner [Mon, 5 Aug 2024 08:35:05 +0000 (10:35 +0200)] 
android: Explicitly mark receiver as not exported during registration

9 months agoandroid: Declare foreground service type for VpnService instance
Tobias Brunner [Tue, 30 Jul 2024 13:18:22 +0000 (15:18 +0200)] 
android: Declare foreground service type for VpnService instance

Required for Android 14 (34).  Since no other type fits we use specialUse,
which also requires a new permission and a description for why we use it.

9 months agoandroid: Fix label for name field in managed profiles
Tobias Brunner [Mon, 5 Aug 2024 12:39:17 +0000 (14:39 +0200)] 
android: Fix label for name field in managed profiles

The field is not actually optional.

9 months agoandroid: Fix crash when opening list of apps for new profiles
Tobias Brunner [Mon, 5 Aug 2024 09:16:39 +0000 (11:16 +0200)] 
android: Fix crash when opening list of apps for new profiles

Fixes: 150dc5ab6401 ("android: Make selected apps read-only")
9 months agoandroid: Update dependencies
Tobias Brunner [Tue, 16 Jul 2024 14:36:36 +0000 (16:36 +0200)] 
android: Update dependencies

9 months agoandroid: Update Gradle plugin
Tobias Brunner [Tue, 16 Jul 2024 08:59:06 +0000 (10:59 +0200)] 
android: Update Gradle plugin

9 months agoinit: Add `Wants=` dependencies to systemd units
Matteo Carnelos [Thu, 6 Jun 2024 13:54:11 +0000 (15:54 +0200)] 
init: Add `Wants=` dependencies to systemd units

If no other units have dependencies on network-online.target or
syslog.target they might not get initialized resulting in a possibly
non-ideal startup order.

Closes strongswan/strongswan#2279

9 months agoike-auth: Default IDi/IDr to subject DN instead of IP if a certificate is available
Tobias Brunner [Wed, 17 Jul 2024 13:31:51 +0000 (15:31 +0200)] 
ike-auth: Default IDi/IDr to subject DN instead of IP if a certificate is available

This avoids sending a likely unconfirmed identity if no identity is
configured and received (in case of IDr).

Closes strongswan/strongswan#2353

9 months agoike-sa: Assign function pointers for mediation extension separately
Tobias Brunner [Fri, 26 Jul 2024 16:07:23 +0000 (18:07 +0200)] 
ike-sa: Assign function pointers for mediation extension separately

Using preprocessor directives in calls of function-like macros is
not recommended as it might lead to undefined behavior.

9 months agoMerge branch 'vici-reload-actions'
Tobias Brunner [Tue, 30 Jul 2024 08:26:21 +0000 (10:26 +0200)] 
Merge branch 'vici-reload-actions'

This improves the behavior when reloading or unloading connections that
have `start` included in their `start_actiton`.

Closes strongswan/strongswan#2324

9 months agotesting: Add ikev2/start-action-start scenario
Tobias Brunner [Fri, 26 Jul 2024 14:56:32 +0000 (16:56 +0200)] 
testing: Add ikev2/start-action-start scenario

This tests the behavior for configs with start_action=start during
reloads of the config (updates/removal).

9 months agovici: Improve handling of start action when reloading configs
Tobias Brunner [Thu, 4 Jul 2024 14:17:43 +0000 (16:17 +0200)] 
vici: Improve handling of start action when reloading configs

The previous code had some issues because it handled each child config
separately.  Not only was this quite inefficient because all IKE_SAs had
to be enumerated for every config, it also caused problems with the check
for other CHILD_SAs in order to decide whether to delete the IKE_SA or
not.  Because CHILD_SAs are deleted with an INFORMATIONAL exchange, they
are not immediately gone.  This caused a race condition and with more
than one child config and SAs the IKE_SA could be kept because it
could appear as if other, unrelated CHILD_SAs were still there.

Another race condition, which is fixed by the previous commit, occurred
when only changing child configs.  Then it could happen that the code
deemed the IKE_SA empty and a delete for it was queued.  If that happened
while the IKE_SA was deleting one of the CHILD_SAs (or was busy with some
other exchange), the IKE_SA was not switched to IKE_DELETING.  So it
looked usable and create-child tasks for the updated configs might have
gotten queued.  Unfortunately, once the ike-delete task is eventually
executed, these tasks would be gone and the replacement CHILD_SAs never
created.  This commit additionally avoids actually deleting the IKE_SA
even if all child configs change or get removed if any new CHILD_SAs are
to be initiated.

9 months agoike-sa-manager: Avoid initiating CHILD_SAs on IKE_SAs with queued DELETE
Tobias Brunner [Thu, 4 Jul 2024 12:43:37 +0000 (14:43 +0200)] 
ike-sa-manager: Avoid initiating CHILD_SAs on IKE_SAs with queued DELETE

The IKE_SA might be busy with a different task while a request to
terminate it is getting queued, we don't want to use such an IKE_SA to
initiate new CHILD_SAs as these tasks will get lost once the IKE_SA is
terminated.

9 months agotesting: Enable IPv6 guest-to-guest communication
Tobias Brunner [Thu, 4 Jul 2024 16:23:03 +0000 (18:23 +0200)] 
testing: Enable IPv6 guest-to-guest communication

Not sure what changed, but without this setting, ND packets would not
get through to other hosts connected to the same bridge.

9 months agounit-tests: Fix compiler warning with empty message assertion
Tobias Brunner [Mon, 15 Jul 2024 14:55:29 +0000 (16:55 +0200)] 
unit-tests: Fix compiler warning with empty message assertion

The empty array of rules for `assert_message_empty()` and the resulting
size 0 triggers warnings like these:

  allocation of insufficient size '0' for type 'listener_message_rule_t' with size '12'

Using calloc() with `nmemb` set to 0 triggers the same warning.

9 months agodaemon: Use correct argument order for calloc() to fix compiler warning
Tobias Brunner [Fri, 12 Jul 2024 12:00:15 +0000 (14:00 +0200)] 
daemon: Use correct argument order for calloc() to fix compiler warning

The number of elements is the first argument, their size the second.
The previous code triggered the following warning:

  'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument

9 months agobacktrace: Fix compiler warning on Windows
Tobias Brunner [Fri, 12 Jul 2024 08:24:35 +0000 (10:24 +0200)] 
backtrace: Fix compiler warning on Windows

This change avoids a "variable 'got' might be clobbered by 'longjmp' or
'vfork'" warning with -Wextra.

9 months agoUse wolfSSL 5.7.2 for tests
Tobias Brunner [Thu, 11 Jul 2024 13:57:12 +0000 (15:57 +0200)] 
Use wolfSSL 5.7.2 for tests

10 months agotesting: Enable mgf1 plugin for scenarios where FreeRADIUS uses PSS signatures
Tobias Brunner [Wed, 26 Jun 2024 12:49:34 +0000 (14:49 +0200)] 
testing: Enable mgf1 plugin for scenarios where FreeRADIUS uses PSS signatures

Looks like a cipher suite without DHE was selected previously.

Could be a side-effect of dc1085734f34 ("testing: Remove unnecessary
FreeRADIUS dh_file option as recommended in the log").

10 months agotesting: Fix IP pool scenarios after changing base address
Tobias Brunner [Wed, 26 Jun 2024 08:12:16 +0000 (10:12 +0200)] 
testing: Fix IP pool scenarios after changing base address

Fixes: 2b11764b705d ("mem-pool: Adjust the base address if it's the network ID")
10 months agotesting: Enable error code checks for load-testconfig
Maxim Uvarov [Mon, 24 Jun 2024 14:05:20 +0000 (17:05 +0300)] 
testing: Enable error code checks for load-testconfig

Errors in load-testconfig are hidden due to not checking scp
return code and mute all errors. Add -e to trap script on
any errors in this script.

References strongswan/strongswan#2310

Signed-off-by: Maxim Uvarov <muvarov@gmail.com>
10 months agotesting: Enable sftp subsystem in default sshd_config
Maxim Uvarov [Mon, 24 Jun 2024 13:51:51 +0000 (16:51 +0300)] 
testing: Enable sftp subsystem in default sshd_config

OpenSSH defaults have changed and scp stopped to work with newer versions.
There are 2 options to fix it, either use -O (legacy scp protocol)
with scp, or enable the sftp subsystem in the SSH server config.
This fix uses the second variant.

Closes strongswan/strongswan#2310

Signed-off-by: Maxim Uvarov <muvarov@gmail.com>
10 months agocirrus: Use FreeBSD 13.3 and 14.1
Tobias Brunner [Tue, 18 Jun 2024 14:25:08 +0000 (16:25 +0200)] 
cirrus: Use FreeBSD 13.3 and 14.1

10 months agoquick-mode: Get a reference when adopting the reqid of a rekeyed CHILD_SA
Tobias Brunner [Thu, 13 Jun 2024 13:51:46 +0000 (15:51 +0200)] 
quick-mode: Get a reference when adopting the reqid of a rekeyed CHILD_SA

10 months agomem-pool: Adjust the base address if it's the network ID
Tobias Brunner [Tue, 28 May 2024 07:41:29 +0000 (09:41 +0200)] 
mem-pool: Adjust the base address if it's the network ID

Instead of just adding the offset internally, this way the reported
base address is always the first assignable address (e.g. for
192.168.0.0/24 vs. 192.168.0.1/24).

Closes strongswan/strongswan#2264

10 months agotesting: Make RADIUS server enforce client identity in certificate's CN
Tobias Brunner [Thu, 16 May 2024 14:34:02 +0000 (16:34 +0200)] 
testing: Make RADIUS server enforce client identity in certificate's CN

10 months agotesting: Remove unnecessary FreeRADIUS dh_file option as recommended in the log
Tobias Brunner [Thu, 2 May 2024 14:00:53 +0000 (16:00 +0200)] 
testing: Remove unnecessary FreeRADIUS dh_file option as recommended in the log

10 months agocharon-nm: Use a different routing table than the regular IKE daemon
Tobias Brunner [Fri, 3 May 2024 13:31:27 +0000 (15:31 +0200)] 
charon-nm: Use a different routing table than the regular IKE daemon

If the regular daemon is running, it creates an unconditional routing
rule for the routing table.  The rule that charon-nm tries to create,
which excludes marked IKE/ESP traffic to avoid a routing loop, then
can't be installed and we'd end up with said loop.

Closes strongswan/strongswan#2230

11 months agocirrus: Explicitly install tpm2-tss-sys package on Alpine
Tobias Brunner [Mon, 27 May 2024 12:08:08 +0000 (14:08 +0200)] 
cirrus: Explicitly install tpm2-tss-sys package on Alpine

The libraries were previously shipped with the -dev package.

11 months agogithub: Use AWS-LC 1.28.0 for tests
Tobias Brunner [Mon, 27 May 2024 08:42:18 +0000 (10:42 +0200)] 
github: Use AWS-LC 1.28.0 for tests

11 months agox509: Encode challenge passwords as PrintableString if possible
Tobias Brunner [Tue, 30 Apr 2024 14:46:34 +0000 (16:46 +0200)] 
x509: Encode challenge passwords as PrintableString if possible

As recommended by RFC 2985, section 5.4.1:

  ChallengePassword attribute values generated in accordance with this
  version of this document SHOULD use the PrintableString encoding
  whenever possible.  If internationalization issues make this
  impossible, the UTF8String alternative SHOULD be used.

Even though the RFC continues with

  PKCS #9-attribute processing systems MUST be able to recognize and
  process all string types in DirectoryString values.

there might be older SCEP server implementations that don't accept
UTF8String-encoded passwords.  In particular because previous versions of
PKCS#9 defined this attribute's type as a CHOICE between PrintableString
and T61String.

References strongswan/strongswan#1831

11 months agostreams: Add ability to listen on any VSOCK CID
Tobias Brunner [Wed, 1 May 2024 12:50:16 +0000 (14:50 +0200)] 
streams: Add ability to listen on any VSOCK CID

Can be useful if the CID inside the VM is not known.

The \htmlonly\endhtmlonly hack is used to avoid compiler warnings due
to /* inside a block comment.

11 months agostreams: Add support for AF_VSOCK sockets on Linux
Thomas Egerer [Tue, 30 Apr 2024 12:20:57 +0000 (14:20 +0200)] 
streams: Add support for AF_VSOCK sockets on Linux

These allow, for instance, a vici client on a host to communicate with
an IKE daemon running in a VM.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
11 months agoike-cfg: Consider port information in IKE config match
Thomas Egerer [Fri, 12 Apr 2024 15:07:21 +0000 (15:07 +0000)] 
ike-cfg: Consider port information in IKE config match

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
12 months agogithub: Use tpm2-tss 3.2.3 for tests
Tobias Brunner [Mon, 29 Apr 2024 14:10:39 +0000 (16:10 +0200)] 
github: Use tpm2-tss 3.2.3 for tests

12 months agoconfigure: Enable counters plugin also if vici is enabled but stroke is disabled
Tobias Brunner [Thu, 18 Apr 2024 06:59:18 +0000 (08:59 +0200)] 
configure: Enable counters plugin also if vici is enabled but stroke is disabled

12 months agogitignore: Don't ignore proposal_keywords.c
Tobias Brunner [Mon, 15 Apr 2024 16:29:42 +0000 (18:29 +0200)] 
gitignore: Don't ignore proposal_keywords.c

If somebody copies our .gitignore and tries to import the source code,
the proposal_keywords.c file will not be added as it's ignored by the
`*keywords.c` pattern we use to ignore gperf-generated source files.

Closes strongswan/strongswan#2014

12 months agomem-pool: Reject the creation of unintentionally empty pools
Tobias Brunner [Fri, 12 Apr 2024 12:14:11 +0000 (14:14 +0200)] 
mem-pool: Reject the creation of unintentionally empty pools

If a base address is configured, we don't expect the pool to be empty,
so reject the creation (e.g. with the broadcast address as base).

References strongswan/strongswan#2205

12 months agoswanctl: Document possibility of non-zero base addresses for in-memory pools
Tobias Brunner [Fri, 12 Apr 2024 12:01:23 +0000 (14:01 +0200)] 
swanctl: Document possibility of non-zero base addresses for in-memory pools

References strongswan/strongswan#2205

12 months agoUse AWS-LC 1.24.0 for tests
Tobias Brunner [Fri, 12 Apr 2024 12:59:32 +0000 (14:59 +0200)] 
Use AWS-LC 1.24.0 for tests

13 months agogithub: Don't search for coverage results
Tobias Brunner [Thu, 4 Apr 2024 12:14:29 +0000 (14:14 +0200)] 
github: Don't search for coverage results

We explicitly pass the final .info file prepared with lcov, so there is
no need to search for other files (that then won't work anyway).  The
search also finds the uncleaned .info file, which includes the test code.

The latter should have gotten ignored anyway, but the patterns are
apparently not correct anymore. So fixing that as well just to be sure.

13 months agogithub: Update coverage data upload to Codecov
Tobias Brunner [Tue, 27 Feb 2024 10:07:06 +0000 (11:07 +0100)] 
github: Update coverage data upload to Codecov

Since the script and action have issues with the directory structure, we
upload the lcov results instead.

13 months agoMerge branch 'openwrt-fixes'
Tobias Brunner [Wed, 3 Apr 2024 09:28:24 +0000 (11:28 +0200)] 
Merge branch 'openwrt-fixes'

Closes strongswan/strongswan#2185

13 months agowolfssl: Avoid conflict with RNG when built without EdDSA or FIPS enabled
Philip Prindeville [Wed, 27 Mar 2024 23:41:18 +0000 (17:41 -0600)] 
wolfssl: Avoid conflict with RNG when built without EdDSA or FIPS enabled

There are definitions of RNG in <wolfssl/wolfcrypt/settings.h> and
<wolfssl/wolfcrypt/random.h> that play havoc with the literal RNG being
used in the expansions of PLUGIN_*(RNG, ...) when ##-concatenated to
build the enum value FEATURE_RNG.

The #undef in wolfssl_cmmon.h only had an effect if wolfSSL was built
with EdDSA or FIPS enabled, otherwise, the headers that define RNG were
not pulled in before it.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
13 months agouci: Upstream patch to adapt to option datatype abstraction
Noel Kuntze [Mon, 25 Mar 2024 17:22:30 +0000 (11:22 -0600)] 
uci: Upstream patch to adapt to option datatype abstraction

This is a patch from the OpenWrt package sources necessary to adapt to
changes from 2008 that abstracted the option datatype (added a list
type).

Signed-off-by: Noel Kuntze <noel.kuntze@thermi.consulting>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
13 months agocirrus: Add build on Alpine Linux with musl C library
Tobias Brunner [Wed, 27 Mar 2024 09:48:48 +0000 (10:48 +0100)] 
cirrus: Add build on Alpine Linux with musl C library

13 months agosha3: Fix Keccak when compiled with GCC 13.x
Tobias Brunner [Thu, 28 Mar 2024 10:51:15 +0000 (11:51 +0100)] 
sha3: Fix Keccak when compiled with GCC 13.x

With GCC 13, the compiler apparently applies new aliasing optimizations
when compiled with -O2 and without -fno-strict-aliasing.  This caused
the application of the second padding bit, where the state was accessed
via uint8_t[], to be moved before the loop that absorbs the buffer into
the state, where the state is accessed via uint64_t[], resulting in
incorrect output.  By only accessing the state via uint64_t[] here the
compiler won't reorder the instructions.

13 months agounit-tests: Adhere to TESTS_NO_IPV6 in HTTP fetcher test suite
Tobias Brunner [Thu, 28 Mar 2024 06:46:17 +0000 (07:46 +0100)] 
unit-tests: Adhere to TESTS_NO_IPV6 in HTTP fetcher test suite

13 months agobliss: Fix build with built-in printf-specifiers
Tobias Brunner [Wed, 27 Mar 2024 15:26:48 +0000 (16:26 +0100)] 
bliss: Fix build with built-in printf-specifiers

This won't work for monolithic builds because the plugin and the
executable are built before libstrongswan.

13 months agoUse wolfSSL 5.7.0 for tests
Tobias Brunner [Fri, 22 Mar 2024 10:43:39 +0000 (11:43 +0100)] 
Use wolfSSL 5.7.0 for tests

13 months agofarp: Fix build with musl C library
Tobias Brunner [Fri, 22 Mar 2024 09:42:34 +0000 (10:42 +0100)] 
farp: Fix build with musl C library

Same issue as described in the previous commit.

Fixes: 187c72d1afdc ("dhcp: Port the plugin to FreeBSD/macOS")
13 months agopf-handler: Fix build with musl C library
Tobias Brunner [Fri, 22 Mar 2024 08:57:07 +0000 (09:57 +0100)] 
pf-handler: Fix build with musl C library

musl's headers define a lot of networking structs.  For some, the
definition in the Linux UAPI headers is then suppressed by e.g.
__UAPI_DEF_ETHHDR.

Since we included musl's net/ethernet.h, which includes netinet/if_ether.h
that defines `struct ethhdr` (and the above constant), **after** we
include linux/if_ether.h, there was a compilation error because the
struct was defined multiple times.

However, simply moving that include doesn't fix the problem because for
ARP-specific structs the Linux headers don't provide __UAPI_DEF* checks.
So instead of directly including the linux/ headers, we include those
provided by the C library.  For glibc these usually just include the
Linux headers, but for musl this allows them to define the struct
directly.  We also need to move if.h and add packet.h, which define
other structs (or include headers that do so) that we use.

Fixes: 187c72d1afdc ("dhcp: Port the plugin to FreeBSD/macOS")
13 months agoike-sa-manager: Unlock mutex if allocating SPI fails to avoid lock contention
Thomas Egerer [Wed, 20 Mar 2024 10:11:17 +0000 (10:11 +0000)] 
ike-sa-manager: Unlock mutex if allocating SPI fails to avoid lock contention

Fixes: 5d91d8c46937 ("Check rng return value when generating SPIs in ike_sa_manager_t")
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
13 months agoVersion bump to 5.9.14 5.9.14
Andreas Steffen [Tue, 19 Mar 2024 10:56:44 +0000 (11:56 +0100)] 
Version bump to 5.9.14

13 months agogithub: Use AWS-LC 1.23.0 for tests
Tobias Brunner [Mon, 18 Mar 2024 07:01:18 +0000 (08:01 +0100)] 
github: Use AWS-LC 1.23.0 for tests

13 months agosave-keys: Fix Wireshark algorithm identifier for 3DES
Wataru Ashihara [Sat, 25 Nov 2023 10:32:20 +0000 (19:32 +0900)] 
save-keys: Fix Wireshark algorithm identifier for 3DES

Wireshark has shown the following error dialogue because the identifier
was incorrect [1]:

Error loading table 'ESP SAs': esp_sa:18: invalid value: TripleDes-CBC [RFC2451]

[1] https://github.com/wireshark/wireshark/blob/3757f42e5f0a8ee6b14a117a2fd99af759a31d98/epan/dissectors/packet-ipsec.c#L203

Closes strongswan/strongswan#2013

13 months agoike-cfg: Change how OCSP certificate requests are enabled
Tobias Brunner [Fri, 15 Mar 2024 13:40:30 +0000 (14:40 +0100)] 
ike-cfg: Change how OCSP certificate requests are enabled

The previous option caused such requests to be enabled if not explicitly
disabled, which only the vici plugin did, for all other backends requests
would have been sent.

References strongswan/strongswan#2016

13 months agopeer-cfg: Renumber ocsp_policy_t values so the same default applies for all backends
Tobias Brunner [Fri, 15 Mar 2024 13:37:53 +0000 (14:37 +0100)] 
peer-cfg: Renumber ocsp_policy_t values so the same default applies for all backends

Only the vici plugin previously set OCSP_SEND_REPLY explicitly, all other
backends would have defaulted to OCSP_SEND_BOTH.

References strongswan/strongswan#2016

13 months agokernel-pfroute: Log ignored interfaces when listing known interfaces
Tobias Brunner [Fri, 15 Mar 2024 12:47:23 +0000 (13:47 +0100)] 
kernel-pfroute: Log ignored interfaces when listing known interfaces

13 months agokernel-netlink: Log ignored interfaces when listing known interfaces
Tobias Brunner [Fri, 15 Mar 2024 12:45:08 +0000 (13:45 +0100)] 
kernel-netlink: Log ignored interfaces when listing known interfaces

13 months agoNEWS: Add news for 5.9.14
Tobias Brunner [Thu, 14 Mar 2024 16:06:08 +0000 (17:06 +0100)] 
NEWS: Add news for 5.9.14

13 months agopkcs11: Fix cleanup when verifying signature fails because scheme isn't supported
Tobias Brunner [Thu, 14 Mar 2024 12:56:21 +0000 (13:56 +0100)] 
pkcs11: Fix cleanup when verifying signature fails because scheme isn't supported

Fixes: 49769fff53f3 ("pkcs11: Support RSA-PSS signatures")
13 months agosmp: Make code that encodes identities more readable
Tobias Brunner [Thu, 14 Mar 2024 12:51:06 +0000 (13:51 +0100)] 
smp: Make code that encodes identities more readable

In particular for static code analyzers.  The previous nesting of case
statements inside of a while loop that's inside a switch statement and
a wrapping block with declaration was quite weird and Coverity didn't
like it (it figured that `type` was uninitialized even when it assumed
that get_type() returned a known type for which a case statement
existed).

13 months agoVersion bump to 5.9.14rc1 5.9.14rc1
Andreas Steffen [Wed, 13 Mar 2024 19:24:54 +0000 (20:24 +0100)] 
Version bump to 5.9.14rc1

13 months agosystime-fix: Fix declaration of validator constructor
Tobias Brunner [Wed, 13 Mar 2024 15:17:44 +0000 (16:17 +0100)] 
systime-fix: Fix declaration of validator constructor

13 months agounit-tests: Point out if ECDSA public key was rejected after private keys was not
Tobias Brunner [Wed, 13 Mar 2024 14:34:48 +0000 (15:34 +0100)] 
unit-tests: Point out if ECDSA public key was rejected after private keys was not

AWS-LC rejects public keys with explicitly encoded parameters but allows
private keys that use explicit encodings of the NIST curves.  Since the
more important aspect is that public keys are rejected, this addition to
the warning message points that out.

References strongswan/strongswan#1907

13 months agotesting: Added RFC4806 tests
Andreas Steffen [Fri, 8 Mar 2024 16:15:35 +0000 (17:15 +0100)] 
testing: Added RFC4806 tests

13 months agoAdd support for IKEv2 OCSP extensions (RFC 4806)
Jean-François Hren [Wed, 29 Nov 2023 15:51:48 +0000 (16:51 +0100)] 
Add support for IKEv2 OCSP extensions (RFC 4806)

Closes strongswan/strongswan#2016

Co-authored-by: Tobias Brunner <tobias@strongswan.org>
13 months agoMerge branch 'name-constraints'
Tobias Brunner [Wed, 13 Mar 2024 14:05:14 +0000 (15:05 +0100)] 
Merge branch 'name-constraints'

This refactors the name constraints validation in the revocation plugin
so it aligns with what's specified in RFC 5820.

It also expands the subnet/range matching for identities.

Closes strongswan/strongswan#2114

13 months agoconstraints: Properly validate name constraints according to RFC 5280
Tobias Brunner [Fri, 23 Feb 2024 16:44:44 +0000 (17:44 +0100)] 
constraints: Properly validate name constraints according to RFC 5280

The previous code was in a way too simple which resulted in it being too
strict.  For instance, it enforced that intermediate CA certificates
inherited the name constraints of their parents.  That's not required by
RFC 5280 and prevented e.g. adding constraints in an intermediate CA
certificate that's followed by another that doesn't contain any
name constraints.  That's perfectly fine as the set of constraints
specified by the parent continue to apply to that CA certificate and
the children it issues.

Name constraints were previously also applied to all identities of a
matching type, which is way too strict except for some very simple
cases.  It basically prevented multiple constraints of the same type
as e.g. an intermediate CA certificate that has permitted name constraints
for example.org and example.com couldn't issue acceptable certificates
because any SAN with one domain would get rejected by the other
constraint.  According to RFC 5280 matching one constraint is enough.

Also fixed is an issue with name constraints for IP addresses which were
previously only supported for a single level.

13 months agoidentification: Add support to match subnets/ranges against each other
Tobias Brunner [Fri, 23 Feb 2024 15:19:19 +0000 (16:19 +0100)] 
identification: Add support to match subnets/ranges against each other

Previously, it was only possible to match addresses against subnets and
ranges, but not the other way around or subnets and ranges against each
other.

14 months agoconfigure: Load constraints plugin in pki
Tobias Brunner [Fri, 23 Feb 2024 10:18:11 +0000 (11:18 +0100)] 
configure: Load constraints plugin in pki

This allows --verify to check e.g. name constraints.

14 months agogithub: Add AWS-LC CI job
Gerardo Ravago [Thu, 22 Feb 2024 18:47:58 +0000 (13:47 -0500)] 
github: Add AWS-LC CI job

AWS-LC is an OpenSSL derivative which can be used with the openssl plugin.
This adds a CI job that resembles the openssl-3 test case. It downloads
the source tarball for an AWS-LC release, builds that source using
CMake/Ninja, and then builds/tests strongSwan using the same technique
used by openssl-3.

References strongswan/strongswan#1907
Closes strongswan/strongswan#2151

14 months agostarter: Use correct type for uniqueids field
Etay Bogner [Wed, 6 Mar 2024 22:40:51 +0000 (00:40 +0200)] 
starter: Use correct type for uniqueids field

Enum arguments (ARG_ENUM with .list != LST_bool) are assumed to be of
type/size int in assign_args() in args.c.

Fixes: 0644ebd3de62 ("implemented IKE_SA uniqueness using ipsec.conf uniqueids paramater additionally supports a "keep" value to keep the old IKE_SA")
Closes strongswan/strongswan#2148

14 months agoleak-detective: Add whitelist entries for AWS-LC
Gerardo Ravago [Wed, 6 Mar 2024 15:45:00 +0000 (10:45 -0500)] 
leak-detective: Add whitelist entries for AWS-LC

AWS-LC (and likely BoringSSL) uses thread specific data to store internal
library state which gets freed via a registered destructor when the thread
terminates. If this thread happens to be the main thread, which runs the
leak-detective evaluation, the detective won't observe the corresponding free
of the related memory and erroneously reports it as a leak.

The two places this happens are:
- `RAND_bytes` for storing internal RNG state.
- `ERR_put_error` for storing the per-thread OpenSSL error queue.

References strongswan/strongswan#1907
Closes strongswan/strongswan#2147

14 months agoopenssl: Handle BoringSSL-style ASN1_INTEGERs in cert serials
Gerardo Ravago [Mon, 4 Mar 2024 15:25:12 +0000 (10:25 -0500)] 
openssl: Handle BoringSSL-style ASN1_INTEGERs in cert serials

OpenSSL stores the serial number for an X509 certificate as an
`ASN1_INTEGER` type. Within BoringSSL (and AWS-LC), the library
represents the value of zero as an empty array [1] which is different
from OpenSSL which represents it as the 1-byte array [0x00]. Though the
value of zero for the certificate serial number is illegal under
X.509 [2], we need to handle/encode it consistently within strongSwan.
From 18082ce2b061 ("certificates: Retrieve serial numbers in canonical
form"), we infer that the canonical representation of the zero serial
is [0x00]. To do this, we introduce `openssl_asn1_int2chunk` to
complement the existing string version that allows us to handle the
special case for zero instead of always returning a reference to the
library-dependent encodings.

References strongswan/strongswan#1907
Closes strongswan/strongswan#2138

[1] https://github.com/google/boringssl/commit/bdc35b63617f78037768f4897d8835696f02181a
[2] https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.2

14 months agocert-enroll: add init.d support to cert-install-sssd
Andreas Steffen [Sun, 3 Mar 2024 16:12:48 +0000 (17:12 +0100)] 
cert-enroll: add init.d support to cert-install-sssd

14 months agoutils: Define ignore_result() so it requires a semicolon
Tobias Brunner [Thu, 29 Feb 2024 15:02:28 +0000 (16:02 +0100)] 
utils: Define ignore_result() so it requires a semicolon

It previously also added its own empty statement.

14 months agoRemove obvious empty statements (i.e. stray semicolons)
Tobias Brunner [Thu, 29 Feb 2024 14:10:59 +0000 (15:10 +0100)] 
Remove obvious empty statements (i.e. stray semicolons)

14 months agogithub: Update GitHub-provided actions for Node.js update
Tobias Brunner [Wed, 28 Feb 2024 14:21:29 +0000 (15:21 +0100)] 
github: Update GitHub-provided actions for Node.js update

14 months agoutils: Define DESTROY_*_IF() macros without terminating semicolon
Tobias Brunner [Wed, 28 Feb 2024 13:40:56 +0000 (14:40 +0100)] 
utils: Define DESTROY_*_IF() macros without terminating semicolon

This avoids double semicolons (i.e. empty statements) and is how
DESTROY_IF() is already defined.

14 months agoandroid: New release after adding fix for existing shortcuts/Intents android-2.5.1
Tobias Brunner [Mon, 26 Feb 2024 10:14:14 +0000 (11:14 +0100)] 
android: New release after adding fix for existing shortcuts/Intents

14 months agoandroid: Add fallback for the old name of the profile ID extra
Tobias Brunner [Mon, 26 Feb 2024 10:01:55 +0000 (11:01 +0100)] 
android: Add fallback for the old name of the profile ID extra

This fixes existing shortcuts and automation via Intents.

Fixes: 8e3b921abed7 ("android: Always use UUID to access profiles")
14 months agoRevert "kernel-netlink: Never use XFRMA_REPLAY_ESN_VAL to configure zero replay windows"
Tobias Brunner [Fri, 23 Feb 2024 16:55:41 +0000 (17:55 +0100)] 
Revert "kernel-netlink: Never use XFRMA_REPLAY_ESN_VAL to configure zero replay windows"

This reverts commit 8b9b11919d92e9738bb52901c9dbcc72e35b9fed.

Since ESN was negotiated via proposal, just configuring the SA without
ESN won't work as the ICV will be incorrect if the peer enabled ESN
on its SA.  While the Linux kernel currently doesn't support disabling
replay protection for SAs that use ESN, this at least gets users an
explicit error not just dropped packets, and it will automatically work
if the kernel supports this combination at some point.

References strongswan/strongswan#2117

14 months agoVersion bump to 5.9.14dr1 5.9.14dr1
Andreas Steffen [Thu, 22 Feb 2024 14:51:24 +0000 (15:51 +0100)] 
Version bump to 5.9.14dr1

14 months agoUse Botan 3.3.0 for tests
Tobias Brunner [Wed, 21 Feb 2024 15:16:24 +0000 (16:16 +0100)] 
Use Botan 3.3.0 for tests

14 months agoMerge branch 'android-managed-configurations' android-2.5.0
Tobias Brunner [Thu, 22 Feb 2024 12:37:01 +0000 (13:37 +0100)] 
Merge branch 'android-managed-configurations'

This adds support for managed configurations via enterprise mobility
management (EMM) systems. Also changes details regarding the SQL data
source.

14 months agoandroid: New release after adding support for managed configurations
Tobias Brunner [Wed, 21 Feb 2024 07:29:54 +0000 (08:29 +0100)] 
android: New release after adding support for managed configurations

14 months agoandroid: Add translations for managed configuration strings
Tobias Brunner [Tue, 30 Jan 2024 17:57:43 +0000 (18:57 +0100)] 
android: Add translations for managed configuration strings

Not actually translating anything, but making the linter happy.

14 months agoandroid: Update managed certificates if config changes
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:24 +0000 (15:37 +0100)] 
android: Update managed certificates if config changes

14 months agoandroid: Add manager for managed user certificates
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:24 +0000 (15:37 +0100)] 
android: Add manager for managed user certificates

This can be used to install, replace or delete currently installed user
certificates based on the app's current managed configuration.

14 months agoandroid: Add manager for managed trusted certificates
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:24 +0000 (15:37 +0100)] 
android: Add manager for managed trusted certificates

This is used to install, replace or delete currently installed trusted
certificates based on the app's current managed configuration.

Certificates that are shared between multiple profiles are protected
and not uninstalled if a profile that uses it remains.

14 months agoandroid: Add utility class to determine differences in two lists of objects
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:24 +0000 (15:37 +0100)] 
android: Add utility class to determine differences in two lists of objects

This allows determining the difference between two lists in the form of
inserts, updates and deletes (and unchanged elements).