shortened some type names and enforced encoding rules
[strongswan.git] / src / libimcv / tcg / tcg_pts_attr_get_tpm_version_info.c
index 5fbd918..cb807e1 100644 (file)
@@ -23,7 +23,8 @@
 typedef struct private_tcg_pts_attr_get_tpm_version_info_t private_tcg_pts_attr_get_tpm_version_info_t;
 
 /**
- * Get TPM Version Information (see section 3.10 of PTS Protocol: Binding to TNC IF-M Specification)
+ * Get TPM Version Information
+ * see section 3.10 of PTS Protocol: Binding to TNC IF-M Specification
  *
  *                       1                   2                   3
  *   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
@@ -35,15 +36,15 @@ typedef struct private_tcg_pts_attr_get_tpm_version_info_t private_tcg_pts_attr_
  */
 
 #define PTS_GET_TPM_VER_INFO_SIZE              4
-#define PTS_GET_TPM_VER_INFO_RESERVED          0x00
+#define PTS_GET_TPM_VER_INFO_RESERVED  0x00
 
 /**
- * Private data of an private_tcg_pts_attr_get_tpm_version_info_t object.
+ * Private data of an tcg_pts_attr_get_tpm_version_info_t object.
  */
 struct private_tcg_pts_attr_get_tpm_version_info_t {
 
        /**
-        * Public members of private_tcg_pts_attr_req_proto_caps_t
+        * Public members of tcg_pts_attr_get_tpm_version_info_t
         */
        tcg_pts_attr_get_tpm_version_info_t public;
 
@@ -111,7 +112,7 @@ METHOD(pa_tnc_attr_t, build, void,
 }
 
 METHOD(pa_tnc_attr_t, process, status_t,
-       private_tcg_pts_attr_get_tpm_version_info_t *this)
+       private_tcg_pts_attr_get_tpm_version_info_t *this, u_int32_t *offset)
 {
        bio_reader_t *reader;
        u_int32_t reserved;
@@ -119,13 +120,14 @@ METHOD(pa_tnc_attr_t, process, status_t,
        if (this->value.len < PTS_GET_TPM_VER_INFO_SIZE)
        {
                DBG1(DBG_TNC, "insufficient data for Get TPM Version Information");
+               *offset = 0;
                return FAILED;
        }
        reader = bio_reader_create(this->value);
        reader->read_uint32 (reader, &reserved);
        reader->destroy(reader);
 
-       return SUCCESS; 
+       return SUCCESS;
 }
 
 METHOD(pa_tnc_attr_t, destroy, void,