Replaced DH_NONCE state with TPM_INIT state
[strongswan.git] / src / libimcv / plugins / imv_attestation / imv_attestation_state.h
index b76598c..45d382b 100644 (file)
@@ -23,7 +23,7 @@
 #define IMV_ATTESTATION_STATE_H_
 
 #include <imv/imv_state.h>
-#include <tcg/pts/pts.h>
+#include <pts/pts.h>
 #include <library.h>
 
 typedef struct imv_attestation_state_t imv_attestation_state_t;
@@ -34,15 +34,10 @@ typedef enum imv_attestation_handshake_state_t imv_attestation_handshake_state_t
  */
 enum imv_attestation_handshake_state_t {
        IMV_ATTESTATION_STATE_INIT,
-       IMV_ATTESTATION_STATE_PROTO_CAPS,
-       IMV_ATTESTATION_STATE_MEAS_ALGO,
-       IMV_ATTESTATION_STATE_TPM_INFO,
-       IMV_ATTESTATION_STATE_AIK,
-       IMV_ATTESTATION_STATE_SIMPLE_COMP_EVID,
-       IMV_ATTESTATION_STATE_SIMPLE_EVID_FINAL,
-       IMV_ATTESTATION_STATE_FILE_METADATA,
-       IMV_ATTESTATION_STATE_FILE_MEAS,
-       IMV_ATTESTATION_STATE_IML,
+       IMV_ATTESTATION_STATE_TPM_INIT,
+       IMV_ATTESTATION_STATE_MEAS,
+       IMV_ATTESTATION_STATE_COMP_EVID,
+       IMV_ATTESTATION_STATE_END,
 };
 
 /**
@@ -77,6 +72,34 @@ struct imv_attestation_state_t {
         */
        pts_t* (*get_pts)(imv_attestation_state_t *this);
 
+       /**
+        * Add an entry to the list of pending file/directory measurement requests
+        *
+        * @param file_id                       primary key into file table
+        * @param is_dir                        TRUE if directory
+        * @return                                      unique request ID
+        */
+       u_int16_t (*add_request)(imv_attestation_state_t *this, int file_id,
+                                                        bool is_dir);
+
+       /**
+        * Returns the number of pending file/directory measurement requests
+        *
+        * @return                                      number of pending requests
+        */
+       int (*get_request_count)(imv_attestation_state_t *this);
+
+       /**
+        * Check for presence of request_id and if found remove it from the list
+        *
+        * @param id                            unique request ID
+        * @param file_id                       primary key into file table
+        * @param is_dir                        return TRUE if request was for a directory
+        * @return                                      TRUE if request ID found, FALSE otherwise
+        */
+       bool (*check_off_request)(imv_attestation_state_t *this, u_int16_t id,
+                                                         int *file_id, bool *is_dir);
+
 };
 
 /**