]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ikev1: Raise PROPOSAL_MISMATCH_CHILD alert during Quick Mode
authorMartin Willi <martin@revosec.ch>
Tue, 2 Jun 2015 09:45:45 +0000 (11:45 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 29 Jun 2015 07:22:50 +0000 (09:22 +0200)
src/libcharon/sa/ikev1/tasks/quick_mode.c

index 96edfd8d8541a046ad58748ce4b2db63809bc0d5..ee6d9493fbcaac6080f723c139ccbc0123efb7a2 100644 (file)
@@ -1087,7 +1087,6 @@ METHOD(task_t, process_r, status_t,
                                                                                                           EXT_STRONGSWAN);
                        this->proposal = this->config->select_proposal(this->config,
                                                                                                                   list, FALSE, private);
-                       list->destroy_offset(list, offsetof(proposal_t, destroy));
 
                        get_lifetimes(this);
                        apply_lifetimes(this, sa_payload);
@@ -1096,8 +1095,12 @@ METHOD(task_t, process_r, status_t,
                        {
                                DBG1(DBG_IKE, "no matching proposal found, sending %N",
                                         notify_type_names, NO_PROPOSAL_CHOSEN);
+                               charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_CHILD,
+                                                                  list, TRUE);
+                               list->destroy_offset(list, offsetof(proposal_t, destroy));
                                return send_notify(this, NO_PROPOSAL_CHOSEN);
                        }
+                       list->destroy_offset(list, offsetof(proposal_t, destroy));
                        this->spi_i = this->proposal->get_spi(this->proposal);
 
                        if (!get_nonce(this, &this->nonce_i, message))