Clavister OpenSource [Tue, 29 Nov 2011 10:04:36 +0000 (11:04 +0100)]
IKEv1 XAuth + CfgMode: Added ability to process CfgMode messages in the xauth task. Migrated away from using the MIGRATE method to switch queues.
Clavister OpenSource [Tue, 29 Nov 2011 09:52:31 +0000 (10:52 +0100)]
IKEv1 XAuth: Change the main_mode task to use the new initiate_xauth job instead of the old MIGRATE method.
Clavister OpenSource [Tue, 29 Nov 2011 09:42:31 +0000 (10:42 +0100)]
IKEv1 XAuth: Added XAuthResp authentication modes.
Clavister OpenSource [Tue, 29 Nov 2011 08:24:29 +0000 (09:24 +0100)]
IKEv1 XAuth: Added a job to call the initiate_xauth method of ike_sa after the completion of the current set of tasks is complete.
Clavister OpenSource [Tue, 29 Nov 2011 08:15:59 +0000 (09:15 +0100)]
IKEv1 XAuth: Add "initiate xauth" method, which adds the xauth task into the queue for initiation.
Tobias Brunner [Fri, 25 Nov 2011 17:58:18 +0000 (18:58 +0100)]
Use quiet generator when creating IKEv1 message hashes.
This avoids cluttering the log with duplicate log messages when
generating and especially confusing log messages when parsing
authenticated messages.
Tobias Brunner [Fri, 25 Nov 2011 17:57:03 +0000 (18:57 +0100)]
Added an option to create a generator that does not log debug messages.
Tobias Brunner [Fri, 25 Nov 2011 17:01:25 +0000 (18:01 +0100)]
Respond with NO_PROPOSAL_CHOSEN, if we don't find an ike_cfg.
Tobias Brunner [Fri, 25 Nov 2011 17:00:06 +0000 (18:00 +0100)]
Don't respond to malformed INFORMATIONAL_V1 messages with another INFORMATIONAL_V1 exchange.
Tobias Brunner [Fri, 25 Nov 2011 16:59:39 +0000 (17:59 +0100)]
Handle invalid IKEv1 hashes more specifically.
Tobias Brunner [Fri, 25 Nov 2011 16:58:37 +0000 (17:58 +0100)]
Handle unsupported IKEv1 exchange types more specifically.
Tobias Brunner [Fri, 25 Nov 2011 16:54:28 +0000 (17:54 +0100)]
Send an INFORMATIONAL message on IKEv1 parse errors.
Tobias Brunner [Fri, 25 Nov 2011 16:45:30 +0000 (17:45 +0100)]
Handle INFORMATIONAL_V1 messages when no keys have been derived yet.
This allows to gracefully process the INFORMATIONAL_V1 message rules which
require the payloads to be encrypted and thus the exchange to be
authenticated with a HASH payload. If such an exchange is now initiated
before the ISAKMP_SA is established, the message is simply sent unencrypted
and without HASH payload.
Tobias Brunner [Fri, 25 Nov 2011 15:24:32 +0000 (16:24 +0100)]
Error reporting for invalid IKEv2 responses fixed.
Tobias Brunner [Fri, 25 Nov 2011 15:08:12 +0000 (16:08 +0100)]
Set request flag to proper value for IKEv1 messages before parsing them.
Tobias Brunner [Fri, 25 Nov 2011 15:05:00 +0000 (16:05 +0100)]
Avoid parsing retransmits we already responded to.
Decryption will fail as we already moved the IV when we sent the
response. Without this change, encrypted retransmits would have been
discarded during parsing already.
Tobias Brunner [Fri, 25 Nov 2011 14:53:23 +0000 (15:53 +0100)]
Moved main part of message processing to task managers.
This will allow individual error handling for each IKE version and should
allow better handling of IKEv1 retransmits.
Tobias Brunner [Fri, 25 Nov 2011 13:48:57 +0000 (14:48 +0100)]
Addded ike_sa_t.set_statistic to set timestamps from task manager.
Tobias Brunner [Fri, 25 Nov 2011 10:26:20 +0000 (11:26 +0100)]
Compiler warning fixed in prf_plus_t.
Tobias Brunner [Fri, 25 Nov 2011 10:25:45 +0000 (11:25 +0100)]
Use proper enum types in proposal_substructure.
Clavister OpenSource [Fri, 25 Nov 2011 07:45:42 +0000 (08:45 +0100)]
IKEv1 XAuth: Fix XAuth task so that it reinitiates.
Clavister OpenSource [Fri, 25 Nov 2011 07:41:41 +0000 (08:41 +0100)]
Revert "IKEv1 XAuth: Temporarilty add an "initiate_later" flag to the task manager. When set to TRUE it will cause "initiate" to be called when the current process_response call is finished. This change should be reverted once we have a better method in place."
This reverts commit
c6c28f4ac522dd8afb457847bca79eee77f78706.
Revert "IKEv1 XAuth: Added temporary "initiate_xauth" public method to ike_sa_t. This allows us to initiate an XAuth password authentication exchange after responding to the final message of Main Mode. This change should be reverted once we have a better method to initiate this exchange."
This reverts commit
5529dc50477e25df9dd5f3c442bb1521c0baf225.
Clavister OpenSource [Fri, 25 Nov 2011 07:24:30 +0000 (08:24 +0100)]
IKEv1 XAuth: Fix main mode to work with XAuth PSK.
Martin Willi [Thu, 24 Nov 2011 15:32:14 +0000 (16:32 +0100)]
Use a dedicated IKEv1 vendor ID task to fix using IKEv2 payloads in IKEv1
Martin Willi [Thu, 24 Nov 2011 15:11:05 +0000 (16:11 +0100)]
Pass concrete auth_method to key derivation, as we have that as a responder
Martin Willi [Thu, 24 Nov 2011 15:07:13 +0000 (16:07 +0100)]
Map auth_class to auth method and IKEv1 proposal attribute
Martin Willi [Thu, 24 Nov 2011 14:32:13 +0000 (15:32 +0100)]
Removed obsolete transform attribute setters
Martin Willi [Thu, 24 Nov 2011 14:25:22 +0000 (15:25 +0100)]
Implemented IKEv1 attribute encoding in SA payload
Martin Willi [Thu, 24 Nov 2011 11:52:11 +0000 (12:52 +0100)]
Implemented encoding of additional IKEv1 proposal attributes
Martin Willi [Thu, 24 Nov 2011 14:25:00 +0000 (15:25 +0100)]
Exchange IKEv1 ESP SA proposal information
Martin Willi [Thu, 24 Nov 2011 13:51:04 +0000 (14:51 +0100)]
Exchange IKEv1 SA specific proposal data with SA payload
Martin Willi [Thu, 24 Nov 2011 10:39:31 +0000 (11:39 +0100)]
Added not-yet used sa_payload parameters used in IKEv1
Martin Willi [Thu, 24 Nov 2011 10:38:37 +0000 (11:38 +0100)]
Added a get_rekey/reauth_time() jitter parameter to get time without randomization
Clavister OpenSource [Thu, 24 Nov 2011 15:57:10 +0000 (16:57 +0100)]
IKEv1 XAuth: Changed the xauth_request task to use the new MIGRATE status.
Clavister OpenSource [Thu, 24 Nov 2011 15:48:41 +0000 (16:48 +0100)]
IKEv1 XAuth: Added new MIGRATE status type to status_t.
When a task returns this status from a build or process method, it is a signal to the task manager that it should treat it as if the task returned SUCCESS.
Additionally it will migrate all remaining tasks from the current queue to a different one, calling swap_initiator for each applicable task.
Finally, the task manager will call "initiate", if applicable, to kick off tasks in the "queued_tasks" queue.
Task queue relocation mapping:
passive_tasks moves to queued_tasks (which is then fed to active by the initiate call).
active_tasks moves to passive_tasks
Clavister OpenSource [Thu, 24 Nov 2011 15:35:22 +0000 (16:35 +0100)]
IKEv1 XAuth: Added new "swap_initiator" method to the standard task_t interface. This is needed for when we move a task from the passive queue to the active one. I'm not a huge fan of this method of doing things. Perhaps we should change task_t to have build_i, build_r, process_i, and process_r methods, and call the appropriate one from the task manager, since we have these methods for most tasks anyways.
Clavister OpenSource [Thu, 24 Nov 2011 10:46:02 +0000 (11:46 +0100)]
IKEv1 XAuth: XAuthInitPreShared working for XAuth initiator (Main Mode responder). Creates USER/PASS request, retrieves the result and sends status.
Clavister OpenSource [Thu, 24 Nov 2011 10:40:55 +0000 (11:40 +0100)]
IKEv1 XAuth: Added ability to initiate the XAuth transactions under a flag, default not to initiate XAuth.
Clavister OpenSource [Thu, 24 Nov 2011 10:37:36 +0000 (11:37 +0100)]
IKEv1 XAuth: Add XAUTH authentication types to the enum. Added the ability to switch between hardcoded PSK and XAUTH_INIT_PSK authentications using a flag, default to PSK.
Clavister OpenSource [Thu, 24 Nov 2011 10:33:38 +0000 (11:33 +0100)]
IKEv1 ConfigMode: Fix configuration_attribute encoding rules for IKEv1 to use the attribute type instead of the internal only payload type.
Clavister OpenSource [Thu, 24 Nov 2011 10:30:19 +0000 (11:30 +0100)]
IKEv1 ConfigMode: Fixed cp_payload to use CONFIGURATION_ATTRIBUTE_V1 in all appropriate places, so the parsing is done correctly.
Clavister OpenSource [Thu, 24 Nov 2011 10:26:04 +0000 (11:26 +0100)]
IKEv1 XAuth: Added ike_vendor task to the ID_PROT exchange type processing. We need to process vendor payloads to check to see if our peer understands XAuth before using any of these payload types.
Clavister OpenSource [Thu, 24 Nov 2011 10:21:43 +0000 (11:21 +0100)]
IKEv1 XAuth: Added temporary "initiate_xauth" public method to ike_sa_t. This allows us to initiate an XAuth password authentication exchange after responding to the final message of Main Mode. This change should be reverted once we have a better method to initiate this exchange.
Clavister OpenSource [Thu, 24 Nov 2011 10:12:59 +0000 (11:12 +0100)]
IKEv1 XAuth: Temporarilty add an "initiate_later" flag to the task manager. When set to TRUE it will cause "initiate" to be called when the current process_response call is finished. This change should be reverted once we have a better method in place.
Martin Willi [Thu, 24 Nov 2011 09:33:43 +0000 (10:33 +0100)]
Use quick mode task initiator flag instead of passing it as parameter
Martin Willi [Thu, 24 Nov 2011 09:28:49 +0000 (10:28 +0100)]
Add quick mode ID payloads only if establishing a non-host2host tunnel
Martin Willi [Thu, 24 Nov 2011 09:20:59 +0000 (10:20 +0100)]
Refactored traffic selector handling in quick mode
Martin Willi [Thu, 24 Nov 2011 08:51:40 +0000 (09:51 +0100)]
Refactored NONCE payload handling in quick mode
Tobias Brunner [Wed, 23 Nov 2011 15:08:40 +0000 (16:08 +0100)]
No need to build a HASH payload in XAUTH task.
It gets added automatically when the message is generated.
Martin Willi [Wed, 23 Nov 2011 14:55:00 +0000 (15:55 +0100)]
Create host-to-host traffic selectors if quick mode identities missing
Tobias Brunner [Wed, 23 Nov 2011 14:30:41 +0000 (15:30 +0100)]
Removed redundant '=>' when logging binary data in parser and generator.
Tobias Brunner [Wed, 23 Nov 2011 14:23:20 +0000 (15:23 +0100)]
Fixed encryption of IKEv2 messages.
Martin Willi [Wed, 23 Nov 2011 13:41:07 +0000 (14:41 +0100)]
Print message payload names after prepending IKEv1 HASH payload
Martin Willi [Wed, 23 Nov 2011 13:33:03 +0000 (14:33 +0100)]
Fixed task_manager_v1 compiler warnings
Martin Willi [Wed, 23 Nov 2011 13:31:17 +0000 (14:31 +0100)]
Generate a new mid only after we start a new task (and exchange)
Martin Willi [Wed, 23 Nov 2011 13:26:24 +0000 (14:26 +0100)]
Derive IKEv1 CHILD_SA keymat twice, once for each IPsec SA
Martin Willi [Wed, 23 Nov 2011 13:05:19 +0000 (14:05 +0100)]
Fix seed construction for IKEv1 key derivation
Martin Willi [Wed, 23 Nov 2011 12:56:51 +0000 (13:56 +0100)]
Use a dedicated message hash to detect IKEv1 retransmissions
Martin Willi [Wed, 23 Nov 2011 12:56:21 +0000 (13:56 +0100)]
Include hardcoded tunnel mode attribute in porposal, remove ESN attribute
Tobias Brunner [Wed, 23 Nov 2011 12:17:46 +0000 (13:17 +0100)]
Authenticate and verify Phase 2 IKEv1 messages with appropriate hashes.
Tobias Brunner [Wed, 23 Nov 2011 11:35:58 +0000 (12:35 +0100)]
Fixed verification of DELETE_V1 payloads.
Tobias Brunner [Wed, 23 Nov 2011 11:35:10 +0000 (12:35 +0100)]
Fixed header length calculation of DELETE payload.
Tobias Brunner [Wed, 23 Nov 2011 11:11:49 +0000 (12:11 +0100)]
Fixed conftests after extending CERT payload.
Martin Willi [Wed, 23 Nov 2011 10:27:47 +0000 (11:27 +0100)]
Fixed a config reference leak in IKEv2 initiate
Martin Willi [Wed, 23 Nov 2011 10:27:03 +0000 (11:27 +0100)]
XAUTH is initiated based on configuration, no need to call externally
Martin Willi [Wed, 23 Nov 2011 10:26:04 +0000 (11:26 +0100)]
Merged IKEv1 attribute payload/data into configuration payload/attribute
Clavister OpenSource [Wed, 23 Nov 2011 09:15:52 +0000 (10:15 +0100)]
Temp fix for compile error with XAUTH code.
Clavister OpenSource [Wed, 23 Nov 2011 07:55:59 +0000 (08:55 +0100)]
IKEv1 XAUTH: Added ability to configure XAUTH+PSK. Added task to handle XAUTH requests. Modified task_manager_v1 to enable it to initiate new tasks immediately after finishing a response.
Clavister OpenSource [Wed, 23 Nov 2011 07:40:18 +0000 (08:40 +0100)]
Updates ike_cert_post task with modifications needed for dealing with updated cert_payload class.
Clavister OpenSource [Wed, 23 Nov 2011 07:36:22 +0000 (08:36 +0100)]
IKEv1 ConfigMode: Added the payload handlers for attribute_payload and data_attribute payload types.
Clavister OpenSource [Wed, 23 Nov 2011 07:29:54 +0000 (08:29 +0100)]
IKEv1 ConfigMode: Added TRANSACTION exchange type. Added attribute_payload (IKEv2 equiv cp_payload) and data_attribute (IKEv2 equiv configuration_attribute) payload types. Did not combine with IKEv2 because it wasn't trivial to do so. This might be a task worth investigating in the future, because there is a decent amount of shared code here.
Clavister OpenSource [Wed, 23 Nov 2011 07:04:52 +0000 (08:04 +0100)]
Updated the CERT payload to work for both IKEv1 and IKEv2.
Martin Willi [Tue, 22 Nov 2011 16:04:07 +0000 (17:04 +0100)]
Parse proposal substructure with multiple IKEv1 transforms to multiple proposals
Martin Willi [Tue, 22 Nov 2011 15:47:17 +0000 (16:47 +0100)]
Encode multiple IKEv1 proposals in a single transform substructure
Martin Willi [Tue, 22 Nov 2011 15:28:44 +0000 (16:28 +0100)]
Remove public sa_payload.add_proposal() method
Martin Willi [Tue, 22 Nov 2011 15:16:19 +0000 (16:16 +0100)]
Only add the first algorithm of a kind to IKEv1 transforms
Martin Willi [Tue, 22 Nov 2011 14:24:24 +0000 (15:24 +0100)]
Install negotiated IKEv1 CHILD_SA negotiated in quick mode
Martin Willi [Tue, 22 Nov 2011 13:58:17 +0000 (14:58 +0100)]
Implemented IKEv1 keymat CHILD_SA key derivation function
Martin Willi [Tue, 22 Nov 2011 13:54:50 +0000 (14:54 +0100)]
Moved keymat key length lookup functions to keymat.c
Martin Willi [Tue, 22 Nov 2011 13:38:43 +0000 (14:38 +0100)]
Extended PRF+ by a non-counting variant as used by IKEv1
Martin Willi [Tue, 22 Nov 2011 11:37:08 +0000 (12:37 +0100)]
Hardcode some SA lifetimes until we can configure them dynamically
Tobias Brunner [Tue, 22 Nov 2011 08:46:31 +0000 (09:46 +0100)]
Added missing comma after ME_CONNECT declaration.
Tobias Brunner [Tue, 22 Nov 2011 08:44:09 +0000 (09:44 +0100)]
Fixed creation of endpoint notifies.
Tobias Brunner [Tue, 22 Nov 2011 08:41:58 +0000 (09:41 +0100)]
Fixed diagram of IKEv1 encrypted "payload".
Martin Willi [Tue, 22 Nov 2011 08:32:30 +0000 (09:32 +0100)]
Refactored main mode NONCE/KE payload processing
Martin Willi [Tue, 22 Nov 2011 08:14:57 +0000 (09:14 +0100)]
Refactored main mode HASH payload processing
Martin Willi [Tue, 22 Nov 2011 07:56:01 +0000 (08:56 +0100)]
Skip any payloads in front of SA to extract initiators SA bytes
Martin Willi [Mon, 21 Nov 2011 16:56:39 +0000 (17:56 +0100)]
Implemented quick mode protocol handling, no CHILD_SA or HASH payloads yet
Martin Willi [Mon, 21 Nov 2011 16:40:42 +0000 (17:40 +0100)]
Partially implemented IKEv1 ESP proposal en-/decoding
Martin Willi [Mon, 21 Nov 2011 16:32:19 +0000 (17:32 +0100)]
Add missing keymat cast to avoid compiler warning
Martin Willi [Mon, 21 Nov 2011 16:18:43 +0000 (17:18 +0100)]
Don't compare initiator flag in IKE_SA manager, pass initiator parameter to IKE_SA constructor
Martin Willi [Mon, 21 Nov 2011 16:16:39 +0000 (17:16 +0100)]
Create and verify PSK HASH payloads in IKEv1 main mode
Martin Willi [Mon, 21 Nov 2011 15:41:48 +0000 (16:41 +0100)]
Added keymat_v1_t.get_hash() to calculate authentication hashes
Martin Willi [Mon, 21 Nov 2011 15:41:16 +0000 (16:41 +0100)]
Register HASH_V1 in payload factory
Martin Willi [Mon, 21 Nov 2011 13:36:05 +0000 (14:36 +0100)]
Derive IKE keys as IKEv1 initiator, too
Martin Willi [Mon, 21 Nov 2011 12:43:48 +0000 (13:43 +0100)]
Fix payload length of id_payload created from a traffic selector
Tobias Brunner [Mon, 21 Nov 2011 14:18:40 +0000 (15:18 +0100)]
String for ENCRYPTED_DATA fixed.
Tobias Brunner [Mon, 21 Nov 2011 14:16:51 +0000 (15:16 +0100)]
Strings for ENCRYPTED_V1 payload added.
Tobias Brunner [Mon, 21 Nov 2011 12:26:27 +0000 (13:26 +0100)]
Set flags on message according to IKE version when parsing header.
Tobias Brunner [Mon, 21 Nov 2011 12:24:17 +0000 (13:24 +0100)]
Encrypt IKEv1 messages.