Commit Graph

14922 Commits

Author SHA1 Message Date
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Shota Fukumori b210369314 updown: Get value for PLUTO_MARK_{IN,OUT} from CHILD_SA
Or the invoked script will get a broken value when `mark=%unique` is
used in a configuration.

Closes strongswan/strongswan#37.
2016-03-23 14:45:04 +01:00
Tobias Brunner b39be996cc connmark: Explicitly include xt_mark.h for older kernels
Fixes #1365.
2016-03-23 14:40:29 +01:00
Tobias Brunner 2f3879c3fe android: Enable 64-bit ABIs 2016-03-23 14:18:52 +01:00
Tobias Brunner 17e36cd48c android: Enable build against API level 21
While building against this level in general would break our app on
older systems, the NDK will automatically use this level for 64-bit
ABI builds (which are not supported in older levels).  So to build
against 64-bit ABIs we have to support this API level.
2016-03-23 14:18:37 +01:00
Tobias Brunner ab88f22f78 libcharon: Add missing header file to Android.mk
Not really relevant, just to make sure both file lists are the same.
2016-03-23 14:16:32 +01:00
Tobias Brunner a9f9598ed0 testing: Updated updown scripts in libipsec scenarios to latest version 2016-03-23 14:13:07 +01:00
Tobias Brunner 958c0e8e5c ike-sa-manager: Avoid memory leak if IKE_SAs get checked in after flush() was called
A thread might check out a new IKE_SA via checkout_new() or
checkout_by_config() and start initiating it while the daemon is
terminating and the IKE_SA manager is flushed by the main thread.
That SA is not tracked yet so the main thread is not waiting for it and
the other thread is able to check it in and creating an entry after flush()
already terminated causing a memory leak.

Fixes #1348.
2016-03-23 14:02:23 +01:00
Thomas Egerer 90a7a68488 ha: Delete cache entry inside the locked mutex
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2016-03-23 10:34:24 +01:00
Tobias Brunner b31e8c04f2 swanctl: Fix documented directory name for remote pubkeys 2016-03-22 18:11:51 +01:00
Andreas Steffen 7a117eeaec Version bump to 5.4.0 2016-03-22 11:20:36 +01:00
Tobias Brunner 0ed9430d10 kernel-netlink: Fix lookup of next hops for destinations with prefix
References #1347.
2016-03-21 12:14:59 +01:00
Tobias Brunner b0c6869967 imc-os: Terminate buffer after fread(3) call to make Coverity happy 2016-03-11 15:23:18 +01:00
Tobias Brunner 8c3bcebaa6 imc-os: Correctly check return value of ftell(2) 2016-03-11 15:23:17 +01:00
Tobias Brunner 755d076fec Fix some Doxygen issues 2016-03-11 12:25:14 +01:00
Andreas Steffen bebccf9876 Updated NEWS 2016-03-11 11:31:02 +01:00
Tobias Brunner 8e3940f59c man: Updated default proposals in ipsec.conf(5) 2016-03-11 10:25:06 +01:00
Tobias Brunner 0fc8b1d03e identification: Make `written` signed to fix error checking when printing ranges 2016-03-11 10:09:02 +01:00
Tobias Brunner 20df9d315c vici: Don't hold write lock while running or undoing start actions
Running or undoing start actions might require enumerating IKE_SAs,
which in turn might have to enumerate peer configs concurrently, which
requires acquiring a read lock.  So if we keep holding the write lock while
enumerating the SAs we provoke a deadlock.

By preventing other threads from acquiring the write lock while handling
actions, and thus preventing the modification of the configs, we largely
maintain the current synchronous behavior.  This way we also don't need to
acquire additional refs for config objects as they won't get modified/removed.

Fixes #1185.
2016-03-11 08:32:18 +01:00
Andreas Steffen 35babdf43f Initialize ts variable 2016-03-11 08:29:23 +01:00
Tobias Brunner 7d22a75b12 forecast: Compare the complete rules when deleting them
Same as the change in the connmark plugin.

References #1229.
2016-03-10 17:26:38 +01:00
Tobias Brunner c659d369a0 connmark: Don't restore CONNMARK for packets that already have a mark set
This allows e.g. modified versions of xl2tpd to set the mark in
situations where two clients are using the same source port behind the
same NAT, which CONNMARK can't restore properly as only one conntrack entry
will exist with the mark set to that of the client that sent the last packet.

Fixes #1230.
2016-03-10 17:26:26 +01:00
Tobias Brunner 7c9e7eb933 connmark: Compare the complete rules when deleting them
By settings a matchmask that covers the complete rule we ensure that the
correct rule is deleted (i.e. matches and targets with potentially different
marks are also compared).

Since data after the passed pointer is actually dereferenced when
comparing we definitely have to pass an array that is at least as long as
the ipt_entry.

Fixes #1229.
2016-03-10 17:26:09 +01:00
Andreas Steffen 6b8acc49ed Merge branch 'subnet-identities'
Implemented IKEv1 IPv4/IPv6 address subnet and range identities to
be used as owners for shared secrets.

swanctl supports configuration of traffic selectors with IPv4/IPv6
address ranges.
2016-03-10 15:26:03 +01:00
Andreas Steffen 3f1de98678 Support of IP address ranges in traffic selectors 2016-03-10 13:59:37 +01:00
Andreas Steffen 90ef7e8af6 Updated swanctl/rw-psk-ikev1 scenario 2016-03-10 13:59:37 +01:00
Andreas Steffen 1d86d1d65a Implemented IPv4/IPv6 subnet and range identities
The IKEv1 IPV4_ADDR_SUBNET, IPV6_ADDR_SUBNET, IPV4_ADDR_RANGE and
IPV6_ADDR_RANGE identities have been fully implemented and can be
used as owners of shared secrets (PSKs).
2016-03-10 13:59:37 +01:00
Tobias Brunner 709998e106 Merge branch 'p-cscf'
This adds the p-cscf plugin that can request P-CSCF server addresses from
an ePDG via IKEv2 (RFC 7651).  Addresses of the same families as requested
virtual IPs are requested if enabled in strongswan.conf for a particular
connection.  The plugin currently writes received addresses to the log.
2016-03-10 12:06:46 +01:00
Tobias Brunner 7e854f4d51 attr: Only enumerate attributes matching the IKE version of the current IKE_SA
Numerically configured attributes are currently sent for both versions.
2016-03-10 11:57:39 +01:00
Tobias Brunner 98a3ba8a5a attr: Add p-cscf keyword for P-CSCF server addresses 2016-03-10 11:57:38 +01:00
Tobias Brunner 276acafa2d p-cscf: Make sending requests configurable and disable it by default 2016-03-10 11:57:38 +01:00
Tobias Brunner e8262251e1 p-cscf: Only send requests if virtual IPs of the same family are requested 2016-03-10 11:57:38 +01:00
Tobias Brunner 3d91d013cc p-cscf: Add attribute handler for P-CSCF server addresses 2016-03-10 11:57:38 +01:00
Tobias Brunner 12ac5fac1a p-cscf: Add plugin stub 2016-03-10 11:57:38 +01:00
Tobias Brunner 319b031a8a payloads: Verify P-CSCF configuration attributes like others carrying IP addresses 2016-03-10 11:57:38 +01:00
Tobias Brunner 7798284da1 attributes: Define P-CSCF address attributes described in RFC 7651 2016-03-10 11:57:38 +01:00
Tobias Brunner f893b47e3d Merge branch 'mbb-reauth-online-revocation'
With these changes initiators of make-before-break reauthentications
suspend online revocation checks until after the new IKE_SA and all
CHILD_SAs are established.  See f1cbacc5d1 for details why that's
necessary.
2016-03-10 11:50:57 +01:00
Tobias Brunner b4337c5b02 NEWS: Added note on online revocation checks during make-before-break reauthentication 2016-03-10 11:46:44 +01:00
Tobias Brunner dc57c1b817 testing: Add ikev2/reauth-mbb-revoked scenario 2016-03-10 11:07:15 +01:00
Tobias Brunner d163aa5eaf testing: Generate a CRL that has moon's actual certificate revoked 2016-03-10 11:07:15 +01:00
Tobias Brunner e41adf5f05 ike-sa: Improve interaction between flush_auth_cfg and delayed revocation checks 2016-03-10 11:07:15 +01:00
Tobias Brunner f1cbacc5d1 ikev2: Delay online revocation checks during make-before-break reauthentication
We do these checks after the SA is fully established.

When establishing an SA the responder is always able to install the
CHILD_SA created with the IKE_SA before the initiator can do so.
During make-before-break reauthentication this could cause traffic sent
by the responder to get dropped if the installation of the SA on the
initiator is delayed e.g. by OCSP/CRL checks.

In particular, if the OCSP/CRL URIs are reachable via IPsec tunnel (e.g.
with rightsubnet=0.0.0.0/0) the initiator is unable to reach them during
make-before-break reauthentication as it wouldn't be able to decrypt the
response that the responder sends using the new CHILD_SA.

By delaying the revocation checks until the make-before-break
reauthentication is completed we avoid the problems described above.
Since this only affects reauthentication, not the original IKE_SA, and the
delay until the checks are performed is usually not that long this
doesn't impose much of a reduction in the overall security.
2016-03-10 11:07:15 +01:00
Tobias Brunner 8ce78e43a4 ikev2: Add task that verifies a peer's certificate
On failure the SA is deleted and reestablished as configured.  The task
is activated after the REAUTH_COMPLETE task so a make-before-break reauth
is completed before the new SA might get torn down.
2016-03-10 11:07:15 +01:00
Tobias Brunner 034a462901 ikev2: Initiate other tasks after a no-op task 2016-03-10 11:07:14 +01:00
Tobias Brunner a05cff1ec0 ikev2: Don't do online revocation checks in pubkey authenticator if requested
We also update the auth config so the constraints are not enforced.
2016-03-10 11:07:14 +01:00
Tobias Brunner e19162a509 ike-sa: Add condition to suspend online certificate revocation checks for an IKE_SA 2016-03-10 11:07:14 +01:00
Tobias Brunner 1b9c1ae018 ike-sa: Add method to verify certificates in completed authentication rounds 2016-03-10 11:07:14 +01:00
Tobias Brunner ef9171ad1e auth-cfg: Add a rule to suspend certificate validation constraints 2016-03-10 11:07:14 +01:00
Tobias Brunner f371effc5d credential-manager: Check cache queue when destroying trusted certificate enumerator
We already do this in the trusted public key enumerator (which
internally uses the trusted certificate enumerator) but should do so
also when this enumerator is used directly (since the public key
enumerator has the read lock the additional call will just be skipped
there).
2016-03-10 11:07:14 +01:00
Tobias Brunner 5452e3d66e credential-manager: Make online revocation checks optional for public key enumerator 2016-03-10 11:07:14 +01:00