completed IKE_SA logging at the AUDIT level
This commit is contained in:
@@ -56,13 +56,22 @@ static status_t build_i(private_ike_delete_t *this, message_t *message)
|
|||||||
{
|
{
|
||||||
delete_payload_t *delete_payload;
|
delete_payload_t *delete_payload;
|
||||||
|
|
||||||
|
SIG_IKE(DOWN_START, "deleting IKE_SA %s[%d] between %H[%D]...%H[%D]",
|
||||||
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
|
this->ike_sa->get_unique_id(this->ike_sa),
|
||||||
|
this->ike_sa->get_my_host(this->ike_sa),
|
||||||
|
this->ike_sa->get_my_id(this->ike_sa),
|
||||||
|
this->ike_sa->get_other_host(this->ike_sa),
|
||||||
|
this->ike_sa->get_other_id(this->ike_sa));
|
||||||
|
|
||||||
delete_payload = delete_payload_create(PROTO_IKE);
|
delete_payload = delete_payload_create(PROTO_IKE);
|
||||||
message->add_payload(message, (payload_t*)delete_payload);
|
message->add_payload(message, (payload_t*)delete_payload);
|
||||||
|
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
||||||
|
|
||||||
DBG1(DBG_IKE, "sending DELETE for IKE_SA %s[%d]",
|
DBG1(DBG_IKE, "sending DELETE for IKE_SA %s[%d]",
|
||||||
this->ike_sa->get_name(this->ike_sa),
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
this->ike_sa->get_unique_id(this->ike_sa));
|
this->ike_sa->get_unique_id(this->ike_sa));
|
||||||
|
|
||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,18 +85,26 @@ static status_t process_i(private_ike_delete_t *this, message_t *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of task_t.process for initiator
|
* Implementation of task_t.process for responder
|
||||||
*/
|
*/
|
||||||
static status_t process_r(private_ike_delete_t *this, message_t *message)
|
static status_t process_r(private_ike_delete_t *this, message_t *message)
|
||||||
{
|
{
|
||||||
/* we don't even scan the payloads, as the message wouldn't have
|
/* we don't even scan the payloads, as the message wouldn't have
|
||||||
* come so far without being correct */
|
* come so far without being correct */
|
||||||
|
DBG1(DBG_IKE, "received DELETE for IKE_SA %s[%d]",
|
||||||
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
|
this->ike_sa->get_unique_id(this->ike_sa));
|
||||||
|
SIG_IKE(DOWN_START, "deleting IKE_SA %s[%d] between %H[%D]...%H[%D]",
|
||||||
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
|
this->ike_sa->get_unique_id(this->ike_sa),
|
||||||
|
this->ike_sa->get_my_host(this->ike_sa),
|
||||||
|
this->ike_sa->get_my_id(this->ike_sa),
|
||||||
|
this->ike_sa->get_other_host(this->ike_sa),
|
||||||
|
this->ike_sa->get_other_id(this->ike_sa));
|
||||||
|
|
||||||
switch (this->ike_sa->get_state(this->ike_sa))
|
switch (this->ike_sa->get_state(this->ike_sa))
|
||||||
{
|
{
|
||||||
case IKE_ESTABLISHED:
|
case IKE_ESTABLISHED:
|
||||||
DBG1(DBG_IKE, "received DELETE for IKE_SA %s[%d]",
|
|
||||||
this->ike_sa->get_name(this->ike_sa),
|
|
||||||
this->ike_sa->get_unique_id(this->ike_sa));
|
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
||||||
this->ike_sa->reestablish(this->ike_sa);
|
this->ike_sa->reestablish(this->ike_sa);
|
||||||
break;
|
break;
|
||||||
@@ -106,9 +123,11 @@ static status_t process_r(private_ike_delete_t *this, message_t *message)
|
|||||||
*/
|
*/
|
||||||
static status_t build_r(private_ike_delete_t *this, message_t *message)
|
static status_t build_r(private_ike_delete_t *this, message_t *message)
|
||||||
{
|
{
|
||||||
|
SIG_IKE(DOWN_SUCCESS, "IKE_SA deleted");
|
||||||
|
|
||||||
if (this->simultaneous)
|
if (this->simultaneous)
|
||||||
{
|
{
|
||||||
/* wait for peers response for our delete request, but set a timeout */
|
/* wait for peer's response for our delete request, but set a timeout */
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
/* completed, delete IKE_SA by returning FAILED */
|
/* completed, delete IKE_SA by returning FAILED */
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ static status_t process_i(private_ike_reauth_t *this, message_t *message)
|
|||||||
|
|
||||||
/* process delete response first */
|
/* process delete response first */
|
||||||
this->ike_delete->task.process(&this->ike_delete->task, message);
|
this->ike_delete->task.process(&this->ike_delete->task, message);
|
||||||
|
SIG_IKE(DOWN_SUCCESS, "IKE_SA deleted");
|
||||||
|
|
||||||
peer_cfg = this->ike_sa->get_peer_cfg(this->ike_sa);
|
peer_cfg = this->ike_sa->get_peer_cfg(this->ike_sa);
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ static status_t build_i(private_ike_rekey_t *this, message_t *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of task_t.process for initiator
|
* Implementation of task_t.process for responder
|
||||||
*/
|
*/
|
||||||
static status_t process_r(private_ike_rekey_t *this, message_t *message)
|
static status_t process_r(private_ike_rekey_t *this, message_t *message)
|
||||||
{
|
{
|
||||||
@@ -152,6 +152,13 @@ static status_t build_r(private_ike_rekey_t *this, message_t *message)
|
|||||||
|
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_REKEYING);
|
this->ike_sa->set_state(this->ike_sa, IKE_REKEYING);
|
||||||
this->new_sa->set_state(this->new_sa, IKE_ESTABLISHED);
|
this->new_sa->set_state(this->new_sa, IKE_ESTABLISHED);
|
||||||
|
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||||
|
this->new_sa->get_name(this->new_sa),
|
||||||
|
this->new_sa->get_unique_id(this->new_sa),
|
||||||
|
this->ike_sa->get_my_host(this->ike_sa),
|
||||||
|
this->ike_sa->get_my_id(this->ike_sa),
|
||||||
|
this->ike_sa->get_other_host(this->ike_sa),
|
||||||
|
this->ike_sa->get_other_id(this->ike_sa));
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -191,6 +198,14 @@ static status_t process_i(private_ike_rekey_t *this, message_t *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->new_sa->set_state(this->new_sa, IKE_ESTABLISHED);
|
this->new_sa->set_state(this->new_sa, IKE_ESTABLISHED);
|
||||||
|
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||||
|
this->new_sa->get_name(this->new_sa),
|
||||||
|
this->new_sa->get_unique_id(this->new_sa),
|
||||||
|
this->ike_sa->get_my_host(this->ike_sa),
|
||||||
|
this->ike_sa->get_my_id(this->ike_sa),
|
||||||
|
this->ike_sa->get_other_host(this->ike_sa),
|
||||||
|
this->ike_sa->get_other_id(this->ike_sa));
|
||||||
|
|
||||||
to_delete = this->ike_sa->get_id(this->ike_sa);
|
to_delete = this->ike_sa->get_id(this->ike_sa);
|
||||||
|
|
||||||
/* check for collisions */
|
/* check for collisions */
|
||||||
|
|||||||
Reference in New Issue
Block a user