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

index 3ea4a2a85e4f8966a0e927384f763411f31c43e3..29dd6e332f86935e3b16fb4a9bfb8b51495009d3 100644 (file)
@@ -395,12 +395,15 @@ METHOD(task_t, process_r, status_t,
                                                                                                                   EXT_STRONGSWAN);
                        this->proposal = this->ike_cfg->select_proposal(this->ike_cfg,
                                                                                                                        list, private);
-                       list->destroy_offset(list, offsetof(proposal_t, destroy));
                        if (!this->proposal)
                        {
                                DBG1(DBG_IKE, "no proposal found");
+                               charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_IKE,
+                                                                  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->ike_sa->set_proposal(this->ike_sa, this->proposal);
 
                        this->method = sa_payload->get_auth_method(sa_payload);