ike: Reset local SPI if retrying to connect in state IKE_CONNECTING
In case we send retransmits for an IKE_SA_INIT where we propose a DH group the responder will reject we might later receive delayed responses that either contain INVALID_KE_PAYLOAD notifies with the group we already use or, if we retransmitted an IKE_SA_INIT with the requested group but then had to restart again, a KE payload with a group different from the one we proposed. So far we didn't change the initiator SPI when restarting the connection, i.e. these delayed responses were processed and might have caused fatal errors due to a failed DH negotiation or because of the internal retry counter in the ike-init task. Changing the initiator SPI avoids that as we won't process the delayed responses anymore that caused this confusion.
This commit is contained in:
@@ -815,7 +815,7 @@ METHOD(task_t, process_i, status_t,
|
||||
|
||||
if (this->old_sa == NULL)
|
||||
{ /* reset the IKE_SA if we are not rekeying */
|
||||
this->ike_sa->reset(this->ike_sa);
|
||||
this->ike_sa->reset(this->ike_sa, FALSE);
|
||||
}
|
||||
|
||||
enumerator->destroy(enumerator);
|
||||
@@ -833,7 +833,7 @@ METHOD(task_t, process_i, status_t,
|
||||
{
|
||||
chunk_free(&this->cookie);
|
||||
this->cookie = chunk_clone(notify->get_notification_data(notify));
|
||||
this->ike_sa->reset(this->ike_sa);
|
||||
this->ike_sa->reset(this->ike_sa, FALSE);
|
||||
enumerator->destroy(enumerator);
|
||||
DBG2(DBG_IKE, "received %N notify", notify_type_names, type);
|
||||
this->retry++;
|
||||
|
||||
Reference in New Issue
Block a user