13832 Commits

Author SHA1 Message Date
Martin Willi
c10b2be967 testing: Add a forecast test case 2015-02-20 16:34:55 +01:00
Martin Willi
3748fc70a7 testing: Build forecast plugin 2015-02-20 16:34:55 +01:00
Martin Willi
ed14d3ebe4 forecast: Document strongswan.conf options 2015-02-20 16:34:55 +01:00
Martin Willi
e5ad2e6614 forecast: Add the broadcast/multicast forwarding plugin called forecast 2015-02-20 16:34:55 +01:00
Martin Willi
c72fa57a00 Merge branch 'connmark'
Introduce a connmark plugin that uses Netfilter conntracks mark to select the
correct return-path SAs for client-initiated connections. This can be used
to distinguish transport mode clients behind the same NAT router.

Fixes #365.
2015-02-20 16:34:54 +01:00
Martin Willi
1e1e88e6d9 NEWS: Introduce connmark plugin 2015-02-20 16:34:54 +01:00
Martin Willi
9ed09d5f77 testing: Add a connmark plugin test
In this test two hosts establish a transport mode connection from behind
moon. sun uses the connmark plugin to distinguish the flows.

This is an example that shows how one can terminate L2TP/IPsec connections
from two hosts behind the same NAT. For simplification of the test, we use
an SSH connection instead, but this works for any connection initiated flow
that conntrack can track.
2015-02-20 16:34:54 +01:00
Martin Willi
15f392d9ed testing: Build strongSwan with the connmark plugin 2015-02-20 16:34:54 +01:00
Martin Willi
f3a419e9c4 testing: Install iptables-dev to guest images 2015-02-20 16:34:54 +01:00
Martin Willi
2a8e351117 travis: Install iptables-dev for connmark plugin in "all" tests 2015-02-20 16:34:53 +01:00
Martin Willi
cc1682bef9 ipsec-types: Support the %unique mark value 2015-02-20 16:34:53 +01:00
Martin Willi
b8973b2661 connmark: Add CONNMARK rules to select correct output SA based on conntrack
Currently supports transport mode connections using IPv4 only, and requires
a unique mark configured on the connection.

To select the correct outbound SA when multiple connections match (i.e.
multiple peers connected from the same IP address / NAT router) marks must be
configured. This mark should usually be unique, which can be configured in
ipsec.conf using mark=0xffffffff.

The plugin inserts CONNMARK netfilter target rules: Any peer-initiated flow
is tagged with the assigned mark as connmark. On the return path, the mark
gets restored from the conntrack entry to select the correct outbound SA.
2015-02-20 16:34:53 +01:00
Martin Willi
e1fe2781b0 bus: Add an ike_update() hook invoked when peer endpoints change 2015-02-20 15:33:59 +01:00
Martin Willi
8c2290dcf9 connmark: Add a plugin stub 2015-02-20 15:33:59 +01:00
Martin Willi
45ab5b0fca load-tester: Support initiating XAuth authentication
As with other configuration backends, XAuth is activated with a two round
client authentication using pubkey and xauth. In load-tester, this is configured
with initiator_auth=pubkey|xauth.

Fixes #835.
2015-02-20 14:04:23 +01:00
Martin Willi
ee83067e5c Merge branch 'make-before-break'
Introduce an alternative make-before-break reauthentication scheme in addition
to the traditional break-before-make.
2015-02-20 13:34:58 +01:00
Martin Willi
4a00f912ed NEWS: Introduce make-before-break reauthentication 2015-02-20 13:34:58 +01:00
Martin Willi
f27fb58ae0 testing: Update description and test evaluation of host2host-transport-nat
As we now reuse the reqid for identical SAs, the behavior changes for
transport connections to multiple peers behind the same NAT. Instead of
rejecting the SA, we now have two valid SAs active. For the reverse path,
however, sun sends traffic always over the newer SA, resembling the behavior
before we introduced explicit SA conflicts for different reqids.
2015-02-20 13:34:58 +01:00
Martin Willi
050556bf59 testing: Be a little more flexible in testing for established CHILD_SA modes
As we now print the reqid parameter in the CHILD_SA details, adapt the grep
to still match the CHILD_SA mode and protocol.
2015-02-20 13:34:58 +01:00
Martin Willi
b1ff437bbc testing: Add a test scenario for make-before-break reauth using a virtual IP 2015-02-20 13:34:58 +01:00
Martin Willi
ae3fdf2603 testing: Add a test scenario for make-before-break reauth without a virtual IP 2015-02-20 13:34:57 +01:00
Martin Willi
22e6a06b8c mem-pool: Pass the remote IKE address, to re-acquire() an address during reauth
With make-before-break IKEv2 re-authentication, virtual IP addresses must be
assigned overlapping to the same peer. With the remote IKE address, the backend
can detect re-authentication attempts by comparing the remote host address and
port. This allows proper reassignment of the virtual IP if it is re-requested.

This change removes the mem-pool.reassign_online option, as it is obsolete now.
IPs get automatically reassigned if a peer re-requests the same address, and
additionally connects from the same address and port.
2015-02-20 13:34:57 +01:00
Martin Willi
3676023e54 ikev2: Schedule a make-before-break completion task to delete old IKE_SA 2015-02-20 13:34:57 +01:00
Martin Willi
52bd3b8ef9 ikev2: Allow task to skip exchange by setting undefined exchange type 2015-02-20 13:34:57 +01:00
Martin Willi
349f7f2412 ikev2: Trigger make-before-break reauthentication instead of reauth task 2015-02-20 13:34:57 +01:00
Martin Willi
88a06a3596 Merge branch 'attr-migrate'
Migrates the attribute framework and associated plugins from libhydra back
to libcharon. libcharon is the only user of this framework since pluto is gone.
With these changes, we can pass the full IKE_SA state to attribute providers
and handlers, bringing more flexibility to these plugins.
2015-02-20 13:34:56 +01:00
Martin Willi
c8e7dbcb56 ike-sa-manager: Use IKEv1 uniqueness reauthentication detection for IKEv2, too 2015-02-20 13:34:56 +01:00
Martin Willi
b9be25ea39 attribute-handler: Pass full IKE_SA to handler backends 2015-02-20 13:34:56 +01:00
Martin Willi
bc9ded9dbf attribute-provider: Pass full IKE_SA to provider backends 2015-02-20 13:34:56 +01:00
Martin Willi
a12f357b40 attribute-manager: Pass full IKE_SA to handler methods 2015-02-20 13:34:56 +01:00
Martin Willi
a16058a491 attribute-manager: Pass the full IKE_SA to provider methods 2015-02-20 13:34:56 +01:00
Martin Willi
124490a8e0 unit-tester: Drop the old unit-tester libcharon plugin
While it has some tests that we don't directly cover with the new unit tests,
most of them require special infrastructure and therefore have not been used
for a long time.
2015-02-20 13:34:55 +01:00
Martin Willi
751363275f attributes: Move the configuration attributes framework to libcharon 2015-02-20 13:34:55 +01:00
Martin Willi
1f29cd2c5d libcharon: Add a test runner 2015-02-20 13:34:55 +01:00
Martin Willi
82e4b83378 attr-sql: Move plugin to libcharon 2015-02-20 13:34:55 +01:00
Martin Willi
a75980c4aa Merge branch 'tkm-reqid-alloc'
Fixes expires raised by charon-tkm to actually use a proto/dst/SPI tuple to
identify CHILD_SAs.
2015-02-20 13:34:54 +01:00
Martin Willi
c6c7f97a1d attr: Move plugin to libcharon 2015-02-20 13:34:54 +01:00
Reto Buerki
65566c37ca testing: Add tkm xfrmproxy-expire test
This test asserts that the handling of XFRM expire messages from the
kernel are handled correctly by the xfrm-proxy and the Esa Event Service
(EES) in charon-tkm.
2015-02-20 13:34:54 +01:00
Martin Willi
6bfd1fbb71 resolve: Move plugin back to libcharon
Since pluto is gone, all existing users build upon libcharon.
2015-02-20 13:34:54 +01:00
Reto Buerki
03409ac7a0 testing: Assert ees acquire messages in xfrmproxy tests 2015-02-20 13:34:54 +01:00
Reto Buerki
3fb42bc87f charon-tkm: Use get_dst_host getter in EES callback
Use the new get_dst_host getter to retrieve the destination host from
the SAD using the reqid, spi and protocol values received from the
xfrm-proxy.
2015-02-20 13:34:54 +01:00
Reto Buerki
e12ff07c96 charon-tkm: Add get_dst_host getter to SAD
This function returns the destination host of an SAD entry for given
reqid, spi and protocol arguments or NULL if not found.
2015-02-20 13:34:53 +01:00
Reto Buerki
ba8aefd5f2 charon-tkm: Improve SAD get_esa_id log messages 2015-02-20 13:34:53 +01:00
Reto Buerki
f5fc592ae1 charon-tkm: Store reqid in SAD 2015-02-20 13:34:53 +01:00
Reto Buerki
e1e854bd0c charon-tkm: Store remote SPI in SAD
Store the remote instead of the local SPI in the SAD when adding a new
entry in the kernel plugin's add_sa() function.

Since only one ESA context must be destroyed for an inbound/outbound
CHILD SA pair, it does not matter which SPI is used to retrieve it in
the del_sa function.
2015-02-20 13:34:53 +01:00
Reto Buerki
fa4f66cba3 charon-tkm: Make CHILD/ESP SA database public
Make the CHILD/ESP SA database a public member of the global tkm_t
struct.
2015-02-20 13:34:53 +01:00
Martin Willi
94eb09ac35 Merge branch 'reqid-alloc'
With these changes, charon dynamically allocates reqids for CHILD_SAs. This
allows the reuse of reqids for identical policies, and basically allows multiple
CHILD_SAs with the same selectors. As reqids do not uniquely define a CHILD_SA,
a new unique identifier for CHILD_SAs is introduced, and the kernel backends
use a proto/dst/SPI tuple to identify CHILD_SAs.

charon-tkm is not yet updated and expires are actually broken with this merge.
As some significant refactorings are required, this is fixed using a separate
merge.

References #422, #431, #463.
2015-02-20 13:34:52 +01:00
Reto Buerki
e63cbb367c charon-tkm: Fix logger entity name in tests.c
Change 'test_runner' to 'test-runner'.
2015-02-20 13:34:52 +01:00
Martin Willi
246c969d8b ike: Consistently log CHILD_SAs with their unique_id instead of their reqid 2015-02-20 13:34:52 +01:00
Reto Buerki
8fce649d9a testing: Assert proper ESA deletion
Extend the tkm/host2host-initiator testcase by asserting proper ESA
deletion after connection shutdown.
2015-02-20 13:34:52 +01:00