Martin Willi [Fri, 20 Feb 2015 15:01:44 +0000 (16:01 +0100)]
Merge branch 'forecast'
Implement a forecast plugin that supports forwarding of multi- and broadcast
messages between a LAN and clients or between connected clients. It uses
IPsec policy marks to send packets over multiple identical multi- and broadcast
policies.
Martin Willi [Fri, 5 Dec 2014 15:12:12 +0000 (16:12 +0100)]
NEWS: Introduce forecast multicast/broadcast forwarding plugin
Martin Willi [Thu, 18 Dec 2014 15:05:24 +0000 (16:05 +0100)]
testing: Add a forecast test case
Martin Willi [Thu, 18 Dec 2014 15:02:45 +0000 (16:02 +0100)]
testing: Build forecast plugin
Martin Willi [Fri, 5 Dec 2014 15:07:16 +0000 (16:07 +0100)]
forecast: Document strongswan.conf options
Martin Willi [Fri, 5 Dec 2014 14:50:24 +0000 (15:50 +0100)]
forecast: Add the broadcast/multicast forwarding plugin called forecast
Martin Willi [Fri, 20 Feb 2015 14:59:19 +0000 (15:59 +0100)]
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.
Martin Willi [Tue, 18 Nov 2014 10:41:44 +0000 (11:41 +0100)]
NEWS: Introduce connmark plugin
Martin Willi [Tue, 18 Nov 2014 10:33:28 +0000 (11:33 +0100)]
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.
Martin Willi [Mon, 17 Nov 2014 17:06:29 +0000 (18:06 +0100)]
testing: Build strongSwan with the connmark plugin
Martin Willi [Mon, 17 Nov 2014 17:06:05 +0000 (18:06 +0100)]
testing: Install iptables-dev to guest images
Martin Willi [Mon, 17 Nov 2014 11:07:36 +0000 (12:07 +0100)]
travis: Install iptables-dev for connmark plugin in "all" tests
Martin Willi [Mon, 17 Nov 2014 10:59:38 +0000 (11:59 +0100)]
ipsec-types: Support the %unique mark value
Martin Willi [Fri, 14 Nov 2014 11:57:53 +0000 (12:57 +0100)]
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.
Martin Willi [Tue, 9 Dec 2014 12:20:44 +0000 (13:20 +0100)]
bus: Add an ike_update() hook invoked when peer endpoints change
Martin Willi [Fri, 14 Nov 2014 10:01:45 +0000 (11:01 +0100)]
connmark: Add a plugin stub
Martin Willi [Tue, 27 Jan 2015 09:40:39 +0000 (10:40 +0100)]
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.
Martin Willi [Wed, 4 Feb 2015 10:50:12 +0000 (11:50 +0100)]
Merge branch 'make-before-break'
Introduce an alternative make-before-break reauthentication scheme in addition
to the traditional break-before-make.
Martin Willi [Wed, 4 Feb 2015 10:47:56 +0000 (11:47 +0100)]
NEWS: Introduce make-before-break reauthentication
Martin Willi [Wed, 12 Nov 2014 15:52:52 +0000 (16:52 +0100)]
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.
Martin Willi [Wed, 12 Nov 2014 11:09:04 +0000 (12:09 +0100)]
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.
Martin Willi [Mon, 10 Nov 2014 14:36:48 +0000 (15:36 +0100)]
testing: Add a test scenario for make-before-break reauth using a virtual IP
Martin Willi [Mon, 10 Nov 2014 14:36:08 +0000 (15:36 +0100)]
testing: Add a test scenario for make-before-break reauth without a virtual IP
Martin Willi [Tue, 4 Nov 2014 15:32:33 +0000 (16:32 +0100)]
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.
Martin Willi [Tue, 4 Nov 2014 12:41:48 +0000 (13:41 +0100)]
ikev2: Schedule a make-before-break completion task to delete old IKE_SA
Martin Willi [Tue, 4 Nov 2014 12:54:29 +0000 (13:54 +0100)]
ikev2: Allow task to skip exchange by setting undefined exchange type
Martin Willi [Mon, 3 Nov 2014 15:37:29 +0000 (16:37 +0100)]
ikev2: Trigger make-before-break reauthentication instead of reauth task
Martin Willi [Wed, 4 Feb 2015 10:38:58 +0000 (11:38 +0100)]
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.
Martin Willi [Mon, 3 Nov 2014 15:00:13 +0000 (16:00 +0100)]
ike-sa-manager: Use IKEv1 uniqueness reauthentication detection for IKEv2, too
Martin Willi [Tue, 4 Nov 2014 14:53:50 +0000 (15:53 +0100)]
attribute-handler: Pass full IKE_SA to handler backends
Martin Willi [Tue, 4 Nov 2014 14:38:07 +0000 (15:38 +0100)]
attribute-provider: Pass full IKE_SA to provider backends
Martin Willi [Tue, 4 Nov 2014 14:20:41 +0000 (15:20 +0100)]
attribute-manager: Pass full IKE_SA to handler methods
Martin Willi [Tue, 4 Nov 2014 14:11:42 +0000 (15:11 +0100)]
attribute-manager: Pass the full IKE_SA to provider methods
Martin Willi [Tue, 4 Nov 2014 14:00:15 +0000 (15:00 +0100)]
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.
Martin Willi [Tue, 4 Nov 2014 13:45:34 +0000 (14:45 +0100)]
attributes: Move the configuration attributes framework to libcharon
Martin Willi [Fri, 12 Dec 2014 11:44:32 +0000 (12:44 +0100)]
libcharon: Add a test runner
Martin Willi [Tue, 4 Nov 2014 13:22:20 +0000 (14:22 +0100)]
attr-sql: Move plugin to libcharon
Martin Willi [Wed, 4 Feb 2015 10:31:47 +0000 (11:31 +0100)]
Merge branch 'tkm-reqid-alloc'
Fixes expires raised by charon-tkm to actually use a proto/dst/SPI tuple to
identify CHILD_SAs.
Martin Willi [Tue, 4 Nov 2014 13:19:03 +0000 (14:19 +0100)]
attr: Move plugin to libcharon
Reto Buerki [Thu, 18 Dec 2014 10:49:05 +0000 (11:49 +0100)]
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.
Martin Willi [Tue, 4 Nov 2014 13:13:34 +0000 (14:13 +0100)]
resolve: Move plugin back to libcharon
Since pluto is gone, all existing users build upon libcharon.
Reto Buerki [Thu, 18 Dec 2014 09:43:42 +0000 (10:43 +0100)]
testing: Assert ees acquire messages in xfrmproxy tests
Reto Buerki [Fri, 19 Dec 2014 08:11:12 +0000 (09:11 +0100)]
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.
Reto Buerki [Fri, 19 Dec 2014 07:54:22 +0000 (08:54 +0100)]
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.
Reto Buerki [Fri, 19 Dec 2014 07:52:19 +0000 (08:52 +0100)]
charon-tkm: Improve SAD get_esa_id log messages
Reto Buerki [Thu, 18 Dec 2014 16:58:26 +0000 (17:58 +0100)]
charon-tkm: Store reqid in SAD
Reto Buerki [Thu, 18 Dec 2014 15:49:16 +0000 (16:49 +0100)]
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.
Reto Buerki [Thu, 18 Dec 2014 15:24:07 +0000 (16:24 +0100)]
charon-tkm: Make CHILD/ESP SA database public
Make the CHILD/ESP SA database a public member of the global tkm_t
struct.
Martin Willi [Thu, 19 Feb 2015 17:18:51 +0000 (18:18 +0100)]
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.
Reto Buerki [Thu, 18 Dec 2014 15:16:49 +0000 (16:16 +0100)]
charon-tkm: Fix logger entity name in tests.c
Change 'test_runner' to 'test-runner'.
Martin Willi [Tue, 28 Oct 2014 09:54:38 +0000 (10:54 +0100)]
ike: Consistently log CHILD_SAs with their unique_id instead of their reqid
Reto Buerki [Thu, 18 Dec 2014 16:32:09 +0000 (17:32 +0100)]
testing: Assert proper ESA deletion
Extend the tkm/host2host-initiator testcase by asserting proper ESA
deletion after connection shutdown.
Martin Willi [Mon, 27 Oct 2014 15:16:13 +0000 (16:16 +0100)]
unity: Reference IKE_SAs by the IKEv1 COOKIEs, improving lookup performance
When handling thousands of IKE_SAs, the unique ID based lookup is rather slow,
as we have no indexing.
Martin Willi [Mon, 27 Oct 2014 15:08:59 +0000 (16:08 +0100)]
ike-sa-manager: Remove IKE_SA checkout by CHILD_SA reqid
Martin Willi [Mon, 27 Oct 2014 15:03:05 +0000 (16:03 +0100)]
migrate-job: Do CHILD_SA reqid lookup locally
Martin Willi [Mon, 27 Oct 2014 14:38:47 +0000 (15:38 +0100)]
kernel-interface: Raise mapping event with a proto/SPI/dst tuple
Martin Willi [Mon, 27 Oct 2014 14:19:09 +0000 (15:19 +0100)]
inactivity-job: Schedule job by CHILD_SA unique ID instead of reqid
Reto Buerki [Mon, 17 Nov 2014 14:15:19 +0000 (15:15 +0100)]
charon-tkm: Fix compilation of ees_callback.c
Update the call to hydra->kernel_interface->expire to make
ees_callback.c compile again. The required destination host argument is
set to NULL for now.
Martin Willi [Mon, 27 Oct 2014 14:07:05 +0000 (15:07 +0100)]
kernel-interface: Raise expires with a proto/SPI/dst tuple instead of reqid
Martin Willi [Mon, 27 Oct 2014 13:03:32 +0000 (14:03 +0100)]
controller: Use the CHILD_SA unique_id to terminate CHILD_SAs
Martin Willi [Mon, 27 Oct 2014 12:54:51 +0000 (13:54 +0100)]
swanctl: List CHILD_SA unique ID as the primary identifier, but print reqid, too
Martin Willi [Mon, 27 Oct 2014 13:07:14 +0000 (14:07 +0100)]
stroke: List CHILD_SA unique ID as the primary identifier, but print reqid, too
Martin Willi [Mon, 27 Oct 2014 12:51:59 +0000 (13:51 +0100)]
vici: Include the CHILD_SA unique ID in list-sa event
Martin Willi [Thu, 23 Oct 2014 14:52:25 +0000 (16:52 +0200)]
ike: Maintain per-IKE_SA CHILD_SAs in the global CHILD_SA manager
Martin Willi [Thu, 23 Oct 2014 13:42:21 +0000 (15:42 +0200)]
child-sa-manager: Add a global manager storing CHILD_SA relations
To quickly check out IKE_SAs and find associated CHILD_SAs, the
child_sa_manager stores relations between CHILD_SAs and IKE_SAs. It provides
CHILD_SA specific IKE_SA checkout functions wrapping the ike_sa_manager.
Martin Willi [Thu, 13 Nov 2014 14:26:10 +0000 (15:26 +0100)]
child-sa: Replace reqid based marks by "unique" marks
As we now use the same reqid for multiple CHILD_SAs with the same selectors,
having marks based on the reqid makes not that much sense anymore. Instead we
use unique marks that use a custom identifier. This identifier is reused during
rekeying, keeping the marks constant for any rule relying on it (for example
installed by updown).
This also simplifies handling of reqid allocation, as we do not have to query
the marks that is not yet assigned for an unknown reqid.
Martin Willi [Thu, 23 Oct 2014 09:27:25 +0000 (11:27 +0200)]
child-sa: Introduce a unique CHILD_SA identifier
As the reqid is not that unique even among multiple IKE_SAs anymore, we need
an identifier to uniquely identify a specific CHILD_SA instance.
Martin Willi [Tue, 21 Oct 2014 09:36:18 +0000 (11:36 +0200)]
child-sa: Delegate reqid allocation to the kernel interface
Martin Willi [Wed, 12 Nov 2014 16:22:45 +0000 (17:22 +0100)]
kernel-interface: Add reqid allocation and release functions
To reassign reqids where appropriate, we explicitly allocate or confirm them
centrally on the kernel-interface.
Currently the state is stored in the kernel-interface wrapper for all
backends, but we may add appropriate methods to each backend to implement
a custom reqid allocation logic, if required.
Martin Willi [Thu, 23 Oct 2014 09:19:03 +0000 (11:19 +0200)]
traffic-selector: Add a hash() method
Martin Willi [Thu, 19 Feb 2015 17:03:08 +0000 (18:03 +0100)]
child-sa: Sort traffic selectors after adding CHILD_SA policies
Having traffic selectors sorted properly makes comparing them much simpler.
Martin Willi [Thu, 19 Feb 2015 17:02:25 +0000 (18:02 +0100)]
unit-tests: Add an initial set of traffic selector unit tests
Martin Willi [Thu, 19 Feb 2015 17:01:38 +0000 (18:01 +0100)]
traffic-selector: Add a compare function to sort traffic selectors
Martin Willi [Fri, 17 Oct 2014 13:44:06 +0000 (15:44 +0200)]
child-sa: Remove the obsolete update logic
The kernel backend uses an inbound parameter these days, where it makes
no sense to pass the update flag. The kernel backend decides itself how
it handles SA installation based on the inbound flag.
Martin Willi [Wed, 15 Oct 2014 16:03:31 +0000 (18:03 +0200)]
kernel-interface: Pass full list of traffic selectors to add_sa()
While we can handle the first selector only in BEET mode in kernel-netlink,
passing the full list gives the backend more flexibility how to handle this
information.
Martin Willi [Wed, 15 Oct 2014 16:02:46 +0000 (18:02 +0200)]
libipsec: Remove unused src/dst_ts parameters from ipsec_sa_mgr_t.add_sa()
Martin Willi [Fri, 17 Oct 2014 12:31:32 +0000 (14:31 +0200)]
kernel-pfkey: Don't update during add_sa(), but delete SPI allocation state
Martin Willi [Wed, 15 Oct 2014 15:22:55 +0000 (17:22 +0200)]
kernel-interface: Remove reqid parameter from get_spi/get_cpi() methods
The reqid is not strictly required, as we set the reqid with the update
call when installing the negotiated SA.
If we don't need a reqid at this stage, we can later allocate the reqid in
the kernel backend once the SA parameters have been fully negotaited. This
allows us to assign the same reqid for the same selectors to avoid conflicts
on backends this is necessary.
Martin Willi [Wed, 15 Oct 2014 15:19:56 +0000 (17:19 +0200)]
libipsec: Remove unused reqid parameter from ipsec_sa_mgr_t.get_spi()
Martin Willi [Thu, 5 Feb 2015 08:13:57 +0000 (09:13 +0100)]
libtls: Don't send TLS close notifies in EAP after application succeeds
With the introduction of PT-TLS, we started sending TLS close notifies after
the application layer completes (
7bbf7aa9). While this makes sense for TCP based
transports, it is not required in EAP methods. In EAP, handshake completion
can be directly signaled using the outer EAP-SUCCESS message. This also saves
one round-trip in the EAP exchange.
Windows 7/8 does not seem to like TLS close notifies at all in EAP, and either
stalls (EAP-TTLS) or disconnects (PEAP).
Fixes #556.
Thomas Egerer [Wed, 4 Feb 2015 11:47:03 +0000 (12:47 +0100)]
ha: Perform child rekeying outside of CHILD_SA enumerator
When rekey_child_sa is called while enumerating the children of an IKE_SA, and
the child to be rekeyed is redundant a QUICK_DELETE task is queued instead of a
QUICK_MODE task. This alters the IKE_SA's list of children (ike_sa_t::child_sas)
invalidating the current element of the child_sa_enumerator. The enumerate
function of linked_list_t will then advance to an element with unpredictable
contents most likely resulting in an segmentation violation. A similar behavior
should be observed when delete_child_sa is called.
This patch creates a list of protocol/spi values while holding the
child_sa_enumerator and performs the rekeying (deletion of redundant) chlidren
after releasing the enumerator.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Tobias Brunner [Thu, 12 Feb 2015 11:17:48 +0000 (12:17 +0100)]
mem-pool: Document reassign_online option
Tobias Brunner [Tue, 10 Feb 2015 17:29:41 +0000 (18:29 +0100)]
man: Document IKEv2 fragmentation in ipsec.conf(5)
Tobias Brunner [Tue, 10 Feb 2015 15:08:09 +0000 (16:08 +0100)]
configure: Load SQL backends after crypto plugins
If the MySQL client library is linked against OpenSSL the mysql plugin
will cause a segmentation fault when it is unloaded after the openssl
plugin has already been deinitialized. This is very similar to the issues
with curl (see
44b6a34d438f).
Fixes #814.
Martin Willi [Fri, 6 Feb 2015 15:43:33 +0000 (16:43 +0100)]
stroke: Double the stroke message string buffer size
Martin Willi [Fri, 6 Feb 2015 15:37:09 +0000 (16:37 +0100)]
starter: Fail sending stroke message if a string exceeds the buffer size
Instead of silently setting the string value to NULL, we fail completely in
sending the message to notify the user.
Fixes #844.
Martin Willi [Fri, 6 Feb 2015 12:58:58 +0000 (13:58 +0100)]
x509: Fix public key reference leak if authority key identifier does not match
Martin Willi [Thu, 22 Jan 2015 14:00:45 +0000 (15:00 +0100)]
vici: Fix ruby gem author email
Andreas Steffen [Wed, 21 Jan 2015 22:54:33 +0000 (23:54 +0100)]
trusted_enumerate requires an additional argument
Martin Willi [Wed, 21 Jan 2015 08:31:24 +0000 (09:31 +0100)]
vici: Fix README example encoding element type values, off by one
While we fixed the wrong values in the description with
d39e04b5, the example
values are still off by one.
Fixes #828.
Martin Willi [Thu, 8 Jan 2015 10:06:45 +0000 (11:06 +0100)]
libtls: Check for CHANGE_CIPHER_SPEC type only if upper layer returns NEED_MORE
A type is returned only if upper layers successfully created a record, that is
returns NEED_MORE. If we do not check for the return value, we might check a
previous record or the uninitialized type variable and falsely reset the
sequence number.
Maks Naumov [Fri, 9 Jan 2015 22:44:36 +0000 (00:44 +0200)]
starter: Fix mark_out.mask in starter_cmp_conn()
Tobias Brunner [Mon, 5 Jan 2015 12:44:16 +0000 (13:44 +0100)]
_updown: Remove obsolete man pages
Andreas Steffen [Sun, 28 Dec 2014 11:53:16 +0000 (12:53 +0100)]
Updated RFC3779 certificates
Andreas Steffen [Fri, 19 Dec 2014 09:03:54 +0000 (10:03 +0100)]
Version bump to 5.2.2
Andreas Steffen [Thu, 18 Dec 2014 14:51:13 +0000 (15:51 +0100)]
unit-tests: Adapted to coverity fixes
Andreas Steffen [Wed, 17 Dec 2014 17:16:26 +0000 (18:16 +0100)]
Fixed bad bit shift and sign extension errors
Tobias Brunner [Mon, 15 Dec 2014 17:55:03 +0000 (18:55 +0100)]
bliss: Remove unnecessary cast to double
Coverity is still not happy when the result of an integer division is
assigned to a double (without e.g. casting the result to an int first to
indicate the intent). The shift should avoid this issue.
Tobias Brunner [Mon, 15 Dec 2014 17:54:59 +0000 (18:54 +0100)]
bliss: Log type if unsupported
Tobias Brunner [Mon, 15 Dec 2014 17:30:31 +0000 (18:30 +0100)]
bliss: Make sure sampler exists after checking for it earlier