Raise an alert if IKE proposals mismatch

This commit is contained in:
Martin Willi
2012-12-19 10:40:32 +01:00
parent 3f7f5388a5
commit bab949bb26
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -107,6 +107,8 @@ enum alert_t {
ALERT_RETRANSMIT_SEND_TIMEOUT,
/** received a retransmit for a message, argument is message_t */
ALERT_RETRANSMIT_RECEIVE,
/** IKE proposals do not match, argument is linked_list_t of proposal_t */
ALERT_PROPOSAL_MISMATCH_IKE,
};
/**
+5
View File
@@ -187,6 +187,11 @@ static void process_payloads(private_ike_init_t *this, message_t *message)
EXT_STRONGSWAN);
this->proposal = this->config->select_proposal(this->config,
proposal_list, private);
if (!this->proposal)
{
charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_IKE,
proposal_list);
}
proposal_list->destroy_offset(proposal_list,
offsetof(proposal_t, destroy));
break;