Raise an alert if IKE proposals mismatch
authorMartin Willi <martin@revosec.ch>
Tue, 6 Nov 2012 10:01:49 +0000 (11:01 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 19 Dec 2012 09:40:32 +0000 (10:40 +0100)
src/libcharon/bus/bus.h
src/libcharon/sa/ikev2/tasks/ike_init.c

index 4f24127..433658a 100644 (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,
 };
 
 /**
index f2a0673..e296027 100644 (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;