Commit Graph

13845 Commits

Author SHA1 Message Date
Andreas Steffen bfb708ea23 Check for null pointer before applying memwipe() 2015-02-25 21:45:34 +01:00
Andreas Steffen c2aca9eed2 Implemented improved BLISS-B signature algorithm 2015-02-25 21:45:34 +01:00
Martin Willi d0d8568356 host-resolver: Do not cancel threads waiting for new queries during cleanup
While it is currently unclear why it happens, canceling threads waiting in the
new_query condvar does not work as expected. The behavior is not fully
reproducible: Either cancel(), join() or destroying the condvar hangs.

The issue has been seen in the http-fetcher unit tests, where the stream service
triggers the use of the resolver for "localhost" hosts. It is reproducible with
any cleanup following a host_create_from_dns() use on a Ubuntu 14.04 x64 system.
Further, the issue is related to the use of libunwind, as only builds with
--enable-unwind-backtraces are affected.

As we broadcast() the new_query condvar before destruction, a hard cancel() of
these threads is actually not required. Instead we let these threads clean up
themselves after receiving the condvar signal.
2015-02-24 16:00:38 +01:00
Martin Willi 2113f48271 host-resolver: Disable resolver thread cancellation by default
The default of new threads is cancellable, but the host-resolver thread code
clearly expects the opposite.
2015-02-24 15:59:35 +01:00
Martin Willi 0ae862efd1 unit-tests: Add host_create_from_dns() test cases resolving "localhost" 2015-02-24 15:56:37 +01:00
Martin Willi 54d143ca37 travis: Disable forecast/connmark plugins in monolithic builds
Ubuntu 12.04 does not seem to provide a sane pkg-config for libiptc or libip4tc.
The monolithic build fails due to missing symbols, so disable it until we have
a newer Ubuntu release.
2015-02-24 12:25:23 +01:00
Martin Willi 20a0fd9255 plugin-loader: Do not unload libraries during dlclose(), if supported
Unloading libraries calls any library constructor/destructor functions. Some
libraries can't handle that in our excessive unit test use. GnuTLS leaks
a /dev/urandom file descriptor, letting unit tests fail with arbitrary
out-of-resources errors.
2015-02-24 12:25:01 +01:00
Martin Willi 67a9744bb9 unit-tests: Accept numerical protocol/port numbers in traffic selector tests 2015-02-23 18:44:26 +01:00
Tobias Brunner 98632af672 forecast: Explicitly cast sockaddr to fix compiler warning
On Travis we compile with -Werror.
2015-02-23 12:35:50 +01:00
Tobias Brunner 89b60e9fd7 configure: Use pkg-config to detect libiptc used by connmark/forecast
This ensures the library is available.  On Debian/Ubuntu it is a dynamic
library provided by the iptables-dev package.
2015-02-23 12:35:28 +01:00
Tobias Brunner 4e236a7e15 openssl: Return the proper IV length for OpenSSL crypters
For instance, the NULL cipher has a block size of 1 but an IV length
of 0.

Fixes #854.
2015-02-23 11:29:07 +01:00
Martin Willi 57b096eb7a 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.
2015-02-20 16:34:56 +01:00
Martin Willi dc88d1796a NEWS: Introduce forecast multicast/broadcast forwarding plugin 2015-02-20 16:34:55 +01:00
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