wip: ike-init: Indicate support for IKE_INTERMEDIATE
wip: Not strictly necessary. I guess we should also add some checks if the notify was not received.
This commit is contained in:
parent
c09bbf715c
commit
6fcb9cb301
|
@ -167,6 +167,11 @@ enum ike_extension_t {
|
||||||
* Responder accepts childless IKE_SAs, RFC 6023
|
* Responder accepts childless IKE_SAs, RFC 6023
|
||||||
*/
|
*/
|
||||||
EXT_IKE_CHILDLESS = (1<<16),
|
EXT_IKE_CHILDLESS = (1<<16),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IKE_INTERMEDIATE, draft-ietf-ipsecme-ikev2-intermediate
|
||||||
|
*/
|
||||||
|
EXT_IKE_INTERMEDIATE = (1<<17),
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -346,6 +346,7 @@ static bool build_payloads(private_ike_init_t *this, message_t *message)
|
||||||
proposal_t *proposal;
|
proposal_t *proposal;
|
||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
ike_cfg_t *ike_cfg;
|
ike_cfg_t *ike_cfg;
|
||||||
|
bool additional_ke = FALSE;
|
||||||
|
|
||||||
id = this->ike_sa->get_id(this->ike_sa);
|
id = this->ike_sa->get_id(this->ike_sa);
|
||||||
|
|
||||||
|
@ -370,6 +371,8 @@ static bool build_payloads(private_ike_init_t *this, message_t *message)
|
||||||
proposal_list->remove_at(proposal_list, enumerator);
|
proposal_list->remove_at(proposal_list, enumerator);
|
||||||
other_dh_groups->insert_last(other_dh_groups, proposal);
|
other_dh_groups->insert_last(other_dh_groups, proposal);
|
||||||
}
|
}
|
||||||
|
additional_ke = additional_ke ||
|
||||||
|
proposal_has_additional_ke(proposal);
|
||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
/* add proposals that don't contain the selected group */
|
/* add proposals that don't contain the selected group */
|
||||||
|
@ -392,6 +395,7 @@ static bool build_payloads(private_ike_init_t *this, message_t *message)
|
||||||
this->proposal->set_spi(this->proposal, id->get_responder_spi(id));
|
this->proposal->set_spi(this->proposal, id->get_responder_spi(id));
|
||||||
}
|
}
|
||||||
sa_payload = sa_payload_create_from_proposal_v2(this->proposal);
|
sa_payload = sa_payload_create_from_proposal_v2(this->proposal);
|
||||||
|
additional_ke = proposal_has_additional_ke(this->proposal);
|
||||||
}
|
}
|
||||||
message->add_payload(message, (payload_t*)sa_payload);
|
message->add_payload(message, (payload_t*)sa_payload);
|
||||||
|
|
||||||
|
@ -465,6 +469,16 @@ static bool build_payloads(private_ike_init_t *this, message_t *message)
|
||||||
message->add_notify(message, FALSE, CHILDLESS_IKEV2_SUPPORTED,
|
message->add_notify(message, FALSE, CHILDLESS_IKEV2_SUPPORTED,
|
||||||
chunk_empty);
|
chunk_empty);
|
||||||
}
|
}
|
||||||
|
if (!this->old_sa && additional_ke)
|
||||||
|
{
|
||||||
|
if (this->initiator ||
|
||||||
|
this->ike_sa->supports_extension(this->ike_sa,
|
||||||
|
EXT_IKE_INTERMEDIATE))
|
||||||
|
{
|
||||||
|
message->add_notify(message, FALSE, INTERMEDIATE_EXCHANGE_SUPPORTED,
|
||||||
|
chunk_empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,6 +738,13 @@ static void process_payloads(private_ike_init_t *this, message_t *message)
|
||||||
EXT_IKE_CHILDLESS);
|
EXT_IKE_CHILDLESS);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case INTERMEDIATE_EXCHANGE_SUPPORTED:
|
||||||
|
if (!this->old_sa)
|
||||||
|
{
|
||||||
|
this->ike_sa->enable_extension(this->ike_sa,
|
||||||
|
EXT_IKE_INTERMEDIATE);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* other notifies are handled elsewhere */
|
/* other notifies are handled elsewhere */
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue