Commit Graph

12132 Commits

Author SHA1 Message Date
Tobias Brunner 97c74b565b nm: Make global CA directory configurable 2016-10-04 10:27:35 +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 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 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 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 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 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 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 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
Tobias Brunner 0b5d490e33 leak-detective: Whitelist some glib/libsoup functions
Some of these are pretty broad, so maybe an alternative option is to
not use the soup plugin in the openssl-ikev2/rw-suite-b* scenarios.  But
the plugin is not tested anywhere else so lets go with this for now.
2016-09-20 16:22:08 +02:00
Tobias Brunner 70ac90c552 eap-peap: Fix memory leaks when handling tunneled methods 2016-09-20 15:36:15 +02:00
Tobias Brunner 0b4ba9c53d ipseckey: Properly free enumerated certificates 2016-09-20 15:36:15 +02:00
Tobias Brunner c0c14af8c2 ipseckey: Properly free public key after creating certificate 2016-09-20 15:36:15 +02:00
Tobias Brunner 149b7de35c dnscert: Properly free enumerated certificates 2016-09-20 15:36:15 +02:00
Tobias Brunner 15cbe526ac unbound: Avoid unnecessary cloning of RR list that caused a memory leak 2016-09-20 15:36:14 +02:00
Tobias Brunner 3a25032c16 unbound: Fix memory leak 2016-09-20 15:36:14 +02:00
Tobias Brunner 8c33a1897a pool: Fix (known) memory leak when querying leases 2016-09-20 15:36:14 +02:00
Tobias Brunner f44e0efb11 leak-detective: Whitelist leak in libldap 2016-09-20 15:36:14 +02:00
Tobias Brunner 4f1c6bc5a6 leak-detective: Optionally write report to a log file 2016-09-20 15:36:09 +02:00
Tobias Brunner d344474b3d vici: Fix indention of flush_certs() method in Python bindings 2016-09-20 15:33:18 +02:00
Tobias Brunner d8f27ba679 maemo: Remove unused plugin 2016-09-15 18:33:52 +02:00