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

This reverts commit 942c696a9214d3a4442ed5b7151f62485e6d1bce.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

wip: several FIXMEs

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

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

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

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

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

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

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

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

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

The combination probably doesn't make much sense.

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

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

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

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

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

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

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

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

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

wip: the API is still under development

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

7 months agonotify-payload: Add notify types for per-resource CHILD_SAs
Tobias Brunner [Tue, 11 May 2021 12:21:25 +0000 (14:21 +0200)] 
notify-payload: Add notify types for per-resource CHILD_SAs

7 months agoMerge branch 'tun-device-ipv6'
Tobias Brunner [Wed, 25 Sep 2024 14:12:49 +0000 (16:12 +0200)] 
Merge branch 'tun-device-ipv6'

Adds support for IPv6 addresses on TUN devices, in particular, to support
virtual IPv6 addresses on FreeBSD/macOS.

Closes strongswan/strongswan#2465

7 months agokernel-pfroute: Route via interface if we don't have a next hop
Tobias Brunner [Tue, 28 Sep 2021 08:10:04 +0000 (10:10 +0200)] 
kernel-pfroute: Route via interface if we don't have a next hop

Compared to RTA_IFP, the format is different when passing an interface
as RTA_GATEWAY, it requires the interface's address and not its name.

7 months agotun-device: Fix handling of IPv6 addresses
Tobias Brunner [Fri, 27 Aug 2021 16:18:09 +0000 (18:18 +0200)] 
tun-device: Fix handling of IPv6 addresses

struct ifreq can't be used for IPv6 as the ifr_addr member is not large
enough.  Actually, configuring an IPv6 address via an AF_INET socket won't
work anyway.  And unfortunately, it's not standardized how IPv6 addresses
are installed, so we have to do this quite differently on Linux and on BSD.
However, we already use SIOCAIFADDR for IPv4 on newer FreeBSD systems,
which wasn't the case when this patch was originally created in 2014.

7 months agoMerge branch 'tkm-multi-ke'
Tobias Brunner [Thu, 19 Sep 2024 13:20:31 +0000 (15:20 +0200)] 
Merge branch 'tkm-multi-ke'

Adds support for multiple key exchanges to charon-tkm.

7 months agotesting: Add TKM scenarios with multiple key exchanges
Tobias Brunner [Wed, 17 Nov 2021 13:43:38 +0000 (14:43 +0100)] 
testing: Add TKM scenarios with multiple key exchanges

7 months agocharon-tkm: Add tests with multiple key exchanges
Tobias Brunner [Wed, 24 Nov 2021 14:53:19 +0000 (15:53 +0100)] 
charon-tkm: Add tests with multiple key exchanges

7 months agocharon-tkm: Adapt to interface changes to support multiple key exchanges
Stefan Berghofer [Thu, 29 Jul 2021 14:25:15 +0000 (14:25 +0000)] 
charon-tkm: Adapt to interface changes to support multiple key exchanges

Also includes ESA flags.

Co-authored-by: Tobias Brunner <tobias@strongswan.org>
7 months agoMerge branch 'vici-reload-tasks'
Tobias Brunner [Thu, 19 Sep 2024 08:11:49 +0000 (10:11 +0200)] 
Merge branch 'vici-reload-tasks'

Consider queued child-creating tasks when reloading configs that have
`start` as start action.  Besides some possible corner cases it fixes
handling IKE_SAs that are current getting established and have no
established CHILD_SAs yet.

Closes strongswan/strongswan#2418

7 months agovici-config: Consider queued tasks when terminating IKE/CHILD_SAs
Tobias Brunner [Tue, 3 Sep 2024 14:15:02 +0000 (16:15 +0200)] 
vici-config: Consider queued tasks when terminating IKE/CHILD_SAs

This is particularly important for IKE_SAs that are not yet established,
which would get terminated as they have no established CHILD_SAs yet.

Fixes: 72f9a21b22e9 ("Merge branch 'vici-reload-actions'")
7 months agoquick-mode: Allow "aborting" task if it's currently active
Tobias Brunner [Tue, 3 Sep 2024 14:09:54 +0000 (16:09 +0200)] 
quick-mode: Allow "aborting" task if it's currently active

Basically the same as the previous commit.

7 months agochild-create: Allow "aborting" task if it's currently active
Tobias Brunner [Tue, 3 Sep 2024 14:05:44 +0000 (16:05 +0200)] 
child-create: Allow "aborting" task if it's currently active

We can't actually abort an active exchange, but we can delete the SA
immediately after its creation.

7 months agoquick-mode: Add getter for child config
Tobias Brunner [Tue, 3 Sep 2024 12:51:28 +0000 (14:51 +0200)] 
quick-mode: Add getter for child config

7 months agochild-create: Add getter for child config
Tobias Brunner [Tue, 3 Sep 2024 12:51:46 +0000 (14:51 +0200)] 
child-create: Add getter for child config

7 months agochecksum: Avoid compiler warning/error when building monolithic
Tobias Brunner [Fri, 6 Sep 2024 08:16:10 +0000 (10:16 +0200)] 
checksum: Avoid compiler warning/error when building monolithic

References strongswan/strongswan#2446

7 months agogithub: Update AWS-LC to 1.35.0 for tests
Tobias Brunner [Wed, 18 Sep 2024 06:49:52 +0000 (08:49 +0200)] 
github: Update AWS-LC to 1.35.0 for tests

7 months agoarray: Don't use realloc() with zero size in array_compress()
Thomas Egerer [Fri, 6 Sep 2024 11:29:40 +0000 (13:29 +0200)] 
array: Don't use realloc() with zero size in array_compress()

The behavior of realloc(3) with zero size was apparently implementation
defined.  While glibc documents the behavior as equivalent to free(3),
that might not apply to other C libraries.  With C17, this behavior has
been deprecated, and with C23, the behavior is now undefined.  It's also
why valgrind warns about this use.

Hence, when array_compress() would call realloc() with a zero size, we
now call free() explicitly and set the pointer to NULL.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
8 months agocert-enroll: Fixed typo
Andreas Steffen [Sat, 7 Sep 2024 15:13:00 +0000 (17:13 +0200)] 
cert-enroll: Fixed typo

This typo prevented the cert-enroll script from successfully
signalling a detected change of the sub CA certificate.

8 months agogithub: Use more verbose output for apt-get calls
Tobias Brunner [Thu, 5 Sep 2024 08:46:39 +0000 (10:46 +0200)] 
github: Use more verbose output for apt-get calls

With -qq we don't see any detailed error messages.

8 months agoike-cfg: Only consider port information if the IP matches
Tobias Brunner [Wed, 4 Sep 2024 13:08:47 +0000 (15:08 +0200)] 
ike-cfg: Only consider port information if the IP matches

Otherwise, all configs would be considered to even some degree as the
ports usually match.

Closes strongswan/strongswan#2441

Fixes: 9228a5109b8d ("ike-cfg: Consider port information in IKE config match")
9 months agokey-exchange: Pass prefix array directly, not a pointer to it
Tobias Brunner [Thu, 8 Aug 2024 09:19:16 +0000 (11:19 +0200)] 
key-exchange: Pass prefix array directly, not a pointer to it

9 months agochild-create: Remove redundant variable assignment
Tobias Brunner [Thu, 8 Aug 2024 09:18:24 +0000 (11:18 +0200)] 
child-create: Remove redundant variable assignment

9 months agoMerge branch 'multi-ke'
Tobias Brunner [Wed, 7 Aug 2024 14:20:42 +0000 (16:20 +0200)] 
Merge branch 'multi-ke'

This adds support for multiple key exchanges (no KEMs yet as none are
standardized so far).  Work on this started over five years ago and went
through multiple iterations (first our own protocol, then standardized
extensions in different variations).

IKE_INTERMEDIATE exchanges, defined RFC 9242, are used to transport
multiple KE payloads between the IKE_SA_INIT and IKE_AUTH exchanges.
To rekey IKE and CHILD_SAs with multiple key exchanges, IKE_FOLLOWUP_KE
exchanges are used, as defined in RFC 9370.

In proposals, additional key exchange methods are configured via `keX_`
prefix, where X is a number between 1 and 7.  For example, `ke1_ecp256`
adds ECP_256 as additional KE method.  As with regular key exchanges,
peers have to agree on a method for each round unless no algorithms are
defined by both or `keX_none` is configured to make that round explicitly
optional.

Also changed is how rekey collisions are handled, which makes CHILD_SAs
properly trackable via child_rekey() hook.

9 months agotesting: Add ikev2/rw-cert-multi-ke scenario
Tobias Brunner [Thu, 6 Jun 2024 15:48:38 +0000 (17:48 +0200)] 
testing: Add ikev2/rw-cert-multi-ke scenario

9 months agounit-tests: Ensure listeners can track SAs via ike/child_updown/rekey()
Tobias Brunner [Fri, 9 Sep 2022 16:34:29 +0000 (18:34 +0200)] 
unit-tests: Ensure listeners can track SAs via ike/child_updown/rekey()

Previously, it could happen that child_rekey() was triggered twice for
the same "old" SA.  For listeners that would mean they'd loose track as
they'd be tracking a new SA that wasn't relevant anymore and for which
no updown event would ever get triggered (it was the redundant SA in a
collision).  This new assert ensures that events are triggered in a
predictable way and listeners can track SAs properly.

9 months agoikev2: Make CHILD_SAs properly trackable during rekey collisions
Tobias Brunner [Mon, 22 Aug 2022 13:43:16 +0000 (15:43 +0200)] 
ikev2: Make CHILD_SAs properly trackable during rekey collisions

As the winner of a rekey collision, we previously always triggered the
child_rekey() event once when creating the redundant SA on behalf of the
peer in the passive child-rekey task and then a second time when
creating the winning SA in the active task.  However, both calls passed
the replaced CHILD_SA as "old". This made tracking CHILD_SAs impossible
because there was no transition from the redundant, "new" SA of the
first event to the "new", winning SA of the second.  Of course, when the
second event was triggered, the redundant SA might not have existed
anymore because the peer is expected to delete it, which could happen
before the CREATE_CHILD_SA response arrives at the initiator.

This refactoring ensures that the child_rekey() event is triggered in
a way that makes the CHILD_SAs trackable in all reasonable (and even
some unreasonable) scenarios.  The event is generally only triggered
once after installing the outbound SA for the new/winning CHILD_SA.
This can be when processing the CREATE_CHILD_SA in the active child-rekey
task, or when processing the DELETE for the old SA in a passive
child-delete task.  There are some cases where the event is still
triggered twice, but it is now ensured that listeners can properly
transition to the winning SA.

Some corner cases are now also handled correctly, e.g. if a responder's
DELETE for the new CHILD_SA arrives before its CREATE_CHILD_SA response
that actually creates it on the initiator.  Also handled properly are
responders of rekeyings that incorrectly send a DELETE for the old
CHILD_SA (previously this caused both, the new and the old SA, to get
deleted).

9 months agoike-init: Indicate support for IKE_INTERMEDIATE
Tobias Brunner [Tue, 5 Nov 2019 15:42:58 +0000 (16:42 +0100)] 
ike-init: Indicate support for IKE_INTERMEDIATE

9 months agoproposal: Prevent selection of duplicate key exchange methods
Tobias Brunner [Fri, 16 Jul 2021 11:52:19 +0000 (13:52 +0200)] 
proposal: Prevent selection of duplicate key exchange methods

All additional (and the initial) key exchanges must use a different method.

9 months agoproposal: Add helper to check if additional key exchanges are contained
Tobias Brunner [Tue, 5 Nov 2019 16:03:42 +0000 (17:03 +0100)] 
proposal: Add helper to check if additional key exchanges are contained

9 months agoproposal: Accept NONE for additional key exchanges also for IKE proposals
Tobias Brunner [Thu, 22 Oct 2020 11:13:00 +0000 (13:13 +0200)] 
proposal: Accept NONE for additional key exchanges also for IKE proposals

9 months agounit-tests: Add tests for CHILD_SA rekeying with multiple key exchanges
Tobias Brunner [Mon, 29 Jun 2020 12:13:53 +0000 (14:13 +0200)] 
unit-tests: Add tests for CHILD_SA rekeying with multiple key exchanges

9 months agounit-tests: Add tests for CHILD_SA creation with multiple key exchanges
Tobias Brunner [Fri, 26 Jun 2020 12:12:47 +0000 (14:12 +0200)] 
unit-tests: Add tests for CHILD_SA creation with multiple key exchanges

9 months agounit-tests: Add tests for IKE_SA rekeying with multiple key exchanges
Tobias Brunner [Mon, 4 Nov 2019 15:17:30 +0000 (16:17 +0100)] 
unit-tests: Add tests for IKE_SA rekeying with multiple key exchanges

9 months agounit-tests: Support multiple proposals in exchange tests
Tobias Brunner [Wed, 17 Jun 2020 16:39:44 +0000 (18:39 +0200)] 
unit-tests: Support multiple proposals in exchange tests

9 months agovici: Increase maximum proposal length
Andreas Steffen [Tue, 6 Jul 2021 10:11:51 +0000 (12:11 +0200)] 
vici: Increase maximum proposal length

9 months agovici: List additional key exchanges
Andreas Steffen [Tue, 19 Nov 2019 19:44:39 +0000 (20:44 +0100)] 
vici: List additional key exchanges

Co-authored-by: Tobias Brunner <tobias@strongswan.org>
9 months agoproposal: Add prefix for additional key exchanges when logging proposals
Tobias Brunner [Thu, 22 Oct 2020 12:15:31 +0000 (14:15 +0200)] 
proposal: Add prefix for additional key exchanges when logging proposals

9 months agokey-exchange: Add dynamic parser for additional key exchange methods
Tobias Brunner [Mon, 4 Nov 2019 16:27:20 +0000 (17:27 +0100)] 
key-exchange: Add dynamic parser for additional key exchange methods

9 months agochild-rekey: Support CHILD_SA rekeying with multiple key exchanges
Tobias Brunner [Mon, 29 Jun 2020 12:12:05 +0000 (14:12 +0200)] 
child-rekey: Support CHILD_SA rekeying with multiple key exchanges

9 months agounit-tests: Fix CHILD_SA rekey tests after INVALID_KE_PAYLOAD handling changed
Tobias Brunner [Fri, 20 Jul 2018 12:12:48 +0000 (14:12 +0200)] 
unit-tests: Fix CHILD_SA rekey tests after INVALID_KE_PAYLOAD handling changed

The responder doesn't create a CHILD_SA and allocate an SPI anymore
when responding with an INVALID_KE_PAYLOAD notify.

9 months agochild-create: Add support for multiple key exchanges
Tobias Brunner [Thu, 25 Jun 2020 08:26:38 +0000 (10:26 +0200)] 
child-create: Add support for multiple key exchanges

It also changes that payloads are built before installing the CHILD_SA
on the responder, that is, the KE payload is generated before keys are
derived, so that key_exchange_t::get_public_key() is called before
get_shared_secret(), or its internal equivalent, which could be relevant
for KE implementations that want to ensure that the key can't be
accessed again after the key derivation.

9 months agoike-rekey: Support IKE_SA rekeying with multiple key exchanges
Tobias Brunner [Mon, 6 Apr 2020 15:41:15 +0000 (17:41 +0200)] 
ike-rekey: Support IKE_SA rekeying with multiple key exchanges

9 months agoike-init: Add support for multiple key exchanges
Tobias Brunner [Thu, 31 Oct 2019 16:16:44 +0000 (17:16 +0100)] 
ike-init: Add support for multiple key exchanges

Initially, this is handled with a key derivation for each
IKE_INTERMEDIATE exchange.  When rekeying, the keys are derived only
once all IKE_FOLLOWUP_KE exchanges are done.

9 months agobus: Support multiple key exchanges in ike/child_keys() events
Tobias Brunner [Thu, 9 Apr 2020 09:53:45 +0000 (11:53 +0200)] 
bus: Support multiple key exchanges in ike/child_keys() events

9 months agokeymat_v2: Support key derivation with multiple key exchanges
Tobias Brunner [Thu, 9 Apr 2020 09:37:52 +0000 (11:37 +0200)] 
keymat_v2: Support key derivation with multiple key exchanges

9 months agokey-exchange: Add helper to concatenate shared secrets of several key exchanges
Tobias Brunner [Thu, 9 Apr 2020 09:36:30 +0000 (11:36 +0200)] 
key-exchange: Add helper to concatenate shared secrets of several key exchanges

9 months agokeymat_v2: Proper cleanup if derive_ike_keys() is called multiple times
Tobias Brunner [Thu, 28 Jun 2018 13:33:35 +0000 (15:33 +0200)] 
keymat_v2: Proper cleanup if derive_ike_keys() is called multiple times

9 months agoike-auth: Calculate and collect IntAuth for IKE_INTERMEDIATE exchanges
Tobias Brunner [Tue, 20 Aug 2019 15:07:55 +0000 (17:07 +0200)] 
ike-auth: Calculate and collect IntAuth for IKE_INTERMEDIATE exchanges

The message ID of the first IKE_AUTH exchange is a safe-guard against
potential truncation attacks if IKE_INTERMEDIATE exchanges are not used
for multiple key exchanges but some other future use where the number of
exchanges might not depend on the selected proposal.

9 months agopubkey-authenticator: Handle IntAuth data
Tobias Brunner [Tue, 20 Aug 2019 14:38:01 +0000 (16:38 +0200)] 
pubkey-authenticator: Handle IntAuth data

9 months agopsk-authenticator: Handle IntAuth data
Tobias Brunner [Tue, 20 Aug 2019 14:36:13 +0000 (16:36 +0200)] 
psk-authenticator: Handle IntAuth data

9 months agoeap-authenticator: Handle IntAuth data
Tobias Brunner [Tue, 20 Aug 2019 14:32:17 +0000 (16:32 +0200)] 
eap-authenticator: Handle IntAuth data

9 months agokeymat_v2: Include optional IntAuth in signed octets
Tobias Brunner [Tue, 20 Aug 2019 14:18:05 +0000 (16:18 +0200)] 
keymat_v2: Include optional IntAuth in signed octets

9 months agoauthenticator: Add optional method to set IntAuth data
Tobias Brunner [Tue, 20 Aug 2019 14:13:11 +0000 (16:13 +0200)] 
authenticator: Add optional method to set IntAuth data

9 months agomessage: Store original encrypted payload when generating fragments
Tobias Brunner [Mon, 19 Jul 2021 15:12:09 +0000 (17:12 +0200)] 
message: Store original encrypted payload when generating fragments

If we don't do this, get_plain() will fail after generating the message
fragmented unless it was generated non-fragmented previously.

9 months agomessage: Add method to generate data to authenticate IKE_INTERMEDIATE exchanges
Tobias Brunner [Tue, 20 Aug 2019 12:57:30 +0000 (14:57 +0200)] 
message: Add method to generate data to authenticate IKE_INTERMEDIATE exchanges

9 months agogenerator: Make pointer to length field optional
Tobias Brunner [Tue, 20 Aug 2019 12:53:16 +0000 (14:53 +0200)] 
generator: Make pointer to length field optional

Only useful if we generate an IKE header.

9 months agokeymat_v2: Add method to calculate IntAuth for IKE_INTERMEDIATE exchanges
Tobias Brunner [Tue, 2 Jul 2019 13:01:26 +0000 (15:01 +0200)] 
keymat_v2: Add method to calculate IntAuth for IKE_INTERMEDIATE exchanges

9 months agomessage: Add rules for IKE_FOLLOWUP_KE exchanges
Tobias Brunner [Fri, 3 Apr 2020 13:10:40 +0000 (15:10 +0200)] 
message: Add rules for IKE_FOLLOWUP_KE exchanges

9 months agoike-header: Add IKE_FOLLOWUP_KE exchange type
Tobias Brunner [Fri, 3 Apr 2020 13:01:17 +0000 (15:01 +0200)] 
ike-header: Add IKE_FOLLOWUP_KE exchange type

9 months agonotify-payload: Add notify types for multiple key exchanges
Tobias Brunner [Fri, 25 Oct 2019 12:27:47 +0000 (14:27 +0200)] 
notify-payload: Add notify types for multiple key exchanges

9 months agoikev2: Reject IKE_INTERMEDIATE requests after IKE_AUTH
Tobias Brunner [Tue, 8 Feb 2022 13:23:37 +0000 (14:23 +0100)] 
ikev2: Reject IKE_INTERMEDIATE requests after IKE_AUTH

We currently only support these exchanges for additional key exchanges,
so once we have the final keys derived and the ike-init task is removed,
we don't expect any more of them.

9 months agomessage: Add rules for IKE_INTERMEDIATE exchanges
Tobias Brunner [Fri, 25 Oct 2019 12:40:35 +0000 (14:40 +0200)] 
message: Add rules for IKE_INTERMEDIATE exchanges

9 months agoike-header: Add IKE_INTERMEDIATE exchange type
Tobias Brunner [Fri, 25 Oct 2019 12:39:54 +0000 (14:39 +0200)] 
ike-header: Add IKE_INTERMEDIATE exchange type

9 months agonotify-payload: Add notify type for IKE_INTERMEDIATE exchange
Tobias Brunner [Wed, 18 Dec 2019 17:42:59 +0000 (18:42 +0100)] 
notify-payload: Add notify type for IKE_INTERMEDIATE exchange

9 months agoproposal-substructure: Encode additional key exchange methods
Tobias Brunner [Fri, 25 Oct 2019 12:55:05 +0000 (14:55 +0200)] 
proposal-substructure: Encode additional key exchange methods

9 months agoproposal: Make all key exchange transforms optional in ESP/AH proposals
Tobias Brunner [Tue, 5 Nov 2019 09:22:36 +0000 (10:22 +0100)] 
proposal: Make all key exchange transforms optional in ESP/AH proposals

9 months agoproposal: Skip all KE transforms if PROPOSAL_SKIP_KE given
Tobias Brunner [Tue, 29 Oct 2019 10:50:00 +0000 (11:50 +0100)] 
proposal: Skip all KE transforms if PROPOSAL_SKIP_KE given

9 months agotransform: Add helper to check if transform type negotiates key exchange
Tobias Brunner [Tue, 29 Oct 2019 10:46:22 +0000 (11:46 +0100)] 
transform: Add helper to check if transform type negotiates key exchange