Commit Graph
202 Commits
Author SHA1 Message Date
Martin Willi 4cd176d525 Invoke ike_updown hook on authentication failure not before response sent 2012-03-05 18:08:04 +01:00
Martin Willi fbaf5cd213 Be a little more verbose before starting IKE_SA reauthentication 2012-03-05 18:06:14 +01:00
Martin Willi a07b69734b Send an AUTH_LIFETIME update after updating the lifetime, but can not reauth actively 2012-03-05 18:06:14 +01:00
Martin Willi bdcf441703 Set hard timeouts when setting a lifetime 2012-03-05 18:06:13 +01:00
Martin Willi e9fcf1c6cc Fix IKE_SA timeout debug output on 64bit platforms 2012-03-05 18:06:13 +01:00
Tobias Brunner 686cfd4e34 Added support for untruncated MD5 and SHA1 HMACs in ESP as used in RFC 4595.
This requires a Linux kernel >= 2.6.33.
2012-02-27 14:31:19 +01:00
Martin Willi 85dd6a8deb Trigger DPD not before IKE_SA state gets updated 2012-02-02 10:35:50 +01:00
Martin Willi 916cdca851 Don't retransmit, rekey, reauth or DPD check SAs when in PASSIVE state 2012-02-02 10:34:04 +01:00
Thomas Egerer d68b8dfec4 Destroy active task list before queued tasks
Since active task's destruction might result in adopting tasks from a
rekeyed ike sa it seems better to first destroy the active task list and
then destroy all queued tasks. This way adoption is possible at all,
while otherwise the queued task list would be empty.
2012-01-18 10:06:54 +01:00
Tobias Brunner 35a1986142 Fixed additional typos in comments and log messages. 2012-01-12 11:42:42 +01:00
Tobias Brunner fc726f1359 Fix deadlock in trap_manager_t during acquire.
Also fixes a TOCTOU issue regarding the use of entry_t.pending.

The deadlock was caused because the rwlock was being locked while
waiting for an IKE_SA. Triggering the deadlock was a bit tricky, here
is the description by Thomas Egerer (the reporter of this issue):

"
The deadlock occurs when the following happens (in the given order):

a) an IKE_SA is built and a thread is processing the IKE_AUTH request,
   which can take a bit longer when a smartcard is involved. This
   causes the ike_sa_manager to lock a particular IKE_SA exclusively.
b) an acquire is triggered which causes the rwlock in the trap_manager
   to be read-locked, the subsequent call to
   ike_sa_manager->checkout_by_config has to wait until a) unlocks
   it's ike_sa.
c) a child_cfg contained in the peer_cfg belonging to the ike_sa
   a) has locked is routed causes the child_configs contained
   in the peer config to be locked by c) while the actual routing
   code within trap_manager tries to writelock it's rwlock.

That's about it. As soon as a) finishes authentication of the peer
and tries to find a matching child sa it will try to lock the child
configs of the peer config which is not possible since it has been
locked by c).

Thread | Resource locked                | Resource desired
-------+--------------------------------+--------------------------------
  (a)  | ike_sa in ike_sa_manager       | child_cfgs of peer_cfg
       |                                |
  (b)  | rwlock in trap-manager (read)  | ike_sa in ike_sa_manager
       |                                |
  (c)  | child_cfgs of peer_cfg         | rwlock in trap-manager (write)
"

With this patch thread (b) now does not hold the lock while waiting for
the IKE_SA. Thus (c) can get the write lock, and (a) can subsequently
lock the mutex in the peer_cfg which then finally allows (b) to checkout
the IKE_SA.
2011-12-23 11:07:14 +01:00
Tobias Brunner d6656f11e4 Fixed flush() method of trap_manager_t.
A segmentation fault could have happened during destruction of the trap
manager after calling flush().
2011-12-23 10:38:10 +01:00
Thomas Egerer dbd2169569 Change order of destroy/get_ref function calls
Since DESTROY_IF might destroy the peer_cfg, a get_ref on a freed object
is subject to fail.
2011-11-04 11:11:17 +01:00
Tobias Brunner 5d549cd4e1 Log if charon failed to establish a CHILD_SA but keeps the IKE_SA up. 2011-10-21 18:09:02 +02:00
Tobias Brunner c293c87761 Don't use union members directly in plugin_feature_t. 2011-10-14 10:05:47 +02:00
Martin Willi 36b4f05b14 Added a generic callback to register EAP methods using plugin features 2011-10-14 10:05:44 +02:00
Tobias Brunner d46f857511 Fixed unintentional fall-through in task_manager.
Reported by Howard Windsor.
2011-10-06 13:55:50 +02:00
Tobias Brunner d7c552a25e Fixed compilation of ike_me_t. 2011-10-04 10:19:10 +02:00
Andreas Steffen 4fb6b7a12c Migrated child_delete to INIT/METHOD macros 2011-10-04 08:05:27 +02:00
Andreas Steffen 0fc9dd1194 Migrated child_rekey to INIT/METHOD macros 2011-10-04 07:10:46 +02:00
Andreas Steffen ad8f42e898 Migrated ike_auth_lifetime to INIT/METHOD macros 2011-10-04 06:47:35 +02:00
Andreas Steffen 27d7641641 Migrated ike_cert_post to INIT/METHOD macros 2011-10-04 05:59:09 +02:00
Andreas Steffen 08f9f44176 Migrated ike_cert_pre to INIT/METHOD macros 2011-10-04 05:54:08 +02:00
Andreas Steffen 1bf77c8168 Migrated ike_config to INIT/METHOD macros 2011-10-03 23:55:15 +02:00
Andreas Steffen 2e89c3413b Migrated ike_delete to INIT/METHOD macros 2011-10-03 23:49:44 +02:00
Andreas Steffen 6dab816eb2 Migrated ike_dpd to INIT/METHOD macros 2011-10-03 22:37:44 +02:00
Andreas Steffen c73694e7fb Migrated ike_init to INIT/METHOD macros 2011-10-03 22:28:32 +02:00
Andreas Steffen bb6bbe6ddd Migrated ike_me to INIT/METHOD macros 2011-10-03 22:19:46 +02:00
Andreas Steffen 6ade8d6163 Migrated ike_natd to INIT/METHOD macros 2011-10-03 22:06:56 +02:00
Andreas Steffen 7db8fd0d9a Migrated ike_reauth to INIT/METHOD macros 2011-10-03 21:38:04 +02:00
Tobias Brunner b0eb026c05 Migrated mediation_manager_t to INIT/METHOD macros. 2011-10-03 18:42:29 +02:00
Tobias Brunner 02846e5e7f Migrated connect_manager_t to INIT/METHOD macros. 2011-10-03 18:32:12 +02:00
Tobias Brunner 6401b18f12 Migrated ike_sa_id_t to INIT/METHOD macros. 2011-10-03 18:01:05 +02:00
Martin Willi f8437dd8d2 Clear traps during shutdown before unloading kernel plugins 2011-09-12 13:02:51 +02:00
Andreas Steffen a8bbdb1f26 log entry for outbound hash-and-url 2011-08-24 06:05:44 +02:00
Martin Willi 61cf9f512c Try to detect Windows Clients by looking for INTERNAL_IP4/6_SERVER attribute 2011-08-19 09:16:16 +02:00
Andreas Steffen f69f067958 fix double delete of old IKE_SA during reauthentication 2011-08-16 23:25:45 +02:00
Andreas Steffen 65d5f6bc2b some more typos 2011-08-15 21:43:26 +02:00
Tobias Brunner 7ebf021d37 typos: initator->initiator, authenticaion->authentication. 2011-08-15 16:31:04 +02:00
Tobias Brunner 9af9c6772b If we close a duplicate SA, it is also no authentication failure. 2011-08-12 10:11:39 +02:00
Tobias Brunner d9eaecd373 If local authentication fails, it is not really a peer auth failure. 2011-08-12 10:04:02 +02:00
Tobias Brunner ccbe380377 Throw an alert if authentication of the peer fails (not only for initiator). 2011-08-12 10:04:02 +02:00
Tobias Brunner 7ab19d571d Throw an alert when the peer address cannot be resolved during initiation. 2011-08-12 09:59:27 +02:00
Tobias Brunner ff4b25f9b7 Throw an alert via bus_t when remote authentication fails. 2011-08-12 09:59:27 +02:00
Martin Willi efee3ed80f Migrated all SIM/AKA code to libsimaka, use SIM and AKA backend managers registered by name 2011-08-08 13:36:56 +02:00
Tobias Brunner 5baaaa5ed5 Properly initialize ike_sa_t. 2011-08-01 13:08:15 +02:00
Tobias Brunner 241cf8e791 Update fallback drop policies if required. 2011-07-29 12:34:51 +02:00
Tobias Brunner f1c1965d64 Install fallback drop policies for all three directions. 2011-07-28 16:56:15 +02:00
Tobias Brunner d7a59f1976 Install fallback drop policies to avoid transmitting unencrypted packets.
During the update of a CHILD_SA (e.g. caused by MOBIKE) the old policy
is first uninstalled and then the new one is installed.  In the short
time in between, where no policy is available in the kernel, unencrypted
packets could have been transmitted.
2011-07-27 13:44:33 +02:00
Tobias Brunner fbedc6a45b Remove policies in kernel interfaces based on their priority.
This allows to unroute a connection while the same connection is
currently established.  In this case both CHILD_SAs share the same
reqid but the installed policies have different priorities.
2011-07-27 13:41:35 +02:00