proposal: Handle skipping DH groups directly in select() and matches()

Also renames the flag.
This commit is contained in:
Tobias Brunner
2019-10-24 17:33:57 +02:00
parent f930b732c4
commit a406bc60c5
5 changed files with 26 additions and 20 deletions
-12
View File
@@ -253,11 +253,6 @@ METHOD(child_cfg_t, select_proposal, proposal_t*,
while (prefer_enum->enumerate(prefer_enum, &proposal))
{
proposal = proposal->clone(proposal);
if (flags & PROPOSAL_STRIP_DH)
{
proposal->strip_dh(proposal, MODP_NONE);
}
if (flags & PROPOSAL_PREFER_CONFIGURED)
{
proposals->reset_enumerator(proposals, match_enum);
@@ -268,13 +263,7 @@ METHOD(child_cfg_t, select_proposal, proposal_t*,
}
while (match_enum->enumerate(match_enum, &match))
{
match = match->clone(match);
if (flags & PROPOSAL_STRIP_DH)
{
match->strip_dh(match, MODP_NONE);
}
selected = proposal->select(proposal, match, flags);
match->destroy(match);
if (selected)
{
DBG2(DBG_CFG, "received proposals: %#P", proposals);
@@ -283,7 +272,6 @@ METHOD(child_cfg_t, select_proposal, proposal_t*,
break;
}
}
proposal->destroy(proposal);
if (selected)
{
break;
+1 -1
View File
@@ -562,7 +562,7 @@ static status_t select_and_install(private_child_create_t *this,
if (no_dh)
{
flags |= PROPOSAL_STRIP_DH;
flags |= PROPOSAL_SKIP_DH;
}
if (this->ike_sa->supports_extension(this->ike_sa, EXT_STRONGSWAN))
{