Commit Graph
2678 Commits
Author SHA1 Message Date
Martin Willi 7de35b7ff6 vici: Perform specified start_action on connection load, undo it on unload 2014-05-07 14:13:37 +02:00
Martin Willi 96071fdb55 vici: Add a generic log event to raise events for log messages 2014-05-07 14:13:37 +02:00
Martin Willi 2676ffdb9f vici: Be less verbose about client connections
Instead, log the explicit commands at a higher level.
2014-05-07 14:13:37 +02:00
Martin Willi 101dba01ce vici: Add a list-certs command to query different certificate types 2014-05-07 14:13:37 +02:00
Martin Willi b57739f721 vici: Support pinning end entity and CA certificates to connections 2014-05-07 14:13:37 +02:00
Martin Willi e6e975ff9d vici: Support missing groups option in auth config 2014-05-07 14:13:37 +02:00
Martin Willi 6efa792d22 vici: Add a load-shared command to load shared IKE and EAP secrets 2014-05-07 14:13:37 +02:00
Martin Willi 559ef7de48 vici: Add a load-key command to load private keys 2014-05-07 14:13:36 +02:00
Martin Willi c12edb2a27 vici: Support loading of different certificate types 2014-05-07 14:13:36 +02:00
Martin Willi de190f62c2 vici: Add a credential backend 2014-05-07 14:13:36 +02:00
Martin Willi e1b65630b2 vici: Add a command listing all or specific loaded connections using events 2014-05-07 14:13:36 +02:00
Martin Willi 501ddf127b vici: Add unload-conn and get-conns commands to manage loaded connections 2014-05-07 14:13:36 +02:00
Martin Willi 37aa250cad vici: Make dispatcher a little more verbose 2014-05-07 14:13:36 +02:00
Martin Willi b3d8bd8d26 vici: Add backend providing in-memory connections 2014-05-07 14:13:36 +02:00
Martin Willi dd5ce0a97a vici: Add generic callback based vici message parsing 2014-05-07 14:13:36 +02:00
Martin Willi 1f2e63ea41 vici: Add a list-policy command to query trap and shunt policies 2014-05-07 14:13:36 +02:00
Martin Willi 5c6e81dcf8 vici: Add install/uninstall commands to manage trap and shunt policies 2014-05-07 14:13:36 +02:00
Martin Willi 550f3f5646 vici: Extract CHILD_SA config lookup method 2014-05-07 14:13:36 +02:00
Martin Willi e567675d29 vici: Refactor socket to clean up locking
Uses separate locks for socket read and write operations. While holding the
socket reader lock, a different thread can still claim the socket write lock.
This allows to asynchronously send event messages while holding the read
lock.
2014-05-07 14:13:36 +02:00
Martin Willi 9bfa397eba vici: Fix dispatcher leak when handling unknown request 2014-05-07 14:13:36 +02:00
Martin Willi e2496bda02 vici: Add a test case raising events during request, checks in-order delivery 2014-05-07 14:13:35 +02:00
Martin Willi 3b5808a0f6 vici: Avoid recursive control log invocations 2014-05-07 14:13:35 +02:00
Martin Willi 993bfe95fb vici: Add a callback based recursive parser function 2014-05-07 14:13:35 +02:00
Martin Willi d9ae1c68e5 vici: Add a version command to print daemon and OS version info 2014-05-07 14:13:35 +02:00
Martin Willi c7d4dad66d vici: Implement a terminate command to close IKE or CHILD_SAs 2014-05-07 14:13:35 +02:00
Martin Willi 5f95657c65 vici: Add a control backend, currently to initiate connections by name 2014-05-07 14:13:35 +02:00
Martin Willi ecc4b51048 vici: Support thread cancellation in command callbacks 2014-05-07 14:13:35 +02:00
Martin Willi 045bdf5283 vici: Move dumping to core message class, use it in libvici 2014-05-07 14:13:35 +02:00
Martin Willi 7f4cfdff58 vici: Add convenience value/string/integer getter to libvici 2014-05-07 14:13:35 +02:00
Martin Willi db18495514 vici: Add some convenience getters on message 2014-05-07 14:13:35 +02:00
Martin Willi b40a12a96f vici: Raise events with an optional identifier for specific connections 2014-05-07 14:13:35 +02:00
Martin Willi 293431269b vici: Invoke dispatcher outside of connection log, allowing events from commands 2014-05-07 14:13:35 +02:00
Martin Willi 252025210f vici: Add a query class, currently implementing a list-sas command 2014-05-07 14:13:35 +02:00
Martin Willi eb4fd014b8 vici: Add a libvici low-level client library 2014-05-07 14:13:35 +02:00
Martin Willi 8383d626b9 vici: Provide a command dispatcher handling request and event registration 2014-05-07 14:13:34 +02:00
Martin Willi 8457da7528 vici: Add a fully asynchronous IPC socket segmenting messages on/from stream 2014-05-07 14:13:34 +02:00
Martin Willi 1e39454214 vici: Add a test runner for plugin 2014-05-07 14:13:34 +02:00
Martin Willi 6770cfe34a vici: Add a plugin stub for the "Versatile IKE Control Interface" plugin 2014-05-07 14:13:34 +02:00
Tobias Brunner c478dfe617 child-cfg: Fix removal of redundant traffic selectors
We have to make sure we compare every selected traffic selector with every
other in the list.

Fixes #577.
2014-04-25 19:04:35 +02:00
Tobias Brunner 711af588f9 libcharon: Added AEAD sources of libtls to Android.mk 2014-04-25 14:27:49 +02:00
Tobias Brunner 73c33ff423 bus: Add a fast-path if log messages don't have to be logged
For some rwlock_t implementations acquiring the read lock could be quite
expensive even if there are no writers (e.g. because the implementation
requires acquiring a mutex to check for writers) particularly if the
lock is highly contended, like it is for the vlog() method.
2014-04-24 17:54:15 +02:00
Christophe Gouault 7b08063e70 load-tester: Fix race condition issuing same SPI
Due to an unprotected incrementation, two load-tester initiators occasionally
use the same SPI under high load, and hence generate 2 IPsec SAs with the same
identifier. The responder IPsec stack will refuse to configure the second SA.

Use an atomic incrementation to avoid this race condition.

Signed-off-by: Christophe Gouault <[email protected]>
2014-04-24 17:54:15 +02:00
Christophe Gouault 2cbaa63295 load-tester: Fix race condition issuing same identity
Due to an unprotected incrementation, two load-tester initiators occasionally
use the same identifier under high load. The responder typically drops one of
the connections.

Use an atomic incrementation to avoid this race condition.

Signed-off-by: Christophe Gouault <[email protected]>
2014-04-24 17:54:15 +02:00
Tobias Brunner a68454bd68 ike-sa-manager: Improve scalability of half-open IKE_SA checking
This patch is based on one by Christoph Gouault.

Currently, to count the total number of half_open IKE_SAs,
get_half_open_count sums up the count of each segment in the SA hash
table (acquiring a lock for each segment).  This procedure does not scale
well when the number of segments increases, as the method is called for
each new negotiation.

Instead, lets maintain a global atomic counter.

This optimization allows the use of big values for charon.ikesa_table_size
and charon.ikesa_table_segments.
2014-04-24 17:54:14 +02:00
Martin Willi 0b3bea3965 ike: Delay actively initiated reauthentication when other exchanges in progress
If any other IKE or CHILD_SA operation takes places, we should not start
initiating reauthentication to avoid any potential races.
2014-04-17 09:59:06 +02:00
Martin Willi f02cabbe35 ikev2: Reject CHILD_SA creation/rekeying while deleting an IKE_SA
If one peer starts reauthentication by deleting the IKE_SA, while the other
starts CHILD_SA rekeying, we run in a race condition. To avoid it, temporarily
reject the rekey attempt while we are in the IKE_SA deleting state.

RFC 4306/5996 is not exactly clear about this collision, but it should be safe
to reject CHILD_SA rekeying during this stage, as the reauth will re-trigger the
CHILD_SA. For non-rekeying CHILD_SA creations, it's up to the peer to retry
establishing the CHILD_SA on the reauthenticated IKE_SA.
2014-04-17 09:59:06 +02:00
Martin Willi 094963d1b1 ikev2: Apply extensions and conditions before starting rekeying
The extensions and conditions apply to the rekeyed IKE_SA as well, so we should
migrate them. Especially when using algorithms from private space, we need
EXT_STRONGSWAN to properly select these algorithms during IKE rekeying.
2014-04-17 09:24:51 +02:00
Martin Willi 713a1122b4 ikev2: Add inherit_pre() to apply config and hosts before IKE_SA rekeying 2014-04-17 09:24:51 +02:00
Martin Willi c4c9d291d2 ikev1: Add an option to accept unencrypted ID/HASH payloads
Even in Main Mode, some Sonicwall boxes seem to send ID/HASH payloads in
unencrypted form, probably to allow PSK lookup based on the ID payloads. We
by default reject that, but accept it if the
charon.accept_unencrypted_mainmode_messages option is set in strongswan.conf.

Initial patch courtesy of Paul Stewart.
2014-04-17 08:52:28 +02:00
Tobias Brunner 4469e3d050 ikev2: Fix reauthentication if peer assigns a different virtual IP
Before this change a reqid set on the create_child_t task was used as
indicator of the CHILD_SA being rekeyed.  Only if that was not the case
would the local traffic selector be changed to 0.0.0.0/0|::/0 (as we
don't know which virtual IP the gateway will eventually assign).
On the other hand, in case of a rekeying the VIP is expected to remain
the same, so the local TS would simply equal the VIP.

Since c949a4d501 reauthenticated CHILD_SAs also have the reqid
set.  Which meant that the local TS would contain the previously
assigned VIP, basically rendering the gateway unable to assign a
different VIP to the client as the resulting TS would not match
the client's proposal anymore.

Fixes #553.
2014-04-15 16:19:06 +02:00