]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
20 months agoopenssl: Add support for nameConstraints X.509 extension
Tobias Brunner [Tue, 17 Oct 2023 08:21:28 +0000 (10:21 +0200)] 
openssl: Add support for nameConstraints X.509 extension

Closes strongswan/strongswan#1990

20 months agoMerge branch 'reqid-refcount'
Tobias Brunner [Mon, 13 Nov 2023 11:02:25 +0000 (12:02 +0100)] 
Merge branch 'reqid-refcount'

This fixes issues with CHILD_SAs getting reestablished concurrently.
We intend to reuse the reqid of the previous CHILD_SA, however, previously
the reqids were released and up for reassignment to any other CHILD_SA
or trap policy.  This could cause the reqid to get associated with
completely different traffic selectors, as the reestablished CHILD_SA
would eventually get the requested reqid because the traffic selectors
explicitly don't have to match (to allow narrowing for CHILD_SAs based
on trap policies).

Closes strongswan/strongswan#1855

20 months agoikev2: Correctly maintain allocated reqid during make-before-break reauth
Tobias Brunner [Mon, 2 Oct 2023 14:24:01 +0000 (16:24 +0200)] 
ikev2: Correctly maintain allocated reqid during make-before-break reauth

20 months agotrap-manager: Maintain allocated reqids when handling acquires
Tobias Brunner [Mon, 2 Oct 2023 14:17:33 +0000 (16:17 +0200)] 
trap-manager: Maintain allocated reqids when handling acquires

20 months agoquick-delete: Correctly maintain allocated reqid when recreating CHILD_SA
Tobias Brunner [Mon, 2 Oct 2023 14:10:40 +0000 (16:10 +0200)] 
quick-delete: Correctly maintain allocated reqid when recreating CHILD_SA

20 months agochild-delete: Correctly maintain allocated reqid when recreating CHILD_SA
Tobias Brunner [Mon, 2 Oct 2023 14:08:40 +0000 (16:08 +0200)] 
child-delete: Correctly maintain allocated reqid when recreating CHILD_SA

The old CHILD_SA is destroyed even before the new task is queued, this
makes sure we always maintain a reference to the reqid.

20 months agoike-sa: Correctly maintain allocated reqid when recreating CHILD_SA
Tobias Brunner [Mon, 2 Oct 2023 14:21:28 +0000 (16:21 +0200)] 
ike-sa: Correctly maintain allocated reqid when recreating CHILD_SA

Maintaining the reqid when recreating a CHILD_SA from scratch night not
strictly be necessary as we usually don't have to replace any temporary
states in the kernel.  However, there could be concurrent acquires that
might actually make it necessary (we use the reqid to keep track of
acquires and it's also part of the duplicate check).

20 months agoikev1: Only set reqid on rekeyed CHILD_SA if it was allocated dynamically
Tobias Brunner [Mon, 2 Oct 2023 14:06:48 +0000 (16:06 +0200)] 
ikev1: Only set reqid on rekeyed CHILD_SA if it was allocated dynamically

20 months agochild-rekey: Only set reqid on new CHILD_SA if it was allocated dynamically
Tobias Brunner [Mon, 2 Oct 2023 14:02:08 +0000 (16:02 +0200)] 
child-rekey: Only set reqid on new CHILD_SA if it was allocated dynamically

Keeping a reference ensures that if the old SA expires before the new
one is installed, the previous reqid isn't reallocated to a concurrently
established CHILD_SA with different selectors.

20 months agoquick-mode: Maintain reference to reqid while CHILD_SA is established
Tobias Brunner [Mon, 2 Oct 2023 14:20:01 +0000 (16:20 +0200)] 
quick-mode: Maintain reference to reqid while CHILD_SA is established

20 months agochild-create: Maintain reference to reqid while CHILD_SA is established
Tobias Brunner [Mon, 2 Oct 2023 14:00:07 +0000 (16:00 +0200)] 
child-create: Maintain reference to reqid while CHILD_SA is established

20 months agochild-sa: Add method that returns a reference to an allocated reqid
Tobias Brunner [Mon, 2 Oct 2023 13:08:49 +0000 (15:08 +0200)] 
child-sa: Add method that returns a reference to an allocated reqid

20 months agochild-sa: Keep a reference to the previous reqid
Tobias Brunner [Mon, 2 Oct 2023 13:47:02 +0000 (15:47 +0200)] 
child-sa: Keep a reference to the previous reqid

The reference is kept until the reqid is either confirmed (i.e.
re-allocated) or replaced by a different reqid, which happens only once
we know the final traffic selectors, or the SA is destroyed without
installing it.

20 months agokernel-interface: Add method to increase refcount for allocated reqid
Tobias Brunner [Mon, 2 Oct 2023 12:58:50 +0000 (14:58 +0200)] 
kernel-interface: Add method to increase refcount for allocated reqid

20 months agokernel-interface: Remove unnecessary parameters for release_reqid()
Tobias Brunner [Mon, 2 Oct 2023 12:08:56 +0000 (14:08 +0200)] 
kernel-interface: Remove unnecessary parameters for release_reqid()

These are not included in the initial lookup anymore. Also simplified
the implementation as we always add the same entry to the two hash
tables.

20 months agokernel-interface: Use reqid as sole key in hash table
Tobias Brunner [Mon, 2 Oct 2023 11:59:23 +0000 (13:59 +0200)] 
kernel-interface: Use reqid as sole key in hash table

Every reqid is allocated once, we don't store the same reqid with e.g.
different marks or interface IDs that would make it necessary to make
them part of the key in that table (that's different in the other table).

To preserve the current behavior, that is, allocating a new reqid if e.g.
the marks are different, the additional selector values (which will
result in an additional policy in the Linux kernel) are compared after
the initial lookup.

20 months agocredential-manager: Add option to reject trusted end-entity certificates
Tobias Brunner [Wed, 31 May 2023 12:39:05 +0000 (14:39 +0200)] 
credential-manager: Add option to reject trusted end-entity certificates

This allows preventing peers from authenticating with certificates
that are locally trusted, in particular, our own local certificate (which
safeguards against accidental reuse of certificates on multiple peers).

On the other hand, if this option is enabled, end-entity certificates
for peers can't be configured anymore explicitly (e.g. via remote.certs
in swanctl.conf).

20 months agocert-enroll: Preventing some errors that might occur
Andreas Steffen [Sun, 12 Nov 2023 09:22:38 +0000 (10:22 +0100)] 
cert-enroll: Preventing some errors that might occur

20 months agocert-enroll: Install TLS client/server credentials
Andreas Steffen [Mon, 6 Nov 2023 18:33:25 +0000 (19:33 +0100)] 
cert-enroll: Install TLS client/server credentials

Install the generated key, host certificate and associated CA certificates
as credentials for a TLS-protected client-server connection.

20 months agotls-server: Also change DH group when selecting a different EC curve
Tobias Brunner [Thu, 5 Oct 2023 08:27:18 +0000 (10:27 +0200)] 
tls-server: Also change DH group when selecting a different EC curve

If we initially selected a group the peer doesn't support (e.g. because
curve25519 is the first ECDH group provided by plugins), then found
a supported curve, we previously still instantiated a DH object for the
original group and might have formatted the parameters incorrectly.

20 months agoike-sa: Fix handling of redirects during IKE_AUTH
Tobias Brunner [Thu, 31 Aug 2023 11:45:10 +0000 (13:45 +0200)] 
ike-sa: Fix handling of redirects during IKE_AUTH

Since the referenced commit, the state switch to IKE_ESTABLISHED doesn't
happen immediately after completing the authentication but only after
the remaining tasks have finished.  Due to that redirects during IKE_AUTH
were treated like those during IKE_SA_INIT causing the IKE_SA and task
manager to get reset.  However, unlike the ike-init task, the ike-auth
task returned SUCCESS and, therefore, got destroyed, while a different
task was removed from the array that was modified during the reset.
This later caused a dereference of the freed ike-auth task and a crash.

Fixes: 5ce1c91b58a2 ("ikev2: Trigger ike_updown() event after all IKE-specific tasks ran")
20 months agogithub: Use latest Sonar scanner
Tobias Brunner [Tue, 31 Oct 2023 11:22:35 +0000 (12:22 +0100)] 
github: Use latest Sonar scanner

20 months agoUse wolfSSL 5.6.4 for tests
Tobias Brunner [Tue, 31 Oct 2023 08:41:49 +0000 (09:41 +0100)] 
Use wolfSSL 5.6.4 for tests

21 months agoVersion bump to 5.9.12dr2 5.9.12dr2
Andreas Steffen [Mon, 30 Oct 2023 21:42:55 +0000 (22:42 +0100)] 
Version bump to 5.9.12dr2

21 months agocert-enroll: Pack all source files into EXTRA_DIST
Andreas Steffen [Thu, 26 Oct 2023 13:15:37 +0000 (15:15 +0200)] 
cert-enroll: Pack all source files into EXTRA_DIST

21 months agoMerge branch 'reject-explicit-ecdsa'
Tobias Brunner [Fri, 13 Oct 2023 07:10:56 +0000 (09:10 +0200)] 
Merge branch 'reject-explicit-ecdsa'

There is a relatively recent NIAP requirement to reject certificates with
ECDSA keys that explicitly encode the curve parameters (TD0527, Test 8b).

Since explicit encoding is pretty rare (if used at all and e.g. wolfSSL
already rejects it, by default), we should follow that requirement and
just reject such keys/certificates completely.

This currently can be enforced in all crypto plugins except when using
older versions of OpenSSL (< 1.1.1h) and Botan (< 3.2.0).

Closes strongswan/strongswan#1949
References strongswan/strongswan#1796

21 months agounit-tests: Add a test case for explicit ECDSA parameters
Tobias Brunner [Mon, 17 Jul 2023 10:32:59 +0000 (12:32 +0200)] 
unit-tests: Add a test case for explicit ECDSA parameters

Currently only warns about it as older OpenSSL versions (AppVeyor)
don't reject them.

21 months agoUse Botan 3.2.0 for tests
Tobias Brunner [Thu, 31 Aug 2023 12:46:51 +0000 (14:46 +0200)] 
Use Botan 3.2.0 for tests

This includes a change that allows checking EC keys for explicit
param encoding.

21 months agobotan: Reject EC keys with explicitly encoded parameters
Tobias Brunner [Thu, 31 Aug 2023 12:27:09 +0000 (14:27 +0200)] 
botan: Reject EC keys with explicitly encoded parameters

This requires a function that will be added in the upcoming Botan 3.2
release.

21 months agoopenssl: Reject EC keys with explicitly encoded parameters
Tobias Brunner [Mon, 17 Jul 2023 10:01:06 +0000 (12:01 +0200)] 
openssl: Reject EC keys with explicitly encoded parameters

EC_KEY_decoded_from_explicit_params() was added with 1.1.1h but has been
deprecated with 3.0.

21 months agowolfssl: Reject EC keys with explicitly encoded parameters
Tobias Brunner [Mon, 17 Jul 2023 09:43:47 +0000 (11:43 +0200)] 
wolfssl: Reject EC keys with explicitly encoded parameters

These are not allowed in X.509 certificates according to RFC 5480 and
some newer validations apparently explicitly check for this.

Note that WolfSSL rejects such keys, by default.  Only when compiled with
WOLFSSL_NO_ASN_STRICT are they accepted.

21 months agocert-enroll: Fixed path in cert-install-openxpki
Andreas Steffen [Thu, 12 Oct 2023 06:14:38 +0000 (08:14 +0200)] 
cert-enroll: Fixed path in cert-install-openxpki

21 months agocirrus: Use FreeBSD 12.4
Tobias Brunner [Mon, 9 Oct 2023 12:57:17 +0000 (14:57 +0200)] 
cirrus: Use FreeBSD 12.4

FreeBSD 12.3 is officially EOL.

21 months agocirrus: Use FreeBSD 13.2
Tobias Brunner [Mon, 9 Oct 2023 12:52:25 +0000 (14:52 +0200)] 
cirrus: Use FreeBSD 13.2

This should fix an error thrown by bison:

 ld-elf.so.1: /lib/libc.so.7: version FBSD_1.7 required by /usr/local/bin/bison not found

21 months agoVersion bump to 5.9.12dr2 5.9.12dr1
Andreas Steffen [Wed, 4 Oct 2023 05:59:15 +0000 (07:59 +0200)] 
Version bump to 5.9.12dr2

21 months agocert-enroll: certificate checking and enrollment
Andreas Steffen [Fri, 1 Sep 2023 10:33:09 +0000 (12:33 +0200)] 
cert-enroll: certificate checking and enrollment

The cert-enroll script handles the initial enrollment of an X.509
host certificate with a PKI server via the EST or SCEP protocols.

Run as a systemd timer or via a crontab entry the script daily
checks the expiration date of the host certificate. When a given
deadline is reached, the host certificate is automatically renewed
via EST or SCEP re-enrollment based on the possession of the old
private key and the matching certificate.

22 months agoike-sa: Destroy CHILD_SAs in order
Tobias Brunner [Thu, 7 Sep 2023 15:33:00 +0000 (17:33 +0200)] 
ike-sa: Destroy CHILD_SAs in order

This works around an issue that occurs when recreating an IKE_SA with
multiple CHILD_SAs that use dynamically allocated reqids.

We currently try to preserve the reqid when reestablishing, so the
create-child task gets the reqid of the previous CHILD_SA and will try
to reallocate that once the CHILD_SA is installed.  Before that, the old
CHILD_SA is destroyed and the reqid is released and added to the array
of reqids to get reused.  However, because of the reverse order used here,
the first reqid in the array is the one of the last CHILD_SA.

So it can happen that a newly created CHILD_SA gets a reqid reassigned
that a later CHILD_SA will then also claim for itself and get assigned
because an entry with that reqid exists.  So multiple CHILD_SAs with
different traffic selectors could then share the same reqid.

References strongswan/strongswan#1855

22 months agolibipsec: Also install routes without preferred source to forward traffic
Boi Sletterink [Thu, 29 Jun 2023 15:39:37 +0000 (17:39 +0200)] 
libipsec: Also install routes without preferred source to forward traffic

Fixes a problem installing policies with source traffic selectors that do
not contain/match any of the local addresses.

When installing a route for a source TS that does contain one or more
local addresses, a preferred source address should be set in the route
(analogous to the `src` option in `ip route add`). This address is used
when the host itself sends traffic via that route (in contrast to
forwarding it).

When the source TS does not encompass any of the local addresses, the
host is not allowed to send traffic via this route and does not need to
set the preferred source address. However, the code would just return a
failure because it could not find a matching local address. This commit
changes this so routes without preferred source IP are installed to
allow non-local traffic to get forwarded via TUN device.

Closes strongswan/strongswan#1766

22 months agoconfigure: Fix in6_pktinfo auto detection
Antony Antony [Mon, 4 Sep 2023 09:18:23 +0000 (11:18 +0200)] 
configure: Fix in6_pktinfo auto detection

This commit fixes auto detection of in6_pktinfo.
When negotiating an IPv6 IKE session charon reported an error

"Jun 30 16:42:49 03[NET] error reading IP header"

The cause of error was missing in6_pktinfo declaration, which is
auto detected. This auto detection may fail with an error depending
on compiler flags:

configure:19850: checking for in6_pktinfo
configure:19870: gcc -c -g -O0 -Wall -Wno-format -Wno-format-security
-Wno-pointer-sign -Werror -Wfatal-errors -Wno-error=stringop-truncation
conftest.c >&5
conftest.c: In function 'main':
conftest.c:73:11: error: 'pi.ipi6_ifindex' is used uninitialized in this
function [-Werror=uninitialized]
   73 |     if (pi.ipi6_ifindex)
      |         ~~^~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors

Signed-off-by: Antony Antony <antony.antony@secunet.com>
23 months agovici: Fix connecting to socket in Python bindings on Windows
Tobias Brunner [Thu, 31 Aug 2023 09:39:52 +0000 (11:39 +0200)] 
vici: Fix connecting to socket in Python bindings on Windows

socket.connect() takes a single argument with the address that depends
on the address family, for TCP it's a tuple with IP and port.

Fixes: 00a75e332f29 ("vici: Create default TCP socket on Windows in Python bindings")
Closes strongswan/strongswan#1874

23 months agoandroid: New release after updating target SDK to 33 android-2.4.2
Tobias Brunner [Tue, 29 Aug 2023 16:09:33 +0000 (18:09 +0200)] 
android: New release after updating target SDK to 33

23 months agoandroid: Increase compile-/targetSdkVersion to 33 (Android 13)
Tobias Brunner [Tue, 29 Aug 2023 15:57:29 +0000 (17:57 +0200)] 
android: Increase compile-/targetSdkVersion to 33 (Android 13)

23 months agoandroid: Request permission to display notifications on Android 13
Tobias Brunner [Tue, 29 Aug 2023 15:45:32 +0000 (17:45 +0200)] 
android: Request permission to display notifications on Android 13

Note that displaying the notification for the background service is
apparently not strictly necessary.  So it's fine if the user wants to
hide it.  That the service is running can still be seen in the task
manager (pull down the status drawer twice, there is a bullet with a number
at the bottom if the service is running).

Simply use the system dialog.  If the user denies it twice, it won't show
up again.  The explanation dialog would not show up the first time (i.e.
shouldShowRequestPermissionRationale() returns false), only once the user
denied the permission once.  Currently seems like a bit much work
as we don't need the user to allow notifications.

23 months agoandroid: Compile OpenSSL with hardware acceleration
Tobias Brunner [Tue, 29 Aug 2023 15:41:46 +0000 (17:41 +0200)] 
android: Compile OpenSSL with hardware acceleration

23 months agoandroid: Use new sockets to determine source IP
Tobias Brunner [Wed, 17 May 2023 08:17:14 +0000 (10:17 +0200)] 
android: Use new sockets to determine source IP

Particularly on Samsung devices, the connect() call to dissolve the
previous connection on an existing socket via AF_UNSPEC does fail in
some situations with ECONNREFUSED:

  [KNL] failed to disconnect socket: Connection refused

While creating a new socket is potentially a bit more overhead, this
should avoid the issue.

Closes strongswan/strongswan#1691

23 months agotesting: Use pip from venv to download dependencies
Tobias Brunner [Mon, 28 Aug 2023 15:49:26 +0000 (17:49 +0200)] 
testing: Use pip from venv to download dependencies

pip3 isn't installed in the base image anymore since 21bf3e41f94a
("testing: Use venv for strongTNC").

2 years agokernel-pfroute: Maintain virtual flag when repopulating interface addrs
Tobias Brunner [Tue, 25 Jul 2023 08:21:40 +0000 (10:21 +0200)] 
kernel-pfroute: Maintain virtual flag when repopulating interface addrs

When adding a virtual IP on a TUN interface, the interface might get
activated (in terms of receiving the event) after we've already set the
virtual flag for the added address.  As the activation repopulates the
addresses on the interface, this cleared the flag and the address would
no longer be treated as virtual IP when installing routes for CHILD_SAs
that reference it in their local traffic selectors.

Closes strongswan/strongswan#1807

2 years agoMerge branch 'netlink-buf'
Tobias Brunner [Wed, 26 Jul 2023 13:15:24 +0000 (15:15 +0200)] 
Merge branch 'netlink-buf'

Fixes an infinite loop if e.g. Netlink event sockets get too many
packets queued and poll() just returns POLLERR for the socket.  Also
increases the default receive buffer size for Netlink sockets to better
support systems with lots of route updates.

Closes strongswan/strongswan#1757

2 years agowatcher: Change handling of POLLERR and remove WATCHER_EXCEPT
Tobias Brunner [Fri, 21 Jul 2023 08:01:41 +0000 (10:01 +0200)] 
watcher: Change handling of POLLERR and remove WATCHER_EXCEPT

We can't actually explicitly listen for errors by passing POLLERR in
`events` (the man page for poll() clearly states it's ignored).  On the
other hand, POLLERR can be returned for any FD and, even worse, it might
be the only event indicated.

The latter caused an infinite loop as we didn't notify the callback nor
clear the error by calling `getsockopt(..., SOL_SOCKET, SO_ERROR, ...)`.
And while the latter would be able to reset the state to break the loop,
it seems to leave the FD in a defunct state where no further events will
be returned by poll().  Notifying the callback works better (the error
is then reported by e.g. recvfrom()) and automatically happened already
if POLLERR was returned together with e.g. POLLIN.

So we now treat POLLERR like the other error indicators we handle (POLLHUP
and POLLINVAL) and just notify the callbacks.

2 years agokernel-netlink: Also set the receive buffer size on event sockets
Tobias Brunner [Fri, 21 Jul 2023 07:39:09 +0000 (09:39 +0200)] 
kernel-netlink: Also set the receive buffer size on event sockets

This was weirdly overlooked and could cause issues e.g. on hosts with
lots of route changes.

2 years agokernel-netlink: Increase the default receive buffer size
Tobias Brunner [Fri, 21 Jul 2023 07:34:22 +0000 (09:34 +0200)] 
kernel-netlink: Increase the default receive buffer size

Also simplify how we try to exceed the system-wide maximum.  We basically
just try to force the value and simply fall back to the regular call.
The kernel actually won't let the latter fail if the value is too big,
it just caps it at the internal maximum.

2 years agoike: Fix untracking IKE_SA_INITs with non-zero MIDs and SPIs as half-open SAs
Tobias Brunner [Wed, 5 Jul 2023 08:41:11 +0000 (10:41 +0200)] 
ike: Fix untracking IKE_SA_INITs with non-zero MIDs and SPIs as half-open SAs

We track all IKE_SA_INIT requests as half-open IKE_SAs but didn't
correctly untrack them if their message ID or responder SPI was non-zero.

References strongswan/strongswan#1775

Fixes: b866ee88bf54 ("ike: Track unprocessed initial IKE messages like half-open IKE_SAs")
2 years agochild-rekey: Correctly encode protocol/SPI in CHILD_SA_NOT_FOUND notify
Tobias Brunner [Wed, 21 Jun 2023 13:57:38 +0000 (15:57 +0200)] 
child-rekey: Correctly encode protocol/SPI in CHILD_SA_NOT_FOUND notify

As specified in RFC 7296, section 2.25:

   The SA that the initiator attempted to rekey is indicated by the SPI
   field in the Notify payload, which is copied from the SPI field in
   the REKEY_SA notification.

So we copy that and the protocol verbatim.

2 years agonotify-payload: Add methods to simplify encoding and retrieving IKE SPIs
Tobias Brunner [Thu, 16 Mar 2023 14:42:11 +0000 (15:42 +0100)] 
notify-payload: Add methods to simplify encoding and retrieving IKE SPIs

The get_spi_data() method is currently not used, so that has been
simplified so it can be used for any protocol type and any SPI length.
Same for set_spi_data(), which is currently used for IKEv1 to encode
two SPIs.

2 years agosha3: Make sure to wipe the internal Keccak state
Tobias Brunner [Tue, 11 Jul 2023 09:59:46 +0000 (11:59 +0200)] 
sha3: Make sure to wipe the internal Keccak state

2 years agopki: Make sure to wipe decrypted PKCS#7 data
Tobias Brunner [Tue, 11 Jul 2023 09:44:35 +0000 (11:44 +0200)] 
pki: Make sure to wipe decrypted PKCS#7 data

2 years agopkcs12: Make sure to wipe potentially decrypted PKCS#7 data
Tobias Brunner [Tue, 11 Jul 2023 09:44:11 +0000 (11:44 +0200)] 
pkcs12: Make sure to wipe potentially decrypted PKCS#7 data

2 years agopkcs7: Make sure to wipe decrypted content
Tobias Brunner [Tue, 11 Jul 2023 09:39:49 +0000 (11:39 +0200)] 
pkcs7: Make sure to wipe decrypted content

2 years agoaesni: Make sure to wipe salt
Tobias Brunner [Tue, 11 Jul 2023 09:35:09 +0000 (11:35 +0200)] 
aesni: Make sure to wipe salt

2 years agoccm: Make sure to wipe salt
Tobias Brunner [Tue, 11 Jul 2023 09:34:48 +0000 (11:34 +0200)] 
ccm: Make sure to wipe salt

2 years agogcm: Make sure to wipe salt and H
Tobias Brunner [Tue, 11 Jul 2023 09:30:44 +0000 (11:30 +0200)] 
gcm: Make sure to wipe salt and H

2 years agocharon-nm: Use configured interface name if available
Tobias Brunner [Fri, 23 Jun 2023 10:13:31 +0000 (12:13 +0200)] 
charon-nm: Use configured interface name if available

If connection.interface-name is configured, we use that instead of the
randomly generated name.

References strongswan/strongswan#1747

2 years agocharon-nm: Also log basic connection details
Tobias Brunner [Fri, 23 Jun 2023 10:07:34 +0000 (12:07 +0200)] 
charon-nm: Also log basic connection details

2 years agocharon-nm: Actually use the created XFRM interface
Tobias Brunner [Fri, 23 Jun 2023 10:04:14 +0000 (12:04 +0200)] 
charon-nm: Actually use the created XFRM interface

The created XFRM interface was not actually used (no interface IDs on the
SAs, no routes via interface).  It was basically treated like the dummy
TUN device.  To actually install the routes via XFRM interface, we have
to create it before we install the SAs and policies, signal_ip_config()
happens too late.  We also have to mark the ESP packets the same as IKE
the packets to avoid a routing loop if the server's IP is included in
the remote traffic selector (in particular if it's 0.0.0.0/0 or ::/0).

Fixes: 58f278f93239 ("charon-nm: Use an XFRM interface if available")
2 years agoUse Botan 3.1.1 for tests
Tobias Brunner [Fri, 14 Apr 2023 07:30:35 +0000 (09:30 +0200)] 
Use Botan 3.1.1 for tests

The all-zero Ed25519 public key is rejected by botan_pubkey_check_key()
when the key is loaded.

Note that Botan 3 requires GCC 11 or CLANG 14, i.e. can't easily be built
on Debian bullseye or Ubuntu 20.04.

The thread-local storage function gets flagged via various botan FFI
functions when using Botan 3, whitelist that instead of all of them.

2 years agoMerge branch 'testing-bookworm'
Tobias Brunner [Wed, 26 Jul 2023 11:07:37 +0000 (13:07 +0200)] 
Merge branch 'testing-bookworm'

Use Debian bookworm as base image for testing.

2 years agotesting: Format total time in a more readable way
Tobias Brunner [Wed, 26 Jul 2023 11:05:56 +0000 (13:05 +0200)] 
testing: Format total time in a more readable way

2 years agotesting: Change memory allocation for alice and winnetou and switch to MiB
Tobias Brunner [Fri, 14 Jul 2023 12:30:14 +0000 (14:30 +0200)] 
testing: Change memory allocation for alice and winnetou and switch to MiB

The services running on alice seem to require a bit more memory with
Debian bookworm, so increase the memory allocation.  But at the same
time reduce winnetou's allocation by the same amount as it really doesn't
require that much memory.

The unit change makes it easier to read.

2 years agotesting: Hardcode /testresults mount point in winnetou's fstab
Tobias Brunner [Thu, 20 Jul 2023 13:29:35 +0000 (15:29 +0200)] 
testing: Hardcode /testresults mount point in winnetou's fstab

Because do-tests runs the restore-defaults script, fstab would get reset
to the default version and the mount point wouldn't be available anymore
after stopping and restarting the guests (unless the guest images were
rebuilt in between).

2 years agotesting: Copy guest-specific files after default files
Tobias Brunner [Thu, 20 Jul 2023 13:28:51 +0000 (15:28 +0200)] 
testing: Copy guest-specific files after default files

This allows overriding some files per guest.

2 years agotesting: Use Debian 12 (bookworm)
Tobias Brunner [Wed, 28 Jun 2023 13:56:28 +0000 (15:56 +0200)] 
testing: Use Debian 12 (bookworm)

2 years agotesting: Use Debian bookworm to test TKM
Tobias Brunner [Thu, 13 Jul 2023 08:47:51 +0000 (10:47 +0200)] 
testing: Use Debian bookworm to test TKM

2 years agotesting: Update TKM dependencies to fix compilation with newer GNAT versions
Tobias Brunner [Wed, 28 Jun 2023 13:55:21 +0000 (15:55 +0200)] 
testing: Update TKM dependencies to fix compilation with newer GNAT versions

2 years agotesting: Add support for Debian bookworm base images
Tobias Brunner [Wed, 28 Jun 2023 13:54:54 +0000 (15:54 +0200)] 
testing: Add support for Debian bookworm base images

By default, rsyslog is not installed anymore to avoid storing everything
twice (since journald is the default).  If this becomes an issue, we
could delete /var/log/journal to only log via rsyslog.

2 years agotesting: Use venv for strongTNC
Tobias Brunner [Wed, 28 Jun 2023 13:52:57 +0000 (15:52 +0200)] 
testing: Use venv for strongTNC

Also updated to a newer version to fix dependency issues.

2 years agotesting: Install python-daemon via Debian package
Tobias Brunner [Wed, 28 Jun 2023 13:49:32 +0000 (15:49 +0200)] 
testing: Install python-daemon via Debian package

System-wide installation via pip isn't easily possible anymore on Debian
bookworm, so just use the Debian package for this (is available in old
releases as well).

2 years agolibimcv: Add Debian 12 (bookworm) to database
Tobias Brunner [Tue, 27 Jun 2023 17:03:32 +0000 (19:03 +0200)] 
libimcv: Add Debian 12 (bookworm) to database

Because libcrypto and libssl are measured, we need a new group for Debian
versions with OpenSSL 3 (I've rather added a suffix to the old group as
that could eventually get removed, although we might need a 3.1 variant
in the future - maybe we should measure some other files?).

2 years agotesting: Fix vici updown script on Debian bookworm
Tobias Brunner [Tue, 27 Jun 2023 16:45:53 +0000 (18:45 +0200)] 
testing: Fix vici updown script on Debian bookworm

OOM-killer is now already triggered with `import daemon`, so set the
limit before that.  Also some PEP8 fixes (including an exclusion for
the above fix as that causes imports to not be at the beginning of the
file).

2 years agotesting: Whitelist all Git repositories in the root image
Tobias Brunner [Tue, 27 Jun 2023 16:41:42 +0000 (18:41 +0200)] 
testing: Whitelist all Git repositories in the root image

Without this, Git refuses to operate on the build dirs that are mounted
with weird ownership.  When running as root in the chroot, Git checks
SUDO_UID, which won't match.

2 years agotesting: Create traditional RSA keys with OpenSSL 3
Tobias Brunner [Tue, 27 Jun 2023 16:40:24 +0000 (18:40 +0200)] 
testing: Create traditional RSA keys with OpenSSL 3

This is necessary because TKM can't read PKCS#8 files and in some
scenarios we don't have the pkcs8 plugin loaded that would be required
to read/decrypt the non-traditional files.

2 years agotesting: Fix systemctl wrapper and adapt enabling services on winnetou
Tobias Brunner [Tue, 27 Jun 2023 16:01:29 +0000 (18:01 +0200)] 
testing: Fix systemctl wrapper and adapt enabling services on winnetou

The wrapper called the command twice for any unit but "strongswan" and
it didn't return the correct exit code.  This was noticed when an
if-updown script tried to check if systemd-resolved is active and always
succeeded, which caused failing attempts to configure it.

But now that the return code is correct, trying to enable bind9 won't
fail silently anymore if the unit doesn't exist (similar on older systems
for named), so this is adapted.

2 years agotesting: Remove support for Debian stretch
Tobias Brunner [Mon, 26 Jun 2023 12:36:03 +0000 (14:36 +0200)] 
testing: Remove support for Debian stretch

2 years agoleak-detective: Whitelist C++'s __cxa_get_globals()
Tobias Brunner [Mon, 26 Jun 2023 12:30:01 +0000 (14:30 +0200)] 
leak-detective: Whitelist C++'s __cxa_get_globals()

2 years agotesting: Switch to MDB backend for OpenLDAP (slapd)
Tobias Brunner [Mon, 26 Jun 2023 12:25:35 +0000 (14:25 +0200)] 
testing: Switch to MDB backend for OpenLDAP (slapd)

The BDB and HDB backends were long deprecated and have finally been
removed with OpenLDAP 2.5 that's shipped with Debian bookworm.

2 years agotesting: Configure curve25519-sha256 as key exchange for SSH
Tobias Brunner [Mon, 26 Jun 2023 12:20:14 +0000 (14:20 +0200)] 
testing: Configure curve25519-sha256 as key exchange for SSH

With Debian bookworm, the PQC KE sntrup761x25519-sha512 is negotiated, by
default.  This increases the overhead significantly, in particular, the
size of the KE message, which wouldn't get through IPsec tunnels without
MSS clamping.

2 years agosonarcloud: Update filter rules as recommended
Tobias Brunner [Wed, 12 Jul 2023 09:21:27 +0000 (11:21 +0200)] 
sonarcloud: Update filter rules as recommended

2 years agotesting: Fix example configure options for charon-tkm Docker build
Tobias Brunner [Tue, 11 Jul 2023 16:02:13 +0000 (18:02 +0200)] 
testing: Fix example configure options for charon-tkm Docker build

Fixes: b1ce8772367f ("charon-tkm: Use built-in plugins instead of OpenSSL")
2 years agoUse wolfSSL 5.6.3 for tests
Tobias Brunner [Wed, 21 Jun 2023 13:31:53 +0000 (15:31 +0200)] 
Use wolfSSL 5.6.3 for tests

2 years agodhcp: Fix warning with newer compilers
Tobias Brunner [Fri, 16 Jun 2023 07:35:12 +0000 (09:35 +0200)] 
dhcp: Fix warning with newer compilers

2 years agoresolve: Maintain order of DNS servers also when installing in resolv.conf
Tobias Brunner [Fri, 16 Jun 2023 11:46:17 +0000 (13:46 +0200)] 
resolve: Maintain order of DNS servers also when installing in resolv.conf

This always writes the complete set of DNS servers to make modifications
simpler.

2 years agoresolve: Try to maintain the order of DNS servers if using resolvconf
Tobias Brunner [Thu, 15 Jun 2023 15:54:08 +0000 (17:54 +0200)] 
resolve: Try to maintain the order of DNS servers if using resolvconf

Since 17fd304e60df ("resolve: Don't install individual servers via
resolvconf"), DNS servers were sorted if getting installed via resolvconf.
In some setups the order might be important (even though relying on it
isn't a good idea in general as stub resolvers are free to use all of
the servers as they please).

2 years agocharon-svc: Add missing closing parenthesis in version output
Tobias Brunner [Mon, 19 Jun 2023 12:54:06 +0000 (14:54 +0200)] 
charon-svc: Add missing closing parenthesis in version output

2 years agoUse wolfSSL 5.6.2 for tests
Tobias Brunner [Tue, 13 Jun 2023 08:13:10 +0000 (10:13 +0200)] 
Use wolfSSL 5.6.2 for tests

ECC keys can now be smaller so we can't access the private key directly
anymore.

2 years agoVersion bump to 5.9.11 5.9.11
Andreas Steffen [Mon, 12 Jun 2023 05:50:02 +0000 (07:50 +0200)] 
Version bump to 5.9.11

2 years agoVersion bump to 5.9.11rc1 5.9.11rc1
Andreas Steffen [Thu, 8 Jun 2023 08:42:17 +0000 (10:42 +0200)] 
Version bump to 5.9.11rc1

2 years agoNEWS: Add news for 5.9.11
Tobias Brunner [Fri, 2 Jun 2023 13:46:57 +0000 (15:46 +0200)] 
NEWS: Add news for 5.9.11

2 years agopki: Add --label options to --est* command synopsis
Tobias Brunner [Fri, 2 Jun 2023 10:55:07 +0000 (12:55 +0200)] 
pki: Add --label options to --est* command synopsis

Also fixes some formatting in the man pages.

2 years agogithub: Use new cache storage properties for sonarcloud
Tobias Brunner [Fri, 2 Jun 2023 09:37:06 +0000 (11:37 +0200)] 
github: Use new cache storage properties for sonarcloud

2 years agoopenssl: Fix memory leak if FIPS provider isn't available
Tobias Brunner [Fri, 2 Jun 2023 09:27:39 +0000 (11:27 +0200)] 
openssl: Fix memory leak if FIPS provider isn't available

2 years agoFixed some typos, courtesy of codespell
Tobias Brunner [Fri, 2 Jun 2023 08:19:32 +0000 (10:19 +0200)] 
Fixed some typos, courtesy of codespell