IKEv1 XAuth: Add "initiate xauth" method, which adds the xauth task into the queue...
authorClavister OpenSource <opensource@clavister.com>
Tue, 29 Nov 2011 08:15:59 +0000 (09:15 +0100)
committerClavister OpenSource <opensource@clavister.com>
Tue, 20 Mar 2012 16:31:09 +0000 (17:31 +0100)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa.h

index a66d2a8..2de57d6 100644 (file)
@@ -1018,6 +1018,14 @@ METHOD(ike_sa_t, initiate_mediated, status_t,
 }
 #endif /* ME */
 
+METHOD(ike_sa_t, initiate_xauth, status_t,
+       private_ike_sa_t *this)
+{
+       xauth_request_t *task = xauth_request_create(&this->public, TRUE);
+       this->task_manager->queue_task(this->task_manager, (task_t*)task);
+       return this->task_manager->initiate(this->task_manager);
+}
+
 /**
  * Resolve DNS host in configuration
  */
@@ -2085,6 +2093,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
                        .callback = _callback,
                        .respond = _respond,
 #endif /* ME */
+                       .initiate_xauth = _initiate_xauth,
                },
                .ike_sa_id = ike_sa_id->clone(ike_sa_id),
                .version = version,
index 832f8f1..882de41 100644 (file)
@@ -966,6 +966,11 @@ struct ike_sa_t {
         * Destroys a ike_sa_t object.
         */
        void (*destroy) (ike_sa_t *this);
+
+       /**
+        * Initiate an XAuth authentication exchange.
+        */
+       status_t (*initiate_xauth) (ike_sa_t *this);
 };
 
 /**