Commit Graph
1436 Commits
Author SHA1 Message Date
Martin Willi 744c080153 Initiate and respond to quick mode task (stub) 2012-03-20 17:30:45 +01:00
Martin Willi 9124e3425b Fixed reference counting bugs in main mode 2012-03-20 17:30:44 +01:00
Martin Willi 73aaf76be3 Implemented basic message id handling for IKEv1 2012-03-20 17:30:44 +01:00
Martin Willi 2b04aa46ea Added a quick mode task stub 2012-03-20 17:30:44 +01:00
Martin Willi c311d22d0f Don't clone chunk in message.get_packet_data 2012-03-20 17:30:44 +01:00
Martin Willi 31fc14e394 Verify IKEv1 nonce size, send 32 byte nonces 2012-03-20 17:30:44 +01:00
Martin Willi 6c2b7d4ed9 Partially implemented third main mode exchange (identities) 2012-03-20 17:30:44 +01:00
Martin Willi 26b55dc6c8 Implemented first two exchanges of Main Mode as initiator 2012-03-20 17:30:43 +01:00
Martin Willi 9cc63d2cf0 Added enum name for MAIN_MODE task 2012-03-20 17:30:43 +01:00
Martin Willi 558f79f76d Added missing task manager factory declaration 2012-03-20 17:30:43 +01:00
Martin Willi cf6cd5aa4b Added IKEv1 support to delete payload 2012-03-20 17:30:43 +01:00
Martin Willi 04ee2b7fed Added IKEv1 support to notify payload 2012-03-20 17:30:43 +01:00
Tobias Brunner 043ed1b346 Memory leak fixed. 2012-03-20 17:30:43 +01:00
Tobias Brunner 273f2f8054 Added factory function to create task_manager_t implementations. 2012-03-20 17:30:43 +01:00
Tobias Brunner 4b64a1a17d Added factory function to create keymat_t implementations. 2012-03-20 17:30:43 +01:00
Tobias Brunner 0b611540ef Store IKE version of an SA on ike_sa_t. 2012-03-20 17:30:43 +01:00
Tobias Brunner 0fc9acdd23 Added stub for IKEv1 keymat_t implementation. 2012-03-20 17:30:42 +01:00
Tobias Brunner 6ab936f046 Use keymat_t as common interface, renamed current implementation to _v2. 2012-03-20 17:30:42 +01:00
Martin Willi f34b452d56 Implement second exchange in IKEv1 main mode 2012-03-20 17:30:42 +01:00
Martin Willi 683d83ed3e Extended KE payload for IKEv1 support 2012-03-20 17:30:42 +01:00
Martin Willi bcfb0f4096 Extended nonce payload for IKEv1 support 2012-03-20 17:30:42 +01:00
Martin Willi 2e897fe30a Handle first exchange in IKEv1 main mode as responder 2012-03-20 17:30:41 +01:00
Martin Willi c73c832c5a Added an IKEv1 main mode task stub 2012-03-20 17:30:41 +01:00
Martin Willi 4a09d9ee7f Added a stub for a IKEv1 task manager 2012-03-20 17:30:41 +01:00
Martin Willi e69f7dcddf Use task manager as generic interface, renamed implementation to _v2. 2012-03-20 17:30:41 +01:00
Tobias Brunner 3238faf8e6 Fix init message arrival check. 2012-03-20 17:30:41 +01:00
Tobias Brunner 4ed52db2bb Allow creation of message_t objects for IKEv1 packets. 2012-03-20 17:30:40 +01:00
Martin Willi b0b9d18593 Extend sa_payload for IKEv1 support 2012-03-20 17:30:40 +01:00
Martin Willi 837298c590 Use vendor id payload for IKEv1 payloads, too 2012-03-20 17:30:39 +01:00
Martin Willi 2fc986182f Handle IKEv1 messages in managers checkout_by_message 2012-03-20 17:30:39 +01:00
Tobias Brunner 72b2811204 Simplified some route lookups now that we store all peer addresses in a list. 2012-03-09 10:22:21 +01:00
Tobias Brunner 94bbc60256 Renamed list of additional peer addresses as it now stores all known addresses. 2012-03-09 10:17:42 +01:00
Tobias Brunner 2fe624cca9 Store the peer's current address as additional known address on the IKE_SA.
This allows to switch back to the original address after switching to
any of the additional addresses.
2012-03-09 10:08:41 +01:00
Martin Willi 4d7a2128b6 Re-resolve hosts on additional keyingtries 2012-03-06 16:05:28 +01:00
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