En- and decode DH group attribute in quick mode SA payloads
This commit is contained in:
@@ -684,6 +684,10 @@ static void add_to_proposal_v1_esp(proposal_t *proposal,
|
|||||||
proposal->add_algorithm(proposal, INTEGRITY_ALGORITHM,
|
proposal->add_algorithm(proposal, INTEGRITY_ALGORITHM,
|
||||||
get_alg_from_ikev1(INTEGRITY_ALGORITHM, value), 0);
|
get_alg_from_ikev1(INTEGRITY_ALGORITHM, value), 0);
|
||||||
break;
|
break;
|
||||||
|
case TATTR_PH2_GROUP:
|
||||||
|
proposal->add_algorithm(proposal, DIFFIE_HELLMAN_GROUP,
|
||||||
|
value, 0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* TODO-IKEv1: lifetimes other attributes */
|
/* TODO-IKEv1: lifetimes other attributes */
|
||||||
break;
|
break;
|
||||||
@@ -1076,6 +1080,15 @@ static void set_from_proposal_v1_esp(private_proposal_substructure_t *this,
|
|||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
|
|
||||||
|
enumerator = proposal->create_enumerator(proposal, DIFFIE_HELLMAN_GROUP);
|
||||||
|
if (enumerator->enumerate(enumerator, &alg, &key_size))
|
||||||
|
{
|
||||||
|
transform->add_transform_attribute(transform,
|
||||||
|
transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
|
||||||
|
TATTR_PH2_GROUP, alg));
|
||||||
|
}
|
||||||
|
enumerator->destroy(enumerator);
|
||||||
|
|
||||||
transform->add_transform_attribute(transform,
|
transform->add_transform_attribute(transform,
|
||||||
transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
|
transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
|
||||||
TATTR_PH2_ENCAP_MODE, get_ikev1_mode(mode, udp)));
|
TATTR_PH2_ENCAP_MODE, get_ikev1_mode(mode, udp)));
|
||||||
|
|||||||
Reference in New Issue
Block a user