android: Android IMC state provides a Platform Trust Service (PTS) instance
authorTobias Brunner <tobias@strongswan.org>
Thu, 2 May 2013 16:48:05 +0000 (18:48 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 Jul 2013 16:49:28 +0000 (18:49 +0200)
src/frontends/android/jni/libandroidbridge/byod/imc_android_state.c
src/frontends/android/jni/libandroidbridge/byod/imc_android_state.h

index 2018f9d..d429b90 100644 (file)
@@ -61,6 +61,11 @@ struct private_imc_android_state_t {
         * Maximum PA-TNC message size for this TNCCS connection
         */
        u_int32_t max_msg_len;
+
+       /**
+        * TCG Platform Trust Service (PTS)
+        */
+       pts_t *pts;
 };
 
 METHOD(imc_state_t, get_connection_id, TNC_ConnectionID,
@@ -125,9 +130,16 @@ METHOD(imc_state_t, get_result, bool,
 METHOD(imc_state_t, destroy, void,
        private_imc_android_state_t *this)
 {
+       this->pts->destroy(this->pts);
        free(this);
 }
 
+METHOD(imc_android_state_t, get_pts, pts_t*,
+       private_imc_android_state_t *this)
+{
+       return this->pts;
+}
+
 /**
  * Described in header.
  */
@@ -149,10 +161,12 @@ imc_state_t *imc_android_state_create(TNC_ConnectionID connection_id)
                                .get_result = _get_result,
                                .destroy = _destroy,
                        },
+                       .get_pts = _get_pts,
                },
                .state = TNC_CONNECTION_STATE_CREATE,
                .result = TNC_IMV_EVALUATION_RESULT_DONT_KNOW,
                .connection_id = connection_id,
+               .pts = pts_create(TRUE),
        );
 
        return &this->public.interface;
index 51bff32..68197f3 100644 (file)
@@ -22,6 +22,7 @@
 #define IMC_ANDROID_STATE_H_
 
 #include <imc/imc_state.h>
+#include <pts/pts.h>
 
 typedef struct imc_android_state_t imc_android_state_t;
 
@@ -34,6 +35,11 @@ struct imc_android_state_t {
         * imc_state_t interface
         */
        imc_state_t interface;
+
+       /**
+        * Get TCG Platform Trust Service (PTS) object
+        */
+       pts_t *(*get_pts)(imc_android_state_t *this);
 };
 
 /**