Raise alerts when enforcing IKE_SA unique policy

This commit is contained in:
Martin Willi
2012-12-19 10:40:32 +01:00
parent 5dd9c3087f
commit c794455666
4 changed files with 7 additions and 0 deletions
+4
View File
@@ -111,6 +111,10 @@ enum alert_t {
ALERT_PROPOSAL_MISMATCH_IKE, ALERT_PROPOSAL_MISMATCH_IKE,
/** CHILD proposals do not match, argument is linked_list_t of proposal_t */ /** CHILD proposals do not match, argument is linked_list_t of proposal_t */
ALERT_PROPOSAL_MISMATCH_CHILD, ALERT_PROPOSAL_MISMATCH_CHILD,
/** IKE_SA deleted because of "replace" unique policy, no argument */
ALERT_UNIQUE_REPLACE,
/** IKE_SA deleted because of "keep" unique policy, no arguement */
ALERT_UNIQUE_KEEP,
}; };
/** /**
@@ -191,6 +191,7 @@ METHOD(listener_t, message_hook, bool,
{ {
DBG1(DBG_CFG, "got a response on a duplicate IKE_SA for '%Y', " DBG1(DBG_CFG, "got a response on a duplicate IKE_SA for '%Y', "
"deleting new IKE_SA", id); "deleting new IKE_SA", id);
charon->bus->alert(charon->bus, ALERT_UNIQUE_KEEP);
entry_destroy(entry); entry_destroy(entry);
this->mutex->lock(this->mutex); this->mutex->lock(this->mutex);
entry = this->active->remove(this->active, id); entry = this->active->remove(this->active, id);
+1
View File
@@ -1769,6 +1769,7 @@ METHOD(ike_sa_manager_t, check_uniqueness, bool,
switch (policy) switch (policy)
{ {
case UNIQUE_REPLACE: case UNIQUE_REPLACE:
charon->bus->alert(charon->bus, ALERT_UNIQUE_REPLACE);
DBG1(DBG_IKE, "deleting duplicate IKE_SA for peer " DBG1(DBG_IKE, "deleting duplicate IKE_SA for peer "
"'%Y' due to uniqueness policy", other); "'%Y' due to uniqueness policy", other);
status = duplicate->delete(duplicate); status = duplicate->delete(duplicate);
+1
View File
@@ -807,6 +807,7 @@ METHOD(task_t, build_r, status_t,
this->ike_sa, FALSE)) this->ike_sa, FALSE))
{ {
DBG1(DBG_IKE, "cancelling IKE_SA setup due to uniqueness policy"); DBG1(DBG_IKE, "cancelling IKE_SA setup due to uniqueness policy");
charon->bus->alert(charon->bus, ALERT_UNIQUE_KEEP);
message->add_notify(message, TRUE, AUTHENTICATION_FAILED, message->add_notify(message, TRUE, AUTHENTICATION_FAILED,
chunk_empty); chunk_empty);
return FAILED; return FAILED;