Moved IKE_SA reauth task creation to protocol specific task manager
authorMartin Willi <martin@revosec.ch>
Mon, 19 Dec 2011 13:39:05 +0000 (14:39 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:27 +0000 (17:31 +0100)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ikev1/task_manager_v1.c
src/libcharon/sa/ikev2/task_manager_v2.c
src/libcharon/sa/task_manager.h

index 7e2fccd..d3aad94 100644 (file)
@@ -1332,8 +1332,6 @@ METHOD(ike_sa_t, rekey, status_t,
 METHOD(ike_sa_t, reauth, status_t,
        private_ike_sa_t *this)
 {
-       task_t *task;
-
        /* we can't reauthenticate as responder when we use EAP or virtual IPs.
         * If the peer does not support RFC4478, there is no way to keep the
         * IKE_SA up. */
@@ -1359,9 +1357,7 @@ METHOD(ike_sa_t, reauth, status_t,
                        DBG1(DBG_IKE, "reauthenticating actively");
                }
        }
-       task = (task_t*)ike_reauth_create(&this->public);
-       this->task_manager->queue_task(this->task_manager, task);
-
+       this->task_manager->queue_ike_reauth(this->task_manager);
        return this->task_manager->initiate(this->task_manager);
 }
 
index f135d02..d23b237 100644 (file)
@@ -1029,6 +1029,12 @@ METHOD(task_manager_t, queue_ike_rekey, void,
        /* TODO-IKEv1: IKE_SA rekeying */
 }
 
+METHOD(task_manager_t, queue_ike_reauth, void,
+       private_task_manager_t *this)
+{
+       /* TODO-IKEv1: IKE_SA reauth */
+}
+
 METHOD(task_manager_t, queue_ike_delete, void,
        private_task_manager_t *this)
 {
@@ -1139,6 +1145,7 @@ task_manager_v1_t *task_manager_v1_create(ike_sa_t *ike_sa)
                                .queue_task = _queue_task,
                                .queue_ike = _queue_ike,
                                .queue_ike_rekey = _queue_ike_rekey,
+                               .queue_ike_reauth = _queue_ike_reauth,
                                .queue_ike_delete = _queue_ike_delete,
                                .queue_child = _queue_child,
                                .queue_child_rekey = _queue_child_rekey,
index fd9572d..f2cfad2 100644 (file)
@@ -27,6 +27,7 @@
 #include <sa/ikev2/tasks/ike_cert_pre.h>
 #include <sa/ikev2/tasks/ike_cert_post.h>
 #include <sa/ikev2/tasks/ike_rekey.h>
+#include <sa/ikev2/tasks/ike_reauth.h>
 #include <sa/ikev2/tasks/ike_delete.h>
 #include <sa/ikev2/tasks/ike_config.h>
 #include <sa/ikev2/tasks/ike_dpd.h>
@@ -1206,6 +1207,12 @@ METHOD(task_manager_t, queue_ike_rekey, void,
        queue_task(this, (task_t*)ike_rekey_create(this->ike_sa, TRUE));
 }
 
+METHOD(task_manager_t, queue_ike_reauth, void,
+       private_task_manager_t *this)
+{
+       queue_task(this, (task_t*)ike_reauth_create(this->ike_sa));
+}
+
 METHOD(task_manager_t, queue_ike_delete, void,
        private_task_manager_t *this)
 {
@@ -1364,6 +1371,7 @@ task_manager_v2_t *task_manager_v2_create(ike_sa_t *ike_sa)
                                .queue_task = _queue_task,
                                .queue_ike = _queue_ike,
                                .queue_ike_rekey = _queue_ike_rekey,
+                               .queue_ike_reauth = _queue_ike_reauth,
                                .queue_ike_delete = _queue_ike_delete,
                                .queue_child = _queue_child,
                                .queue_child_rekey = _queue_child_rekey,
index 6ea48fa..4087265 100644 (file)
@@ -135,6 +135,11 @@ struct task_manager_t {
        void (*queue_ike_rekey)(task_manager_t *this);
 
        /**
+        * Queue IKE_SA reauth tasks.
+        */
+       void (*queue_ike_reauth)(task_manager_t *this);
+
+       /**
         * Queue IKE_SA delete tasks.
         */
        void (*queue_ike_delete)(task_manager_t *this);