aggressive-mode: Determine local identity before deriving keys

This might require a PSK, for which the local identity might be necessary.
This commit is contained in:
Tobias Brunner
2022-07-18 12:56:20 +02:00
parent 833333eae9
commit 3d966d6d0a
@@ -604,14 +604,15 @@ METHOD(task_t, build_r, status_t,
{
return send_notify(this, NO_PROPOSAL_CHOSEN);
}
id = this->ph1->get_id(this->ph1, this->peer_cfg, TRUE);
this->ike_sa->set_my_id(this->ike_sa, id->clone(id));
if (!this->ph1->derive_keys(this->ph1, this->peer_cfg, this->method))
{
return send_notify(this, INVALID_KEY_INFORMATION);
}
id = this->ph1->get_id(this->ph1, this->peer_cfg, TRUE);
this->ike_sa->set_my_id(this->ike_sa, id->clone(id));
id_payload = id_payload_create_from_identification(PLV1_ID, id);
message->add_payload(message, &id_payload->payload_interface);