]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
17 months agoandroid: Add interface for VPN data source
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Add interface for VPN data source

Change VPN profile source to an interface. Preparation to allow managed
configurations as a second source.

17 months agoandroid: Use try-with-resources for IO
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Use try-with-resources for IO

17 months agoandroid: Remove unnecessary @TargetApi
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Remove unnecessary @TargetApi

The minSdkVersion is 21, remove unnecessary @TargetApi annotations.

17 months agoandroid: Remove unnecessary API checks
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Remove unnecessary API checks

The minSdkVersion is 21, remove unnecessary checks and code that target
older API versions.

17 months agoandroid: Remove AndroidX legacy support
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:21 +0000 (15:37 +0100)] 
android: Remove AndroidX legacy support

17 months agoAdd ._.DS_Store to .gitignore
Markus Pfeiffer [Tue, 21 Nov 2023 14:37:20 +0000 (15:37 +0100)] 
Add ._.DS_Store to .gitignore

17 months agopki: Added key and cert handles to --ocsp command 2090/head
Andreas Steffen [Wed, 7 Feb 2024 06:55:10 +0000 (07:55 +0100)] 
pki: Added key and cert handles to --ocsp command

17 months agopkcs11: Support RSA-PSS signatures 2082/head
Andreas Steffen [Fri, 26 Jan 2024 18:58:23 +0000 (19:58 +0100)] 
pkcs11: Support RSA-PSS signatures

17 months agopkcs11: Updated pkcs11.h header file based on OpenSC
Andreas Steffen [Thu, 25 Jan 2024 17:51:51 +0000 (18:51 +0100)] 
pkcs11: Updated pkcs11.h header file based on OpenSC

17 months agoopenssl: Condition out unsupported curves for AWS-LC
Gerardo Ravago [Tue, 20 Feb 2024 16:54:01 +0000 (11:54 -0500)] 
openssl: Condition out unsupported curves for AWS-LC

AWS-LC lacks support for a number of elliptic curve algorithms so this
adds some conditional macros to avoid registering the related plugin
features. Support for curves ed448 and x448 is completely absent and are
not planned for implementation as they are no longer recommended for use.
While ed25519 is supported by the library, a single missing API for
ASN.1 DER encoding of its private keys is missing which prevents its
use in strongSwan. Future work may remove this limitation, but for now
we will disable the functionality.

Closes strongswan/strongswan#2109

17 months agoopenssl: Add conditional macros around SHA_CTX for AWS-LC
Gerardo Ravago [Thu, 15 Feb 2024 15:42:36 +0000 (10:42 -0500)] 
openssl: Add conditional macros around SHA_CTX for AWS-LC

AWS-LC is a BoringSSL-based libcrypto implementation. SHA_CTX is declared with
the hash data specified as an array rather than as a field in upstream OpenSSL.
Since AWS-LC builds against C99, we are unable to handle this with anonymous
unions like BoringSSL. The workaround I propose is to add these conditional
macros around the accessors within openssl_sha1_prf. After this change,
everything builds successfully with AWS-LC headers.

Closes strongswan/strongswan#2103

17 months agopf-handler: Always free the object even if no socket has been opened yet
Tobias Brunner [Mon, 19 Feb 2024 08:49:08 +0000 (09:49 +0100)] 
pf-handler: Always free the object even if no socket has been opened yet

17 months agodhcp: Port the plugin to FreeBSD/macOS
Dan James [Fri, 24 Nov 2023 15:54:04 +0000 (10:54 -0500)] 
dhcp: Port the plugin to FreeBSD/macOS

This also refactors the BPF handling so it can be shared between the
dhcp and farp plugins.  The latter is adapted accordingly.

Closes strongswan/strongswan#2047

Co-authored-by: Tobias Brunner <tobias@strongswan.org>
17 months agogithub: Use new property to pass token for sonarcloud
Tobias Brunner [Fri, 16 Feb 2024 13:48:44 +0000 (14:48 +0100)] 
github: Use new property to pass token for sonarcloud

sonar.login is deprecated.

17 months agoMerge branch 'ref-overflows'
Tobias Brunner [Fri, 16 Feb 2024 13:04:45 +0000 (14:04 +0100)] 
Merge branch 'ref-overflows'

Different users in the strongSwan code base use the refcount helpers to
allocate incrementing unique values. So far the risk of overflows for
these unsigned 32-bit values has been considered mostly theoretical, as
it requires a longer uptime and a lot of activity to hit such an overflow.

At least for the Netlink sequence numbers, this is not only theoretical,
though, and an overflow has been hit on a productive setup. Unfortunately,
the consequences are rather unpleasant, as the response with a zero
sequence number can't be matched to the request. This results in the
offending thread to block indefinitely while holding the Netlink mutex.

So add a helper to allocate incrementing unique identifiers that checks
for overflows and never returns 0. Use it for Netlink sequence numbers
and some other potential users affected, namely those allocating
IKE_SA/CHILD_SA unique identifiers, marks and interface identifiers.

Closes strongswan/strongswan#2062

17 months agochild-sa: Handle refcount overflow for unique mark/if_id allocation gracefully
Martin Willi [Fri, 16 Feb 2024 09:59:11 +0000 (10:59 +0100)] 
child-sa: Handle refcount overflow for unique mark/if_id allocation gracefully

The refcount_t for allocating unique marks and interface IDs may overflow or
hit the special value for unique marks/if_ids, in the worst case not setting it
on CHILD_SAs that should have one.

As (potentially two) marks/if_ids are allocated only for newly created CHILD_SAs,
but not for rekeying, this not very likely. Still, if a setup uses
aggressive re-authentication and or re-creates CHILD_SAs every minute,
a gateway with 100'000 tunnels may hit the overflow within a month uptime.

17 months agochild-sa: Move unique mark allocation to a separate helper function
Martin Willi [Fri, 16 Feb 2024 09:42:43 +0000 (10:42 +0100)] 
child-sa: Move unique mark allocation to a separate helper function

This aligns the code with unique interface ID allocation, which uses a helper
function for the same purpose and mechanic as well.

17 months agochild-sa: Handle CHILD_SA unique identifier refcount overflow gracefully
Martin Willi [Wed, 10 Jan 2024 16:31:49 +0000 (17:31 +0100)] 
child-sa: Handle CHILD_SA unique identifier refcount overflow gracefully

CHILD_SA unique identifier allocation starts at 1. If the counter overflows,
a unique ID of 0 is assigned to an CHILD_SA, which may have unclear
consequences.

Overflowing the unique ID counter is theoretical for most setups, but on
a Gateway terminating 100'000 tunnels and rekeying CHILD_SAs every 60s
overflows the counter after a month uptime. So avoid a 0 unique identifier
by using ref_get_nonzero().

17 months agoike-sa: Handle IKE_SA unique identifier refcount overflow gracefully
Martin Willi [Wed, 10 Jan 2024 16:27:00 +0000 (17:27 +0100)] 
ike-sa: Handle IKE_SA unique identifier refcount overflow gracefully

IKE_SA unique identifier allocation starts at 1. If the counter overflows,
a unique ID of 0 is assigned to an IKE_SA, which may have unclear consequences.

Overflowing the unique ID counter is theoretical for most setups, but on
a Gateway terminating 100'000 tunnels and rekeying the IKE_SA every 60s
overflows the counter after a month uptime. So avoid a 0 unique identifier
by using ref_get_nonzero().

17 months agokernel-netlink: Handle Netlink sequence number counter overflows gracefully
Martin Willi [Wed, 10 Jan 2024 15:54:17 +0000 (16:54 +0100)] 
kernel-netlink: Handle Netlink sequence number counter overflows gracefully

A refcount variable is used to allocate sequential unique identifiers for
Netlink sequence numbers, subject to overflows. The risk of an overflow
has so far not been considered practical, as it requires 2^32 netlink
requests.

It seems that this issue is not only theoretical. A host with thousands
of tunnels doing aggressive rekeying and/or aggressive status checking
(via vici list-sas) may trigger the overflow after a few weeks uptime.

The consequences are rather devastating: Once the refcount overflows, a
Netlink request is sent with sequence number 0. This request is answered
by the kernel, but can't be matched to the request, resulting in the error:
"received unknown netlink seq 0, ignored". Without Netlink timeouts, the
thread indefinitely waits for a response while holding the Netlink mutex,
bringing all threads to a halt.

So at all costs avoid zero sequence numbers. Also, start at sequence number
1 instead of the arbitrary 201, so the same range is used on start and after
an overflow.

17 months agoatomics: Add a ref_get() variant returning non-zero on overflows
Martin Willi [Wed, 10 Jan 2024 15:38:54 +0000 (16:38 +0100)] 
atomics: Add a ref_get() variant returning non-zero on overflows

This is useful for users using ref_get() for unique identifier allocation,
but the zero value has special meaning.

17 months agoopenssl: Add missing error checking when encoding ED private key
Gerardo Ravago [Tue, 13 Feb 2024 15:24:33 +0000 (10:24 -0500)] 
openssl: Add missing error checking when encoding ED private key

This applies the same logic found in other private key implementations
like that for ECDSA.

Closes strongswan/strongswan#2097

17 months agoauth-cfg: Improve log message for identity constraint mismatch error
Florian Bezannier [Thu, 1 Feb 2024 15:43:35 +0000 (16:43 +0100)] 
auth-cfg: Improve log message for identity constraint mismatch error

Closes strongswan/strongswan#2088

18 months agogithub: Use NDK version in build.gradle to build OpenSSL
Tobias Brunner [Tue, 12 Dec 2023 17:08:05 +0000 (18:08 +0100)] 
github: Use NDK version in build.gradle to build OpenSSL

Also fix the path to the sdkmanager (the old one was removed in the latest
images and the incorrect path caused a weird sudo error) and install
Java 17 as that's necessary for newer versions of the Gradle plugin.

18 months agoandroid: Replace PowerMock with mechanism provided by newer Mockito versions
Tobias Brunner [Tue, 12 Dec 2023 18:41:47 +0000 (19:41 +0100)] 
android: Replace PowerMock with mechanism provided by newer Mockito versions

PowerMock isn't maintained anymore and causes issues with newer Java
versions.  We only used it to mock static methods, which Mockito now
supports as well.  Instead of using the try-with-resources construct,
this uses a @Before and @After method so we don't have to change all the
test methods.

18 months agoandroid: Update Gradle plugin and build scripts and dependencies
Tobias Brunner [Tue, 12 Dec 2023 16:19:18 +0000 (17:19 +0100)] 
android: Update Gradle plugin and build scripts and dependencies

This also references the NDK via ndkVersion and replaces the custom
ndk-build tasks.  It also replaces the deprecated compileSdkVersion and
increases it because dependencies of updated dependencies require that.

targetSdkVersion is not yet updated because there might be some work
required for Android 14 compatibility.

18 months agogithub: Also run tests on macOS 13
Tobias Brunner [Mon, 15 Jan 2024 14:56:58 +0000 (15:56 +0100)] 
github: Also run tests on macOS 13

Uses a newer version of clang and doesn't seem to have the issue with
process_t.

18 months agogithub: Increase timeout for process_t tests
Tobias Brunner [Mon, 15 Jan 2024 14:31:21 +0000 (15:31 +0100)] 
github: Increase timeout for process_t tests

This seems to be necessary on macOS 12 for some reason (note that handling
timeouts in these test cases doesn't really work).

18 months agogithub: Use newer gperf version on macOS
Tobias Brunner [Mon, 15 Jan 2024 14:14:46 +0000 (15:14 +0100)] 
github: Use newer gperf version on macOS

The gperf version that's already available on the system generates
function declarations with K&R syntax (separate arguments) for which newer
compilers produce a warning as C23 doesn't support that syntax anymore.

18 months agosimaka-crypto: Fix constructor declaration
Tobias Brunner [Mon, 15 Jan 2024 12:51:19 +0000 (13:51 +0100)] 
simaka-crypto: Fix constructor declaration

Prototype didn't match the implementation.

18 months agocirrus: Use FreeBSD 14.0
Tobias Brunner [Wed, 10 Jan 2024 10:06:09 +0000 (11:06 +0100)] 
cirrus: Use FreeBSD 14.0

FreeBSD 12.4 has been removed.

18 months agounit-tests: Use function pointers to test generic return_* helper functions
Tobias Brunner [Mon, 15 Jan 2024 12:39:32 +0000 (13:39 +0100)] 
unit-tests: Use function pointers to test generic return_* helper functions

These functions are declared without arguments, passing arguments to them
causes warnings such as the following with newer compilers:

  passing arguments to 'return_null' without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]

We only use them via function pointers, which doesn't trigger any warnings
and hopefully continues to work.

18 months agocurl: Fix issue with printf checks in newer curl versions
Tobias Brunner [Wed, 10 Jan 2024 10:17:58 +0000 (11:17 +0100)] 
curl: Fix issue with printf checks in newer curl versions

Newer curl versions (as used on macOS via Homebrew) add attributes like

  __attribute__ ((format(printf, a, b)))

to their `curl_*printf*` functions, which fails if we redefine `printf`
as e.g. `builtin_printf` (pulled in via library.h).  We could disable
these checks via CURL_NO_FMT_CHECKS, but reordering the headers should
do the trick as well.

18 months agoSuppress compiler warnings with specific bison and compiler combinations
Tobias Brunner [Wed, 10 Jan 2024 17:04:32 +0000 (18:04 +0100)] 
Suppress compiler warnings with specific bison and compiler combinations

Bison generates code that only increases the yynerrs counter, it's never
read.  This causes a warning in newer compilers (in particular clang).
Newer versions of bison mark yynerrs with __attribute__((unused)), but
at least on FreeBSD 14 that's not yet available.

18 months agoleak-detective: Add implementation of malloc_usable_size()
Tobias Brunner [Mon, 8 Jan 2024 15:05:20 +0000 (16:05 +0100)] 
leak-detective: Add implementation of malloc_usable_size()

systemd seems to use this and if we indirectly use libraries provided
by it, which can e.g. happen via getgrnam_r() and nss-systemd, this may
be called on pointers returned by leak detective's malloc(), which will
not point to the original start of the block and cause a segmentation
fault.

Closes strongswan/strongswan#2045

19 months agoMerge branch 'linux-strongswan'
Tobias Brunner [Thu, 14 Dec 2023 10:28:41 +0000 (11:28 +0100)] 
Merge branch 'linux-strongswan'

Closes strongswan/strongswan#2026

19 months agoipsec: Remove mention of NETKEY stack
Tobias Brunner [Thu, 14 Dec 2023 10:27:25 +0000 (11:27 +0100)] 
ipsec: Remove mention of NETKEY stack

19 months agoReplace some other mentions of "Linux strongSwan"
Tobias Brunner [Thu, 14 Dec 2023 10:23:22 +0000 (11:23 +0100)] 
Replace some other mentions of "Linux strongSwan"

19 months agoipsec: strongSwan is not exclusive to Linux kernels 2026/head
Jose Luis Duran [Sat, 9 Dec 2023 18:42:27 +0000 (18:42 +0000)] 
ipsec: strongSwan is not exclusive to Linux kernels

The project is now called "the strongSwan project" rather than "Linux
strongSwan" to better reflect this.

20 months agoVersion bump to 5.9.13 5.9.13
Andreas Steffen [Fri, 1 Dec 2023 06:26:22 +0000 (07:26 +0100)] 
Version bump to 5.9.13

20 months agoVersion bump to 5.9.13rc1 5.9.13rc1
Andreas Steffen [Sat, 25 Nov 2023 16:16:59 +0000 (17:16 +0100)] 
Version bump to 5.9.13rc1

20 months agoMerge branch 'ocsp-fixes'
Tobias Brunner [Fri, 24 Nov 2023 16:41:51 +0000 (17:41 +0100)] 
Merge branch 'ocsp-fixes'

Fixes a regression with handling OCSP error responses and adds a new
option to specify the length of nonces in OCSP requests.  Also adds some
other improvements for OCSP handling and fuzzers for OCSP
requests/responses.

Closes strongswan/strongswan#2011

20 months agox509: Make sure the status in OCSP responses has the correct length
Tobias Brunner [Fri, 24 Nov 2023 13:49:24 +0000 (14:49 +0100)] 
x509: Make sure the status in OCSP responses has the correct length

20 months agofuzz: Add fuzzing targets for OCSP requests/responses
Tobias Brunner [Thu, 23 Nov 2023 17:40:44 +0000 (18:40 +0100)] 
fuzz: Add fuzzing targets for OCSP requests/responses

20 months agox509: Make length of nonces in OCSP requests configurable
Tobias Brunner [Thu, 23 Nov 2023 17:10:08 +0000 (18:10 +0100)] 
x509: Make length of nonces in OCSP requests configurable

Some servers might not support a length of 32 and return a malformed
request error. Lowering the value to the previous default of 16 could
help in that case.

20 months agopki: Generate internal error OCSP response if no signer certificate is found
Tobias Brunner [Thu, 23 Nov 2023 16:54:40 +0000 (17:54 +0100)] 
pki: Generate internal error OCSP response if no signer certificate is found

That can happen if a request is sent to the wrong OCSP server.

20 months agocertificate-printer: Add some output for empty OCSP responses
Tobias Brunner [Thu, 23 Nov 2023 16:53:41 +0000 (17:53 +0100)] 
certificate-printer: Add some output for empty OCSP responses

20 months agorevocation: Reject OCSP error responses
Tobias Brunner [Thu, 23 Nov 2023 16:51:57 +0000 (17:51 +0100)] 
revocation: Reject OCSP error responses

Otherwise, there is lengthy code that tries to validate such responses,
even though they don't contain any signatures.

20 months agox509: Add getter for status of OCSP responses
Tobias Brunner [Thu, 23 Nov 2023 16:50:02 +0000 (17:50 +0100)] 
x509: Add getter for status of OCSP responses

20 months agox509: Correctly parse responderId as ASN.1 CHOICE in OCSP response
Tobias Brunner [Thu, 23 Nov 2023 15:52:55 +0000 (16:52 +0100)] 
x509: Correctly parse responderId as ASN.1 CHOICE in OCSP response

The two OPTs that were used previously allowed to omit it completely (hence
the fallback to ID_ANY), but that's invalid, so it's better to fail
parsing.

20 months agox509: Correctly handle missing responder ID when parsing OCSP response errors
Tobias Brunner [Thu, 23 Nov 2023 10:32:15 +0000 (11:32 +0100)] 
x509: Correctly handle missing responder ID when parsing OCSP response errors

The has_issuer() and issued_by() methods relied on it to be defined, so
if the OCSP response wasn't successful (i.e. OCSP status indicates an
error and no OCSP response is parsed), a null-pointer dereference was
caused if the caller checked if the OCSP response was issued by a
specific certificate.

That's a side-effect of the referenced commit.  Previously, error codes
caused the OCSP response to not get parsed successfully, which technically
wasn't correct as it's well formed and successfully parsed, it's just
indicating an error state.

Fixes: 00ab8d62c089 ("x509: Support generation of OCSP responses")
20 months agocert-enroll: Set the environment variables needed by cert-install-ssl
Andreas Steffen [Thu, 23 Nov 2023 18:05:22 +0000 (19:05 +0100)] 
cert-enroll: Set the environment variables needed by cert-install-ssl

20 months agoVersion bumpt to 5.9.12 5.9.12
Andreas Steffen [Mon, 20 Nov 2023 11:10:34 +0000 (12:10 +0100)] 
Version bumpt to 5.9.12

20 months agoNEWS: Add info about CVE-2023-41913
Tobias Brunner [Wed, 15 Nov 2023 13:23:56 +0000 (14:23 +0100)] 
NEWS: Add info about CVE-2023-41913

20 months agocharon-tkm: Validate DH public key to fix potential buffer overflow
Tobias Brunner [Tue, 11 Jul 2023 10:12:25 +0000 (12:12 +0200)] 
charon-tkm: Validate DH public key to fix potential buffer overflow

Seems this was forgotten in the referenced commit and actually could lead
to a buffer overflow.  Since charon-tkm is untrusted this isn't that
much of an issue but could at least be easily exploited for a DoS attack
as DH public values are set when handling IKE_SA_INIT requests.

Fixes: 0356089d0f94 ("diffie-hellman: Verify public DH values in backends")
Fixes: CVE-2023-41913
20 months agox509: Ensure extensions are encoded even if others are missing
Tobias Brunner [Wed, 15 Nov 2023 16:08:46 +0000 (17:08 +0100)] 
x509: Ensure extensions are encoded even if others are missing

As with the previous commit, this is probably never an issue in practice
as most certificates contain at least one SAN.

20 months agox509: Also encode extendedKeyUsage in cert requests if there are no SANs or certifica...
Tobias Brunner [Wed, 15 Nov 2023 16:01:02 +0000 (17:01 +0100)] 
x509: Also encode extendedKeyUsage in cert requests if there are no SANs or certificate type

Probably never was an issue in practice as most certificates contain at
least one SAN.

20 months agopki: Mention --index in description
Tobias Brunner [Wed, 15 Nov 2023 14:16:07 +0000 (15:16 +0100)] 
pki: Mention --index in description

20 months agoNEWS: Add news for 5.9.12
Tobias Brunner [Wed, 15 Nov 2023 13:05:09 +0000 (14:05 +0100)] 
NEWS: Add news for 5.9.12

20 months agoMove ocsp_responder_t interface as it's not a certificate
Tobias Brunner [Tue, 14 Nov 2023 09:35:47 +0000 (10:35 +0100)] 
Move ocsp_responder_t interface as it's not a certificate

20 months agoFixed some typos, courtesy of codespell
Tobias Brunner [Tue, 14 Nov 2023 09:11:16 +0000 (10:11 +0100)] 
Fixed some typos, courtesy of codespell

20 months agoVersion bump to 5.9.12rc1 5.9.12rc1
Andreas Steffen [Tue, 14 Nov 2023 07:12:00 +0000 (08:12 +0100)] 
Version bump to 5.9.12rc1

20 months agox509: Fix regression introduced by commit a22147a
Andreas Steffen [Tue, 14 Nov 2023 07:00:27 +0000 (08:00 +0100)] 
x509: Fix regression introduced by commit a22147a

Instead of the CA certificate's subjectKeyIdentifier erroneously
the CA's authorityKeyIdentifier was used as the authorityKeyIdentfier
of the certificate to be issued. This might work with a root CA
where the authorityKeyIdentifier equals its subjectKeyIdentfier
but introduces a severe regression when an intermediate CA is used.

20 months agoMerge branch 'ocsp-responder-index'
Tobias Brunner [Mon, 13 Nov 2023 11:51:47 +0000 (12:51 +0100)] 
Merge branch 'ocsp-responder-index'

Adds support for multiple OCSP responders in `pki --ocsp` and one that
is based on OpenSSL-style index.txt files.  The parser for these files
also accepts simplified files that only specify the status, serial number
and optional revocation date/reason.  The OCSP test scenarios are also
updated to use this OCSP responder including one that shows the multi-CA
capabilities of the --ocsp command and the --index option.

20 months agotesting: Use a single OCSP responder for ikev2-multi-ca/ocsp-signers scenario
Tobias Brunner [Tue, 7 Nov 2023 10:21:14 +0000 (11:21 +0100)] 
testing: Use a single OCSP responder for ikev2-multi-ca/ocsp-signers scenario

This demonstrates the multi-CA capabilities of the pki --ocsp command.

20 months agotesting: Use pki --ocsp as OCSP responder
Tobias Brunner [Tue, 31 Oct 2023 08:28:33 +0000 (09:28 +0100)] 
testing: Use pki --ocsp as OCSP responder

The only exception is the ikev2/ocsp-no-signer-cert scenario as the
pki command won't sign an OCSP response with a certificate that isn't
the CA certificate or marked as an OCSP signer.

20 months agopki: Pre-process common arguments
Tobias Brunner [Tue, 31 Oct 2023 08:17:05 +0000 (09:17 +0100)] 
pki: Pre-process common arguments

This way the position of --debug doesn't matter for it to apply to the
parsing of all command-specific arguments.

20 months agopki: Add option to load certificate status information from index.txt
Tobias Brunner [Mon, 30 Oct 2023 17:12:12 +0000 (18:12 +0100)] 
pki: Add option to load certificate status information from index.txt

Each index.txt is associated with the most recently loaded CA
certificate.

20 months agopki: Add index.txt-based OCSP responder
Tobias Brunner [Mon, 30 Oct 2023 17:11:53 +0000 (18:11 +0100)] 
pki: Add index.txt-based OCSP responder

20 months agochunk: Add helper to hash chunks via pointer
Tobias Brunner [Mon, 30 Oct 2023 16:57:23 +0000 (17:57 +0100)] 
chunk: Add helper to hash chunks via pointer

20 months agopki: Drop legacy registration for OCSP responders
Tobias Brunner [Mon, 30 Oct 2023 16:50:18 +0000 (17:50 +0100)] 
pki: Drop legacy registration for OCSP responders

20 months agoopenxpki: Register as OCSP responder
Tobias Brunner [Mon, 30 Oct 2023 16:49:34 +0000 (17:49 +0100)] 
openxpki: Register as OCSP responder

20 months agopki: Use OCSP responder manager for --ocsp --respond
Tobias Brunner [Mon, 30 Oct 2023 16:47:34 +0000 (17:47 +0100)] 
pki: Use OCSP responder manager for --ocsp --respond

20 months agolibrary: Add manager for OCSP responders
Tobias Brunner [Mon, 30 Oct 2023 16:34:51 +0000 (17:34 +0100)] 
library: Add manager for OCSP responders

Registered OCSP responders should return VALIDATION_SKIPPED for issuer
certificates they are not responsible for. However, VALIDATION_FAILED is
currently treated the same way, so that's fine as well.

20 months agoMerge branch 'ocsp-responder'
Tobias Brunner [Mon, 13 Nov 2023 11:42:00 +0000 (12:42 +0100)] 
Merge branch 'ocsp-responder'

Implements a new --ocsp command for the pki tool that can produce OCSP
responses based on information provided by a plugin.  A first plugin
that accesses the OpenXPKI database is also added.

Closes strongswan/strongswan#1958

20 months agoman: Extended pki man page and added pki --ocsp man page
Andreas Steffen [Thu, 19 Oct 2023 17:16:05 +0000 (19:16 +0200)] 
man: Extended pki man page and added pki --ocsp man page

20 months agopki: Added ocsp command
Andreas Steffen [Fri, 13 Oct 2023 19:25:19 +0000 (21:25 +0200)] 
pki: Added ocsp command

The pki --ocsp command implements an OCSP responder.

20 months agopki: Added ocsp-req and ocsp-rsp types to pki --print
Andreas Steffen [Mon, 3 Jul 2023 10:42:09 +0000 (12:42 +0200)] 
pki: Added ocsp-req and ocsp-rsp types to pki --print

20 months agounit-tests: Update test_serial_gen suite
Andreas Steffen [Thu, 15 Jun 2023 14:39:25 +0000 (16:39 +0200)] 
unit-tests: Update test_serial_gen suite

20 months agox509: Support generation of OCSP responses
Andreas Steffen [Thu, 15 Jun 2023 13:47:19 +0000 (15:47 +0200)] 
x509: Support generation of OCSP responses

20 months agocertificates: Added ocsp_single_response object
Andreas Steffen [Thu, 15 Jun 2023 13:42:42 +0000 (15:42 +0200)] 
certificates: Added ocsp_single_response object

20 months agoopenxpki: OCSP responder plugin accessing OpenXPKI
Andreas Steffen [Thu, 15 Jun 2023 14:24:34 +0000 (16:24 +0200)] 
openxpki: OCSP responder plugin accessing OpenXPKI

The openxpki plugin directly access the certificates table in
the OpenXPKI's MariaDB in order to retrieve the status of an
issued X.509 certificate based on its serial number.

20 months agocrl-reason: Fixed typo
Andreas Steffen [Thu, 8 Jun 2023 18:38:24 +0000 (20:38 +0200)] 
crl-reason: Fixed typo

20 months agoutils: Added chunk_to_dec() function
Andreas Steffen [Sat, 3 Jun 2023 20:32:19 +0000 (22:32 +0200)] 
utils: Added chunk_to_dec() function

20 months agox509: Support parsing of OCSP requests
Andreas Steffen [Thu, 15 Jun 2023 14:37:45 +0000 (16:37 +0200)] 
x509: Support parsing of OCSP requests

20 months agopki --pkcs7: Set default to res = 1
Andreas Steffen [Fri, 2 Jun 2023 07:06:13 +0000 (09:06 +0200)] 
pki --pkcs7: Set default to res = 1

20 months agokernel-netlink: Don't add replay state twice when updating SAs
Tobias Brunner [Tue, 7 Nov 2023 16:39:51 +0000 (17:39 +0100)] 
kernel-netlink: Don't add replay state twice when updating SAs

The kernel includes the XFRMA_REPLAY_ESN_VAL attribute when dumping
SAs since it was added with 2.6.39.  So we basically added this attribute
twice to the message sent to the kernel, potentially exceeding the
message buffer if the window size is large.

The XFRMA_REPLAY_VAL attribute is only dumped since 3.19, so that might
still be relevant (Google seems to maintain a 3.18 kernel) and since we
have to query the current lifetime stats anyway, we can just avoid adding
this attribute twice.

Closes strongswan/strongswan#1967

20 months agoMerge branch 'uri-san'
Tobias Brunner [Mon, 13 Nov 2023 11:34:32 +0000 (12:34 +0100)] 
Merge branch 'uri-san'

Adds support to encode SANs of type uniformResourceIdentifier in
certificates.  They currently don't have any use in strongSwan, but
might be required for other applications.

Closes strongswan/strongswan#1983

20 months agoidentification: Support explicit uri: prefix for SANs of type uniformResourceIdentifier
Tobias Brunner [Thu, 9 Nov 2023 11:43:44 +0000 (12:43 +0100)] 
identification: Support explicit uri: prefix for SANs of type uniformResourceIdentifier

20 months agox509: Add support to encode SANs of type uniformResourceIdentifier
Tobias Brunner [Thu, 9 Nov 2023 11:42:54 +0000 (12:42 +0100)] 
x509: Add support to encode SANs of type uniformResourceIdentifier

20 months agox509: Use issuer certificate's subjectKeyIdentifier if available
Tobias Brunner [Mon, 6 Nov 2023 17:39:11 +0000 (18:39 +0100)] 
x509: Use issuer certificate's subjectKeyIdentifier if available

Instead of just generating an authorityKeyIdentifier based on the
issuer's public key, this allows CA certificates to be issued by a
different tool that doesn't use a SHA-1 hash of the subjectPublicKey
for the subjectKeyIdentifier.

Closes strongswan/strongswan#1992
References strongswan/strongswan#1975

20 months agoMerge branch 'pkcs12-no-pw'
Tobias Brunner [Mon, 13 Nov 2023 11:27:31 +0000 (12:27 +0100)] 
Merge branch 'pkcs12-no-pw'

This adds support for password-less PKCS#12 containers and PKCS#8 files.

A new option for charon-cmd also allows loading private keys of any
type (previously only RSA keys were supported).

References strongswan/strongswan#1955

20 months agocharon-cmd: Add support for key types other than RSA
Tobias Brunner [Wed, 18 Oct 2023 15:29:25 +0000 (17:29 +0200)] 
charon-cmd: Add support for key types other than RSA

20 months agopkcs12: Add support for PKCS#12 containers with empty or no password
Tobias Brunner [Wed, 18 Oct 2023 15:22:08 +0000 (17:22 +0200)] 
pkcs12: Add support for PKCS#12 containers with empty or no password

20 months agopkcs7: Add supported for unprotected PKCS#7 encrypted-data
Tobias Brunner [Wed, 18 Oct 2023 15:18:49 +0000 (17:18 +0200)] 
pkcs7: Add supported for unprotected PKCS#7 encrypted-data

20 months agopkcs8: Add support for unprotected PKCS#8 containers
Tobias Brunner [Wed, 18 Oct 2023 15:15:44 +0000 (17:15 +0200)] 
pkcs8: Add support for unprotected PKCS#8 containers

20 months agopkcs12: Treat empty string and no password differently
Tobias Brunner [Wed, 18 Oct 2023 15:11:51 +0000 (17:11 +0200)] 
pkcs12: Treat empty string and no password differently

When deriving the PKCS#12 key, the empty string should result in a
non-zero length Unicode string (two bytes for the 0 terminator).

20 months agoopenssl: Add support for unprotected PKCS#12 containers
Tobias Brunner [Wed, 18 Oct 2023 15:01:52 +0000 (17:01 +0200)] 
openssl: Add support for unprotected PKCS#12 containers

20 months agoMerge branch 'x509-ipaddress-constraints'
Tobias Brunner [Mon, 13 Nov 2023 11:23:43 +0000 (12:23 +0100)] 
Merge branch 'x509-ipaddress-constraints'

Adds support for nameConstraints of type iPAddress, which represent a
subnet, to the x509, openssl and constraints plugins.  SANs of type
iPAddress are matched against such constraints.

Closes strongswan/strongswan#1991

20 months agoconstraints: Add support for IP address nameConstraints
Tobias Brunner [Wed, 18 Oct 2023 16:32:48 +0000 (18:32 +0200)] 
constraints: Add support for IP address nameConstraints