IKEv1 XAuth: Added temporary "initiate_xauth" public method to ike_sa_t. This allows...
authorClavister OpenSource <opensource@clavister.com>
Thu, 24 Nov 2011 10:21:43 +0000 (11:21 +0100)
committerClavister OpenSource <opensource@clavister.com>
Tue, 20 Mar 2012 16:30:51 +0000 (17:30 +0100)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa.h

index 6be8471..088fd0a 100644 (file)
@@ -2129,6 +2129,18 @@ METHOD(ike_sa_t, destroy, void,
        free(this);
 }
 
+METHOD(ike_sa_t, initiate_xauth, void,
+                        private_ike_sa_t *this)
+{
+       if(this->extensions & EXT_XAUTH)
+       {
+               xauth_request_t *xauth_request_task = xauth_request_create(&this->public, TRUE);
+               this->task_manager->queue_task(this->task_manager, (task_t*)xauth_request_task);
+
+               this->task_manager->initiate_later(this->task_manager);
+       }
+}
+
 /*
  * Described in header.
  */
@@ -2218,6 +2230,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 2753fca..f215855 100644 (file)
@@ -958,6 +958,11 @@ struct ike_sa_t {
         * Destroys a ike_sa_t object.
         */
        void (*destroy) (ike_sa_t *this);
+
+       /**
+        * Initiate an XAuth transaction
+        */
+       void (*initiate_xauth) (ike_sa_t *this);
 };
 
 /**