Commit Graph

15431 Commits

Author SHA1 Message Date
Tobias Brunner 97c74b565b nm: Make global CA directory configurable 2016-10-04 10:27:35 +02:00
Tobias Brunner 3713d3024f Merge branch 'ikev1-rekey-deletion'
Sends a DELETE when rekeyed IKE_SAs are deleted. This fixes issues with
peers (e.g. Cisco) that continue to send DPDs on the old SA and then
delete all SAs if no response is received.  But since the DELETE could get
dropped this might not fix the issue in all cases.

Also, when terminating an IKE_SA DELETES for all CHILD_SAs are now sent
before sending one for the IKE_SA and destroying it.

Fixes #2090.
2016-10-04 10:25:01 +02:00
Tobias Brunner b56b850251 ikev1: Activate task to delete the IKE_SA in state IKE_REKEYING
It does not have any CHILD_SAs attached at that point.
2016-10-04 10:14:43 +02:00
Tobias Brunner 2e06179f7f ikev1: Delete Quick Mode SAs before the ISAKMP SA
After the ISAKMP_DELETE task has been executed the IKE_SA is destroyed
so we wouldn't be able to send deletes for the Quick Mode SAs.
2016-10-04 10:14:43 +02:00
Tobias Brunner ebc6445de8 ikev1: Send DELETE for rekeyed IKE_SAs
If we silently delete the IKE_SA the other peer might still use it even
if only to send DPDs.  If we don't answer to DPDs that might result in the
deletion of the new IKE_SA too.
2016-10-04 10:14:43 +02:00
Tobias Brunner 9691e537cd starter: Install an empty ipsec.secrets file 2016-10-04 10:13:32 +02:00
Tobias Brunner 120729f3f4 starter: Don't generate a key/certificate if ipsec.secrets does not exist 2016-10-04 10:13:32 +02:00
Tobias Brunner b27663399b watcher: Avoid allocations due to enumerators
Since the FD set could get rebuilt quite often this change avoids having
to allocate memory just to enumerate the registered FDs.
2016-10-04 10:12:18 +02:00
Tobias Brunner dcee481910 Merge branch 'enable-fragmentation'
This enables IKE fragmentation by default. And also increases the
default fragment size to 1280 bytes (the default for IPv6).
2016-10-04 10:09:03 +02:00
Tobias Brunner d5c6a0bac4 vici: Enable IKE fragmentation by default 2016-10-04 10:08:21 +02:00
Tobias Brunner af662a5170 starter: Enable IKE fragmentation by default 2016-10-04 10:08:21 +02:00
Tobias Brunner 0642f42bbe ike: Set default IKE fragment size to 1280
This is the minimum size an IPv6 implementation must support.  This makes
it the default for IPv4 too, which presumably is also generally routable
(otherwise, setting this to 0 falls back to the minimum of 576 for IPv4).
2016-10-04 10:08:21 +02:00
Tobias Brunner 6b2814ab0e Merge commit 'derived-keys'
Adds new listener hooks that work similar to the existing ike|child_keys
hooks but receive the derived IKE and CHILD_SA keys.
2016-10-04 10:06:00 +02:00
Tobias Brunner 0e80f5c3ff ikev2: Send derived CHILD_SA keys to the bus 2016-10-04 10:01:50 +02:00
Tobias Brunner 4f373c7f20 ikev2: Send derived IKE_SA keys to bus 2016-10-04 10:01:50 +02:00
Tobias Brunner c4a286c88a ikev1: Send derived CHILD_SA keys to the bus 2016-10-04 10:01:49 +02:00
Tobias Brunner a6dc7bf287 ikev1: Send derived IKE_SA keys to bus 2016-10-04 10:01:49 +02:00
Tobias Brunner f5fe0ffa2a bus: Add new hooks for derived IKE_SA and CHILD_SA keys 2016-10-04 10:01:49 +02:00
Tobias Brunner a28c6269a4 nm: Remove dummy TUN device
Recent NM releases don't insist on getting a device back from VPN
plugins.
2016-10-04 09:57:14 +02:00
Tobias Brunner 5b93de43c6 nm: Fix comment in service file in /etc/NetworkManager/VPN 2016-10-04 09:57:14 +02:00
Tobias Brunner 254099a090 nm: Remove generated service file in `make clean` 2016-10-04 09:57:13 +02:00
Tobias Brunner 96aebc1756 nm: Don't add generated AppStream metadata to tarball 2016-10-04 09:57:13 +02:00
Tobias Brunner dac15e03c8 bus: Fix maximum log levels when mixing log/vlog implementing loggers
The maximum would not get set correctly when a logger is removed and the
first remaining logger in the list (the one with the highest log level) does
e.g. only implement vlog() while there are other loggers that implement log().
This would result in only max_vlevel getting set correctly while max_level
would incorrectly get set to -1 so that log() would not get called for any
of the loggers anymore.

References #574.
2016-09-30 18:34:04 +02:00
Tobias Brunner 33d3ffde25 kernel-netlink: Pass zero mark to kernel if mask is set
The kernel will apply the mask to the mark on the packet and then
compare it to the configured mark.  So to match only unmarked packets we
have to be able to set 0/0xffffffff.
2016-09-30 15:35:32 +02:00
Tobias Brunner ac9759a532 kernel-netlink: Support configuring XFRM policy hashing thresholds
If the number of flows over a gateway exceeds the flow cache size of the Linux
kernel, policy lookup gets very expensive. Policies covering more than a single
address don't get hash-indexed by default, which results in wasting most of
the cycles in xfrm_policy_lookup_bytype() and its xfrm_policy_match() use.
Starting with several hundred policies the overhead gets inacceptable.

Starting with Linux 3.18, Linux can hash the first n-bit of a policy subnet
to perform indexed lookup. With correctly chosen netbits, this can completely
eliminate the performance impact of policy lookups, freeing the resources
for ESP crypto.

WARNING: Due to a bug in kernels 3.19 through 4.7, the kernel crashes with a
NULL pointer dereference if a socket policy is installed while hash thresholds
are changed.  And because the hashtable rebuild triggered by the threshold
change that causes this is scheduled it might also happen if the socket
policies are seemingly installed after setting the thresholds.
The fix for this bug - 6916fb3b10b3 ("xfrm: Ignore socket policies when
rebuilding hash tables") - is included since 4.8 (and might get backported).
As a workaround `charon.plugins.kernel-netlink.port_bypass` may be enabled
to replace the socket policies that allow IKE traffic with port specific
bypass policies.
2016-09-30 14:54:52 +02:00
Martin Willi dbff6373e1 include: Update xfrm.h to Linux v4.3
We strip the newly introduced <linux/in6.h> include, as this clashes with the
<netinet/in6.h> include.
2016-09-30 14:51:58 +02:00
Tobias Brunner 21c898a1f9 Merge branch 'fwd-out-policies-optional'
This makes the FWD policies in the out direction  optional (disabled by
default).  They may be enabled (e.g. if conflicting drop policies are
used) via the policies_fwd_out swanctl.conf option.
2016-09-28 17:59:21 +02:00
Tobias Brunner ad1b53454e child-sa: Only install outbound FWD policies if explicitly configured
They are only required if drop policies would otherwise prevent
forwarding traffic.  This reduces the number of policies and avoids
conflicts e.g. with SPD hash thresholds.
2016-09-28 17:56:44 +02:00
Tobias Brunner 62636da4f3 testing: Enable outbound FWD policies in swanctl/manual-prio scenario 2016-09-28 17:56:43 +02:00
Tobias Brunner 50721a61d8 vici: Make installation of outbound FWD policies configurable 2016-09-28 17:56:43 +02:00
Tobias Brunner c98e48cf0e child-cfg: Add setting that controls whether outbound FWD policies are installed 2016-09-28 17:56:43 +02:00
Tobias Brunner 175d78df60 kernel-netlink: Update cached reqid when updating policies 2016-09-28 17:55:01 +02:00
Andreas Steffen a9562a3f58 testing: Added swanctl/net2net-multicast scenario 2016-09-27 18:36:28 +02:00
Andreas Steffen d7e0ce2878 testing: Added ikev2/net2net-multicast scenario 2016-09-27 18:36:28 +02:00
Tobias Brunner 8486b3b438 travis: Use a more recent OS X image
Using the xcode8 image does not work currently (libcurl is not found).
2016-09-27 09:19:34 +02:00
Andreas Steffen 6b3e408ba5 Version bump to 5.5.1dr5 2016-09-22 17:36:37 +02:00
Andreas Steffen d505658038 testing: Added swanctl/net2net-sha3-rsa-cert and swanctl/rw-eap-tls-sha3-rsa scenarios 2016-09-22 17:34:31 +02:00
Andreas Steffen 40f2589abf gmp: Support of SHA-3 RSA signatures 2016-09-22 17:34:31 +02:00
Andreas Steffen c54d1ef12c bliss sampler unit-test: Fixed enumeration type 2016-09-22 10:46:39 +02:00
Andreas Steffen a3a8b4acae bliss: bliss_sampler expects XOF type 2016-09-22 09:23:47 +02:00
Tobias Brunner 11140e717f unit-tests: MGF1 tests depend on an XOF implementation not just a hash function
If the mgf1 plugin was not enabled (e.g. with the default configure
options) the tests failed.
2016-09-21 18:36:28 +02:00
Andreas Steffen e31ed9ab98 Version bump to 5.5.1dr4 2016-09-21 14:14:42 +02:00
Andreas Steffen 188b190a70 mgf1: Refactored MGF1 as an XOF 2016-09-21 06:40:52 +02:00
Tobias Brunner e9e643b240 leak-detective: Fix compile warning due to unused variable if LD is disabled 2016-09-20 17:24:52 +02:00
Tobias Brunner f654324e5e Merge branch 'testing-leak-detective'
Test scenarios now fail if any leaks are detected by the leak detective.
Several leaks found this way have been fixed.
2016-09-20 16:26:58 +02:00
Tobias Brunner 95f9fa82d5 leak-detective: Whitelist thread ID getter
In case an external thread calls into our code and logs messages, a thread
object is allocated that will never be released.  Even if we try to clean
up the object via thread value destructor there is no guarantee that the
thread actually terminates before we check for leaks, which seems to be the
case for the Ada Tasking threads.
2016-09-20 16:26:05 +02:00
Tobias Brunner 6250e813ca charon-tkm: Build C code with debug information 2016-09-20 16:26:05 +02:00
Tobias Brunner fd2ade9935 leak-detective: Whitelist functions of the Ada runtime related to Tasking 2016-09-20 16:26:05 +02:00
Tobias Brunner 8bc2ddb2cc charon-tkm: Free name of the PID file 2016-09-20 16:26:05 +02:00
Tobias Brunner b71f5f9305 charon-tkm: Deinitialize tkm before libstrongswan
In particular because of leak-detective.
2016-09-20 16:26:05 +02:00