]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
23 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>
23 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>
23 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

23 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

23 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

23 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

23 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

23 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2 years agoandroid: Move database helper into separate class
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:22 +0000 (15:37 +0100)] 
android: Move database helper into separate class

Reduce strong coupling between database helper and VPN profiles, to
prepare for the addition of other tables.

2 years agoandroid: Hide unmanaged profiles by default
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:22 +0000 (15:37 +0100)] 
android: Hide unmanaged profiles by default

Such profiles could exist if a user already had strongSwan installed.

2 years agoandroid: Disable access to settings depending on managed configuration
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:22 +0000 (15:37 +0100)] 
android: Disable access to settings depending on managed configuration

2 years agoandroid: Hide menu items depending on managed configuration
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:22 +0000 (15:37 +0100)] 
android: Hide menu items depending on managed configuration

Hide and disable menu items when disabled by the managed configuration.

2 years agoandroid: Add data source for managed VPN profiles
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Add data source for managed VPN profiles

Include the managed VPN profile data source in the profile source,
to show profiles from both sources in the UI.

2 years agoandroid: Expose static instance for Application object
Tobias Brunner [Fri, 19 Jan 2024 17:29:20 +0000 (18:29 +0100)] 
android: Expose static instance for Application object

While it seems to be possible to cast Context.getApplicationContext()
to the application class, there really is no documented reason why that
should actually be the same object.

2 years agoandroid: Expose managed configuration globally and notify listeners on changes
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:22 +0000 (15:37 +0100)] 
android: Expose managed configuration globally and notify listeners on changes

Triggers a broadcast if the configuration changed and updates the
profile list accordingly (previously only handled removal of multiple
profiles).

If the app resumes, the configuration is also loaded and listeners are
notified in case the config was updated while the app was in the
background.

2 years agoandroid: Add ManagedConfigurationService and related classes
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Add ManagedConfigurationService and related classes

Add service that provides access to managed configurations.

2 years agoandroid: Add managed_configuration.xml
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Add managed_configuration.xml

Add managed configuration and associated English strings.

2 years agoandroid: Make VpnType#fromIdentifier null-safe
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:24 +0000 (15:37 +0100)] 
android: Make VpnType#fromIdentifier null-safe

2 years agoandroid: Add data source to VpnProfile
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Add data source to VpnProfile

2 years agoandroid: Show warning message for read-only profiles in detail view
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:22 +0000 (15:37 +0100)] 
android: Show warning message for read-only profiles in detail view

Show a message explaining that a managed profile can't be edited in
its detail view.

2 years agoandroid: Add label to read-only profiles in list
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:22 +0000 (15:37 +0100)] 
android: Add label to read-only profiles in list

Show "Managed profile" in the list of VPN profiles, to make it
immediately obvious that a profile is managed/read-only.