Process ike_vendor task before ike_init, fixes support for private algs in IKE
authorMartin Willi <martin@revosec.ch>
Fri, 26 Feb 2010 10:07:56 +0000 (11:07 +0100)
committerMartin Willi <martin@revosec.ch>
Fri, 26 Feb 2010 10:44:34 +0000 (11:44 +0100)
src/charon/sa/ike_sa.c
src/charon/sa/task_manager.c

index dd523fe..c3a1b94 100644 (file)
@@ -1191,10 +1191,10 @@ static status_t initiate(private_ike_sa_t *this,
 
                set_condition(this, COND_ORIGINAL_INITIATOR, TRUE);
 
-               task = (task_t*)ike_init_create(&this->public, TRUE, NULL);
-               this->task_manager->queue_task(this->task_manager, task);
                task = (task_t*)ike_vendor_create(&this->public, TRUE);
                this->task_manager->queue_task(this->task_manager, task);
+               task = (task_t*)ike_init_create(&this->public, TRUE, NULL);
+               this->task_manager->queue_task(this->task_manager, task);
                task = (task_t*)ike_natd_create(&this->public, TRUE);
                this->task_manager->queue_task(this->task_manager, task);
                task = (task_t*)ike_cert_pre_create(&this->public, TRUE);
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);