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.

This commit is contained in:
Clavister OpenSource
2012-03-20 17:30:49 +01:00
parent 9769b76cab
commit 54a8a94fa9
6 changed files with 78 additions and 20 deletions
+26
View File
@@ -631,6 +631,24 @@ static payload_order_t quick_mode_r_order[] = {
{ID_V1, 0},
};
/**
* Message rule for TRANSACTION.
*/
static payload_rule_t transaction_payload_rules_v1[] = {
/* payload type min max encr suff */
{HASH_V1, 0, 1, TRUE, FALSE},
{ATTRIBUTE_V1, 1, 1, FALSE, FALSE},
};
/**
* Payload order for TRANSACTION.
*/
static payload_order_t transaction_payload_order_v1[] = {
/* payload type notify type */
{HASH_V1, 0},
{ATTRIBUTE_V1, 0},
};
#endif /* USE_IKEV1 */
/**
@@ -708,6 +726,14 @@ static message_rule_t message_rules[] = {
countof(quick_mode_r_rules), quick_mode_r_rules,
countof(quick_mode_r_order), quick_mode_r_order,
},
{TRANSACTION, TRUE, TRUE,
countof(transaction_payload_rules_v1), transaction_payload_rules_v1,
countof(transaction_payload_order_v1), transaction_payload_order_v1,
},
{TRANSACTION, FALSE, TRUE,
countof(transaction_payload_rules_v1), transaction_payload_rules_v1,
countof(transaction_payload_order_v1), transaction_payload_order_v1,
},
/* TODO-IKEv1: define rules for other exchanges */
#endif /* USE_IKEV1 */
};