Commit Graph
15803 Commits
Author SHA1 Message Date
Martin Willi 02794456a9 kernel-netlink: Add a simple send message test querying available links 2014-11-21 10:55:44 +01:00
Martin Willi f572b38816 kernel-netlink: Add a stub for a test-runner 2014-11-21 10:55:44 +01:00
Tobias Brunner 8ab1b29da4 mem-pool: Fix potential memory leak and lost leases when reassigning leases
If no offline leases are available for the current client and assigning online
leases is disabled, and if all IPs of the pool have already been assigned to
clients we look for offline leases that previously were assigned to other
clients.

In case the current client has online leases the previous code would
replace the existing mapping entry and besides resulting in a memory leak
the online leases would be lost forever (even if the client later releases
the addresses).  If this happens repeatedly the number of available addresses
would decrease even though the total number of online and offline leases seen
in `ipsec leases` would indicate that there are free addresses available.

Fixes #764.
2014-11-11 19:00:02 +01:00
Tobias Brunner fc02a9d4b9 android: New release based on 5.2.1 and after adding EAP-TLS
Also enables support for IKEv2 fragmentation, provides improved MOBIKE
handling and optionally enables PFS for CHILD_SAs.
2014-11-06 17:16:27 +01:00
Tobias Brunner baa4e774c1 android: Build binaries for MIPS 2014-11-06 17:11:55 +01:00
Tobias Brunner bdc4cea316 android: Increase fragment size
We use the same value we use as MTU on TUN devices.
2014-11-06 17:05:47 +01:00
Tobias Brunner 6fddf2af73 android: Enable IKEv2 fragmentation 2014-11-06 16:56:54 +01:00
Tobias Brunner 2d19ff462a Merge branch 'android-eap-tls'
This adds support for EAP-TLS authentication on Android.

EAP-only authentication is currently not allowed because the AAA identity
is not configurable, so to prevent anyone with a valid certificate from
impersonating the AAA server and thus the gateway, we authenticate the
gateway (like we do with other authentication methods).
Also, it's currently not possible to select a specific CA certificate to
authenticate the AAA server certificate, so it either must be issued by the
same CA as that of the gateway or automatic CA certificate selection must
be used.
2014-11-06 16:53:34 +01:00
Tobias Brunner 0e44999867 android: Use %any as AAA identity, but disable EAP-only authentication
Without verification of the identity we can't prevent a malicious user
with a valid certificate from impersonating the AAA server and thus the
VPN gateway.  So unless we make the AAA identity configurable we have to
prevent EAP-only authentication.
2014-11-06 16:28:40 +01:00
Tobias Brunner 4b39a4117a android: Add support for signature schemes used by EAP-TLS 2014-11-06 16:28:40 +01:00
Tobias Brunner 0ef74bec98 android: Allow enumeration of untrusted certificates 2014-11-06 16:28:40 +01:00
Tobias Brunner 34ca3795c8 android: Handle EAP-TLS in Android service 2014-11-06 16:28:40 +01:00
Tobias Brunner 93923149e4 android: Enable EAP-TLS plugin in the app 2014-11-06 16:28:40 +01:00
Tobias Brunner a1700c9903 android: Add EAP-TLS VPN type to the GUI 2014-11-06 16:28:40 +01:00
Tobias Brunner a64089738d android: Change how features of VPN types are stored and checked 2014-11-06 16:28:40 +01:00
Reto Buerki 0de4ba58ce 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.
2014-10-31 13:49:40 +01:00
Reto Buerki 1ec7ee65c5 charon-tkm: Properly reset CC context in listener
Make sure that the acquired CC context is correctly reset and the
associated ID released in the authorize() function of the TKM bus
listener.
2014-10-31 13:49:40 +01:00
Reto Buerki a62d03d36b charon-tkm: Add missing comma to enum
Add missing comma to tkm_context_kind_names enum definition.
2014-10-31 13:49:33 +01:00
Tobias Brunner b1ef481ce1 proposal: Add default PRF for HMAC-MD5-128 and HMAC-SHA1-160 integrity algorithms 2014-10-31 10:09:54 +01:00
Tobias Brunner 406f3af1ed 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.

References #744.
2014-10-30 15:08:05 +01:00
Tobias Brunner cd67cd70c8 host: Ignore spaces around - when parsing ranges 2014-10-30 12:32:45 +01:00
Tobias Brunner e0cd3bad3d ike-cfg: Use host_create_from_range() helper 2014-10-30 12:32:45 +01:00
Tobias Brunner 5e92534313 vici: Add support for address range definitions of pools 2014-10-30 12:32:45 +01:00
Tobias Brunner c355e2b2c7 stroke: Add support for address range definitions of in-memory pools 2014-10-30 12:32:45 +01:00
Tobias Brunner 82be444eb9 host: Add function to create two hosts from a range definition 2014-10-30 12:32:45 +01:00
Tobias Brunner bbe3070aa2 mem-pool: Add basic unit tests 2014-10-30 12:32:44 +01:00
Tobias Brunner 385d4486ba libhydra: Add test runner 2014-10-30 12:32:44 +01:00
Tobias Brunner 9d2a3554e5 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.
2014-10-30 12:32:44 +01:00
Thomas Egerer 1201ddcbc5 ikev1: Don't inherit children if INITITAL_CONTACT was seen
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2014-10-30 11:53:56 +01:00
Thomas Egerer 11b42933bf 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>
2014-10-30 11:53:56 +01:00
Martin Willi 8131d180a8 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.

Fixes #453.
2014-10-30 11:42:04 +01:00
Martin Willi b9d38c9fa2 pki: Print and document the name constraint type for DNS or email constraints
As email constraints may be for a specific host, it is not clear from the
name itself if it is a DNS or email constraint.
2014-10-30 11:40:48 +01:00
Martin Willi a6c8647eca constraints: Add permitted/excludedNameConstraints check 2014-10-30 11:40:48 +01:00
Martin Willi 7e80995c59 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.
2014-10-30 11:40:47 +01:00
Martin Willi 6733109d0e constraints: Add requireExplicitPolicy tests 2014-10-30 11:40:47 +01:00
Martin Willi 3b25be0e57 constraints: Add inhibitAnyPolicy tests 2014-10-30 11:40:47 +01:00
Martin Willi af37fac9a8 constraints: Add inhibitPolicyMapping tests 2014-10-30 11:40:47 +01:00
Martin Willi 69232e2d3d 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.
2014-10-30 11:32:19 +01:00
Martin Willi 885646acd3 constraints: Add certificate policy and policy mapping unit tests 2014-10-30 11:32:19 +01:00
Martin Willi 34fed1538b Merge branch 'id-type-prefix'
Introduce generic identity prefixes to enforce a specific type.
2014-10-30 11:21:22 +01:00
Martin Willi 045501d598 NEWS: Mention identity prefixes 2014-10-30 11:21:01 +01:00
Martin Willi 9da2b19189 swanctl: Document identity type prefixes 2014-10-30 11:07:10 +01:00
Martin Willi 9388bf1363 man: Document identification type prefixes in ipsec.conf(5) 2014-10-30 11:07:10 +01:00
Martin Willi 6528338753 identification: Support custom types in string constructor prefixes 2014-10-30 11:07:08 +01:00
Martin Willi c0da835a9f identification: Support prefixes in string constructors for an explicit type 2014-10-30 11:05:44 +01:00
Martin Willi 46001e1131 unit-tests: Re-align identification_create_from_string() unit test table data 2014-10-30 11:03:48 +01:00
Martin Willi 61e29aca0d 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.
2014-10-30 10:45:24 +01:00
Martin Willi 6a3f0467e4 threading: Add a more explicit rwlock try_write_lock() testing 2014-10-30 10:45:24 +01:00
Tobias Brunner b089169752 message: Include encrypted fragment payload in payload (order) rules
Otherwise fragmented CREATE_CHILD_SA exchanges won't get accepted
because they don't contain an SA payload.

It also prevents a warning when ordering payloads.

Fixes #752.
2014-10-29 15:51:38 +01:00
Tobias Brunner a9f87d118e 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.
2014-10-24 11:23:04 +02:00