Reto Buerki [Thu, 30 Oct 2014 16:43:01 +0000 (17:43 +0100)]
testing: Update tkm/multiple-clients/evaltest.dat
Since the CC context is now properly reset in the bus listener plugin,
the second connection from host dave re-uses the first CC ID. Adjust
the expect string on gateway sun accordingly.
Tobias Brunner [Thu, 30 Oct 2014 14:04:31 +0000 (15:04 +0100)]
Merge branch 'mem-pool-range'
Adds support to configure address pools as ranges (from-to) in
ipsec.conf and swanctl.conf.
The first and last addresses in subnet based pools are now skipped
properly and the pools' sizes are adjusted accordingly. Which is also
the case if pools are configured with an offset, e.g. 192.168.0.100/24,
which reduces the number of available addresses from 254 to 155, and
assignment now starts at .100 not .101, i.e. .100-.254 are assignable
to clients.
Tobias Brunner [Fri, 24 Oct 2014 13:40:09 +0000 (15:40 +0200)]
mem-pool: Correctly ignore first and last addresses of subnets and adjust size
Previously one more than the first and last address was ignored.
And if the base address is not the network ID of the subnet we
should not skip it. But we should adjust the size as it does not
represent the actual number of IP addresses assignable.
Thomas Egerer [Thu, 9 Oct 2014 09:13:43 +0000 (11:13 +0200)]
ikev1: Send INITIAL_CONTACT notify in Main Mode
We currently send the notify in Main Mode only, as it is explicitly not allowed
by RFC 2407 to send (unprotected) notifications in Aggressive Mode. To make
that work, we'd need to handle that notify in Aggressive Mode, which could
allow a MitM to inject such notifies and do some harm.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Martin Willi [Thu, 30 Oct 2014 10:42:04 +0000 (11:42 +0100)]
Merge branch 'policy-constraints'
Fixes handling of invalid policies in end entity certificates by not rejecting
the full certificate, but just invalidating the affected policy. Additionally
adds a bunch of unit tests for the constraints plugin, and some minor fixes
to the nameConstraints handling.
Currently we still reject CAs that use invalid policy mapping; we should accept
such certificates and just invalid affected policies in a next iteration.
Martin Willi [Wed, 15 Oct 2014 10:10:54 +0000 (12:10 +0200)]
constraints: Use a more specific FQDN/email name constraint matching
While RFC 5280 is not very specific about the matching rules of subjectAltNames,
it has some examples how to match email and FQDN constraints. We try to follow
these examples, and restrict DNS names to subdomain matching and email to
full email, host or domain matching.
Martin Willi [Fri, 10 Oct 2014 14:33:56 +0000 (16:33 +0200)]
constraints: Don't reject certificates with invalid certificate policies
Instead of rejecting the certificate completely if a certificate has a policy
OID that is actually not allowed by the issuer CA, we accept it. However, the
certificate policy itself is still considered invalid, and is not returned
in the auth config resulting from trust chain operations.
A user must make sure to rely on the returned auth config certificate policies
instead of the policies contained in the certificate; even if the certificate
is valid, the policy OID itself in the certificate are not to be trusted
anymore.
Martin Willi [Wed, 22 Oct 2014 09:24:51 +0000 (11:24 +0200)]
threading: Support rwlock try_write_lock() on Windows
We explicitly avoided TryAcquireSRWLockExclusive() because of crashes. This
issue was caused by a MinGW-w64 bug (mingw-w64 fix 46f77afc). Using a newer
toolchain works fine.
While try_write_lock() obviously can fail, not supporting it is not really an
option, as some algorithms depend on occasionally successful calls. Certificate
caching in the certificate manager and the cred_set cache rely on successful
try_write_lock()ing.
Tobias Brunner [Fri, 24 Oct 2014 09:14:51 +0000 (11:14 +0200)]
cert-cache: Prevent that a cached issuer is freed too early
Previously we got no reference to the cached issuer certificate
before releasing the lock of the cache line, this allowed other
threads, or even the same thread if it replaces a cache line, to
destroy that issuer certificate in cache() (or flush()) before
get_ref() for the issuer certificate is finally called.
Martin Willi [Wed, 22 Oct 2014 12:50:09 +0000 (14:50 +0200)]
updown: Explicitly pass caller PATH to updown script
When invoking /bin/sh, its default PATH is used. On some systems, that does
not include the PATH where the ipsec script is installed, as charon is invoked
with a custom PATH. Explicitly setting the PATH of charon should fix this
case, properly invoking the (default) updown script.
Martin Willi [Tue, 14 Oct 2014 10:43:16 +0000 (12:43 +0200)]
thread: Test for pending cancellation requests before select()ing on OS X
This fixes some vici test cases on OS X, where the test thread tries to cancel
the watcher thread during cleanup, but fails as select() does not honor the
pre-issued cancellation request.
Tobias Brunner [Fri, 10 Oct 2014 15:37:41 +0000 (17:37 +0200)]
testing: Enable virtio console for guests
This allows accessing the guests with `virsh console <name>`.
Using a serial console would also be possible but our kernel configs
have no serial drivers enabled, CONFIG_VIRTIO_CONSOLE is enabled though.
So to avoid having to recompile the kernels let's do it this way, only
requires rebuilding the guest images.
Martin Willi [Thu, 9 Oct 2014 14:11:29 +0000 (16:11 +0200)]
vici: Don't include-depend on libstrongswan for boolean types
As we want to avoid the libstrongswan include dependencies for libvici, avoid
the use of the bool type. Unfortunately this change may break the ABI for
vici_dump(). As this function is mostly for debugging purposes, we do it
nonetheless; my apologies if somebody already relies on the ABI stability of
that function.