]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
2 weeks agoRevert "wip: tests adapted for different SA cache" per-cpu-sas-poc
Tobias Brunner [Wed, 22 Mar 2023 15:19:52 +0000 (16:19 +0100)] 
Revert "wip: tests adapted for different SA cache"

This reverts commit 942c696a9214d3a4442ed5b7151f62485e6d1bce.

2 weeks agowip: tests adapted for different SA cache
Tobias Brunner [Tue, 29 Jun 2021 13:12:11 +0000 (15:12 +0200)] 
wip: tests adapted for different SA cache

2 weeks agowip: set inbound cpu ID
Tobias Brunner [Tue, 22 Jun 2021 12:03:03 +0000 (14:03 +0200)] 
wip: set inbound cpu ID

2 weeks agowip: testing: Add ikev2/per-cpu-sas-encap-transport scenario
Tobias Brunner [Wed, 16 Jun 2021 07:45:57 +0000 (09:45 +0200)] 
wip: testing: Add ikev2/per-cpu-sas-encap-transport scenario

wip: Interestingly, the responder always uses the same SA to respond (maybe
due to the cache on the policy?)

2 weeks agowip: testing: Add ikev2/per-cpu-sas-encap scenario
Tobias Brunner [Tue, 15 Jun 2021 09:13:35 +0000 (11:13 +0200)] 
wip: testing: Add ikev2/per-cpu-sas-encap scenario

2 weeks agowip: child-sa: Configure UDP encapsulation for per-CPU SAs
Tobias Brunner [Tue, 15 Jun 2021 09:11:14 +0000 (11:11 +0200)] 
wip: child-sa: Configure UDP encapsulation for per-CPU SAs

wip: this is just a PoC. it needs some kind of notify to negotiate
the use (in theory it doesn't as IPsec stacks should be able to process
UDP encaped and plain ESPs for the same SA, the kernel doesn't so both
peers need to enable it - otherwise we could just enable it on the
outbound SA and send to port 4500)

To avoid lots of NAT mapping events from the kernel it needs a patch so it
doesn't produce any if the configured source port is 0

2 weeks agovici: Make UDP encapsulation for per-CPU SAs configurable
Tobias Brunner [Tue, 15 Jun 2021 09:10:40 +0000 (11:10 +0200)] 
vici: Make UDP encapsulation for per-CPU SAs configurable

2 weeks agochild-cfg: Add flag to enable UDP encapsulation for per-CPU SAs
Tobias Brunner [Tue, 15 Jun 2021 07:46:31 +0000 (09:46 +0200)] 
child-cfg: Add flag to enable UDP encapsulation for per-CPU SAs

2 weeks agotesting: Add per-CPU SA test scenario
Tobias Brunner [Wed, 2 Jun 2021 15:07:01 +0000 (17:07 +0200)] 
testing: Add per-CPU SA test scenario

2 weeks agotesting: Configure multiple virtual CPUs for moon and sun
Tobias Brunner [Mon, 31 May 2021 14:46:41 +0000 (16:46 +0200)] 
testing: Configure multiple virtual CPUs for moon and sun

This allows testing per-CPU SAs by e.g. pinging over a specific CPU
via taskset.

2 weeks agotesting: Enable SMP support for latest kernels
Tobias Brunner [Mon, 31 May 2021 15:09:28 +0000 (17:09 +0200)] 
testing: Enable SMP support for latest kernels

2 weeks agoswanctl: Report per-CPU information in --list-sas
Tobias Brunner [Thu, 20 May 2021 08:32:09 +0000 (10:32 +0200)] 
swanctl: Report per-CPU information in --list-sas

2 weeks agovici: Report per-CPU SA information
Tobias Brunner [Thu, 20 May 2021 08:19:41 +0000 (10:19 +0200)] 
vici: Report per-CPU SA information

2 weeks agowip: vici: Make per-CPU CHILD_SAs configurable
Tobias Brunner [Thu, 20 May 2021 08:12:30 +0000 (10:12 +0200)] 
wip: vici: Make per-CPU CHILD_SAs configurable

wip: also, maybe add a check to ensure that start_action=trap is set (or even
set it implicitly?), but could also just be the responsibility of the
user as it's documented

2 weeks agokernel-netlink: Forward CPU ID from acquires
Tobias Brunner [Thu, 20 May 2021 08:04:46 +0000 (10:04 +0200)] 
kernel-netlink: Forward CPU ID from acquires

2 weeks agowip: trap-manager: Add support to handle acquires for per-CPU SAs
Tobias Brunner [Thu, 20 May 2021 07:46:55 +0000 (09:46 +0200)] 
wip: trap-manager: Add support to handle acquires for per-CPU SAs

wip: we could possibly install trap policies with num_sas set to install
per-CPU trap policies right from the start. then the first acquire would
already get us a CPU ID. however, since we don't now if the peer supports
the extension, the CPU ID might get reset and a regular SA negotiated,
rendering the match for CPU ID invalid (we could then perhaps just remove
the first acquire with has acquire->cpu != CPU_ID_MAX and stop enumerating).
the policy installed with the regular SA should hopefully prevent further
CPU-specific acquires (at least if there was no narrowing)

2 weeks agokernel-handler: Log CPU ID that's passed with an acquire
Tobias Brunner [Mon, 26 Sep 2022 14:55:00 +0000 (16:55 +0200)] 
kernel-handler: Log CPU ID that's passed with an acquire

2 weeks agokernel-interface: Optionally pass CPU ID for which an acquire was triggered
Tobias Brunner [Mon, 26 Sep 2022 14:47:46 +0000 (16:47 +0200)] 
kernel-interface: Optionally pass CPU ID for which an acquire was triggered

3 weeks agoike-sa: Accept optional CPU ID when initiating CHILD_SAs
Tobias Brunner [Wed, 19 May 2021 13:11:53 +0000 (15:11 +0200)] 
ike-sa: Accept optional CPU ID when initiating CHILD_SAs

3 weeks agoike-sa: Sort CHILD_SAs by CPU ID
Tobias Brunner [Thu, 20 May 2021 07:41:54 +0000 (09:41 +0200)] 
ike-sa: Sort CHILD_SAs by CPU ID

This might make debugging easier and also ensures that a possible
fallback SA without CPU ID is established first when reestablishing
an IKE_SA.  Because even if such an SA is established first, that might
change if per-CPU SAs are rekeyed first.

3 weeks agochild-rekey: Maintain per-CPU values during rekeying
Tobias Brunner [Wed, 19 May 2021 10:00:39 +0000 (12:00 +0200)] 
child-rekey: Maintain per-CPU values during rekeying

3 weeks agowip: child-create: Add support to negotiate per-CPU SAs
Tobias Brunner [Wed, 19 May 2021 08:59:03 +0000 (10:59 +0200)] 
wip: child-create: Add support to negotiate per-CPU SAs

wip: several FIXMEs

3 weeks agowip: updown: Don't call the script for per-CPU SAs
Tobias Brunner [Mon, 31 May 2021 14:12:27 +0000 (16:12 +0200)] 
wip: updown: Don't call the script for per-CPU SAs

This only works if a duplicate SA without CPU ID is negotiated.

wip: it might actually be necessary to install rules for individual SAs,
maybe we could pass the CPU ID via PLUTO_CPU_ID

3 weeks agoha: Ignore per-CPU CHILD_SAs
Tobias Brunner [Mon, 31 May 2021 13:26:27 +0000 (15:26 +0200)] 
ha: Ignore per-CPU CHILD_SAs

These only work on initiators (with trap policies), which is something
the plugin doesn't support.

3 weeks agoforecast: Ignore per-CPU CHILD_SAs
Tobias Brunner [Mon, 31 May 2021 13:21:46 +0000 (15:21 +0200)] 
forecast: Ignore per-CPU CHILD_SAs

Not sure if this combination does make sense as the plugin itself would
be a major bottleneck.

Similar to the connmark plugin, PREROUTING rules list SPIs or UDP ports,
which would be necessary for all SAs while the OUTPUT rules would only be
required once.

3 weeks agoconnmark: Ignore per-CPU CHILD_SAs
Tobias Brunner [Mon, 31 May 2021 13:06:41 +0000 (15:06 +0200)] 
connmark: Ignore per-CPU CHILD_SAs

The combination probably doesn't make much sense.

The OUTPUT rules would definitely only be required once, while the INPUT
and PREROUTING rules list individual SPIs and/or UDP ports, which would
be necessary for all SAs.

By the way, the rules in PREROUTING might actually not be necessary
anymore if the set_mark_in option was used for such SAs.

3 weeks agowip: child-sa: Add support for per-CPU SAs
Tobias Brunner [Tue, 11 May 2021 15:55:21 +0000 (17:55 +0200)] 
wip: child-sa: Add support for per-CPU SAs

3 weeks agokernel-netlink: Add support to enable per-CPU acquires on policies
Tobias Brunner [Tue, 11 May 2021 14:24:38 +0000 (16:24 +0200)] 
kernel-netlink: Add support to enable per-CPU acquires on policies

3 weeks agokernel-netlink: Add support to set CPU ID on SA
Tobias Brunner [Tue, 11 May 2021 14:07:39 +0000 (16:07 +0200)] 
kernel-netlink: Add support to set CPU ID on SA

3 weeks agowip: ipsec-types: Add identifier for the maximum CPU ID
Tobias Brunner [Mon, 10 May 2021 14:28:15 +0000 (16:28 +0200)] 
wip: ipsec-types: Add identifier for the maximum CPU ID

wip: The kernel should really use 0 for "n/a" etc. using such a specific
value makes fallbacks (e.g. in third-party kernel interfaces) tricky.

wip: Maybe move to kernel_interface.h or kernel_ipsec.h?

3 weeks agowip: include: Add XFRM identifiers for per-CPU SAs/acquires
Tobias Brunner [Mon, 10 May 2021 14:23:20 +0000 (16:23 +0200)] 
wip: include: Add XFRM identifiers for per-CPU SAs/acquires

wip: the API is still under development

3 weeks agowip: child-cfg: Add flag to enable per-CPU SAs
Tobias Brunner [Tue, 11 May 2021 12:46:29 +0000 (14:46 +0200)] 
wip: child-cfg: Add flag to enable per-CPU SAs

3 weeks agowip: notify-payload: Add notify type for per-resource CHILD_SAs
Tobias Brunner [Tue, 11 May 2021 12:21:25 +0000 (14:21 +0200)] 
wip: notify-payload: Add notify type for per-resource CHILD_SAs

wip: the name might change, no restrictions on the length/content (probably
stays that way)

3 weeks 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.

3 weeks 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.

3 weeks 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

3 weeks 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>
3 weeks 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>
4 weeks 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

4 weeks 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.

4 weeks 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

4 weeks 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.

5 weeks 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

5 weeks 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")
5 weeks 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")
5 weeks 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>
6 weeks 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

6 weeks 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

6 weeks 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

6 weeks 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

6 weeks 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

6 weeks 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

6 weeks 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

6 weeks 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

6 weeks 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")
6 weeks 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).

6 weeks 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

6 weeks 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

6 weeks 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

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

6 weeks 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>
6 weeks 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

7 weeks 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.

7 weeks 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.

7 weeks 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.

7 weeks 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

7 weeks 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

7 weeks 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

8 weeks 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

8 weeks 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

2 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.

2 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)

2 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

2 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.

2 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

2 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")
2 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

2 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

2 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

2 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.

2 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

2 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.

2 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

2 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.

2 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.

2 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).

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

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

2 months agoandroid: Add base repository for installed managed certificates
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add base repository for installed managed certificates

2 months agoandroid: Add installer for managed user certificates/keys
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add installer for managed user certificates/keys

This installs the configured user certificate into Android's key store
using the DevicePolicyManager.

This is only accessible if the app is installed on an enrolled device and
has been granted the CERT_INSTALL delegate scope.

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

This installs a configured CA or server certificate into the app's local
key store.

2 months agoandroid: Add database migration for managed certificates
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add database migration for managed certificates

2 months agoandroid: Add trusted and user certificates to ManagedVpnProfile
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add trusted and user certificates to ManagedVpnProfile

2 months agoandroid: Add entities for CA/server and user certificates
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add entities for CA/server and user certificates

2 months agoandroid: Add utility that parses a PKCS#12 container and extracts a KeyPair
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add utility that parses a PKCS#12 container and extracts a KeyPair

2 months agoandroid: Add utility that converts a Base64 string to a X509Certificate
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add utility that converts a Base64 string to a X509Certificate

2 months agoandroid: Add utility class that pairs a certificate with a private key
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add utility class that pairs a certificate with a private key

2 months agoandroid: Add password for client certificate to managed config
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Add password for client certificate to managed config

2 months agoandroid: Provide global database helper instance
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Provide global database helper instance

2 months agoandroid: Extend database helper with table definition
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:23 +0000 (15:37 +0100)] 
android: Extend database helper with table definition

This simplifies database migration.