Implemented migration of XAuth task
authorMartin Willi <martin@revosec.ch>
Tue, 20 Dec 2011 17:00:57 +0000 (18:00 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:29 +0000 (17:31 +0100)
src/libcharon/sa/ikev1/tasks/xauth.c

index b4d6900..f552993 100644 (file)
@@ -354,7 +354,25 @@ METHOD(task_t, get_type, task_type_t,
 METHOD(task_t, migrate, void,
        private_xauth_t *this, ike_sa_t *ike_sa)
 {
+       DESTROY_IF(this->xauth);
+       DESTROY_IF(this->cp);
+
        this->ike_sa = ike_sa;
+       this->xauth = NULL;
+       this->cp = NULL;
+       this->user = NULL;
+       this->status = XAUTH_FAILED;
+
+       if (this->initiator)
+       {
+               this->public.task.build = _build_i;
+               this->public.task.process = _process_i;
+       }
+       else
+       {
+               this->public.task.build = _build_r;
+               this->public.task.process = _process_r;
+       }
 }
 
 METHOD(task_t, destroy, void,