- reworked usage of IDs in various states

- using ID_ANY for any, not NULL as before
- initiator sends IDr payload in IKE_AUTH when ID unique
This commit is contained in:
Martin Willi
2006-04-27 11:38:24 +00:00
parent f1e87b9022
commit eea353466e
15 changed files with 248 additions and 135 deletions
+14 -14
View File
@@ -373,26 +373,26 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
static status_t process_idr_payload(private_ike_auth_requested_t *this, id_payload_t *idr_payload)
{
identification_t *other_id, *configured_other_id;
connection_t *connection;
other_id = idr_payload->get_identification(idr_payload);
configured_other_id = this->policy->get_other_id(this->policy);
if (configured_other_id)
this->logger->log(this->logger, CONTROL|LEVEL1, "configured ID: %s, ID of responder: %s",
configured_other_id->get_string(configured_other_id),
other_id->get_string(other_id));
if (!other_id->belongs_to(other_id, configured_other_id))
{
this->logger->log(this->logger, CONTROL|LEVEL1, "configured ID: %s, ID of responder: %s",
configured_other_id->get_string(configured_other_id),
other_id->get_string(other_id));
if (!other_id->equals(other_id, configured_other_id))
{
other_id->destroy(other_id);
this->logger->log(this->logger, AUDIT, "IKE_AUTH reply contained a not requested ID. Deleting IKE_SA");
return DELETE_ME;
}
other_id->destroy(other_id);
this->logger->log(this->logger, AUDIT, "IKE_AUTH reply contained a not acceptable ID. Deleting IKE_SA");
return DELETE_ME;
}
other_id->destroy(other_id);
/* TODO do we have to store other_id somewhere ? */
connection = this->ike_sa->get_connection(this->ike_sa);
connection->update_other_id(connection, other_id->clone(other_id));
this->policy->update_other_id(this->policy, other_id);
return SUCCESS;
}