Replaced reason strings with temporary ones for File Measurement Comparison
[strongswan.git] / src / libimcv / plugins / imv_attestation / imv_attestation_state.c
index 3c278a6..cb343a1 100644 (file)
@@ -39,6 +39,11 @@ struct private_imv_attestation_state_t {
         * TNCCS connection state
         */
        TNC_ConnectionState state;
+       
+       /**
+        * IMV Attestation handshake state
+        */
+       imv_attestation_handshake_state_t handshake_state;
 
        /**
         * IMV action recommendation
@@ -49,6 +54,12 @@ struct private_imv_attestation_state_t {
         * IMV evaluation result
         */
        TNC_IMV_Evaluation_Result eval;
+
+       /**
+        * PTS object
+        */
+       pts_t *pts;
+
 };
 
 typedef struct entry_t entry_t;
@@ -65,9 +76,9 @@ struct entry_t {
  * Table of multi-lingual reason string entries 
  */
 static entry_t reasons[] = {
-       { "en", "IMC Attestation ..." },
-       { "mn", "IMC Attestation ..." },
-       { "de", "IMC Attestation ..." },
+       { "en", "IMC Attestation Measurement/s of requested file didn't match" },
+       { "mn", "IMC Attestation Шалгахаар тохируулсан файлуудын хэмжилтүүд таарсангүй" },
+       { "de", "IMC Attestation Messung/en von angefordeten Datein stimmt nicht überein" },
 };
 
 METHOD(imv_state_t, get_connection_id, TNC_ConnectionID,
@@ -145,9 +156,28 @@ METHOD(imv_state_t, get_reason_string, bool,
 METHOD(imv_state_t, destroy, void,
        private_imv_attestation_state_t *this)
 {
+       this->pts->destroy(this->pts);
        free(this);
 }
 
+METHOD(imv_attestation_state_t, get_handshake_state, imv_attestation_handshake_state_t,
+       private_imv_attestation_state_t *this)
+{
+       return this->handshake_state;
+}
+
+METHOD(imv_attestation_state_t, set_handshake_state, void,
+       private_imv_attestation_state_t *this, imv_attestation_handshake_state_t new_state)
+{
+       this->handshake_state = new_state;
+}
+
+METHOD(imv_attestation_state_t, get_pts, pts_t*,
+       private_imv_attestation_state_t *this)
+{
+       return this->pts;
+}
+
 /**
  * Described in header.
  */
@@ -165,13 +195,17 @@ imv_state_t *imv_attestation_state_create(TNC_ConnectionID connection_id)
                                .get_reason_string = _get_reason_string,
                                .destroy = _destroy,
                        },
+                       .get_handshake_state = _get_handshake_state,
+                       .set_handshake_state = _set_handshake_state,
+                       .get_pts = _get_pts,
                },
+               .connection_id = connection_id,
                .state = TNC_CONNECTION_STATE_CREATE,
+               .handshake_state = IMV_ATTESTATION_STATE_INIT,
                .rec = TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
                .eval = TNC_IMV_EVALUATION_RESULT_DONT_KNOW,
+               .pts = pts_create(FALSE),
        );
        
        return &this->public.interface;
 }
-
-