Process ike_vendor task before ike_init, fixes support for private algs in IKE
[strongswan.git] / src / charon / sa / task_manager.c
index 2432ce7..eeda6c8 100644 (file)
@@ -307,11 +307,11 @@ static status_t build_request(private_task_manager_t *this)
                switch (this->ike_sa->get_state(this->ike_sa))
                {
                        case IKE_CREATED:
+                               activate_task(this, IKE_VENDOR);
                                if (activate_task(this, IKE_INIT))
                                {
                                        this->initiating.mid = 0;
                                        exchange = IKE_SA_INIT;
-                                       activate_task(this, IKE_VENDOR);
                                        activate_task(this, IKE_NATD);
                                        activate_task(this, IKE_CERT_PRE);
 #ifdef ME
@@ -696,10 +696,10 @@ static status_t process_request(private_task_manager_t *this,
                {
                        case IKE_SA_INIT:
                        {
-                               task = (task_t*)ike_init_create(this->ike_sa, FALSE, NULL);
-                               this->passive_tasks->insert_last(this->passive_tasks, task);
                                task = (task_t*)ike_vendor_create(this->ike_sa, FALSE);
                                this->passive_tasks->insert_last(this->passive_tasks, task);
+                               task = (task_t*)ike_init_create(this->ike_sa, FALSE, NULL);
+                               this->passive_tasks->insert_last(this->passive_tasks, task);
                                task = (task_t*)ike_natd_create(this->ike_sa, FALSE);
                                this->passive_tasks->insert_last(this->passive_tasks, task);
                                task = (task_t*)ike_cert_pre_create(this->ike_sa, FALSE);