Changes according to the new PTS Attributes addition
authorSansar Choinyambuu <schoinya@hsr.ch>
Fri, 5 Aug 2011 15:46:30 +0000 (17:46 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Sep 2011 10:08:09 +0000 (12:08 +0200)
src/libimcv/Makefile.am
src/libimcv/plugins/imc_attestation/imc_attestation.c
src/libimcv/plugins/imv_attestation/imv_attestation.c
src/libimcv/tcg/tcg_attr.h

index 3b4629e..56379db 100644 (file)
@@ -15,8 +15,15 @@ libimcv_la_SOURCES = \
        ita/ita_attr_command.h ita/ita_attr_command.c \
        pa_tnc/pa_tnc_msg.h pa_tnc/pa_tnc_msg.c \
        pa_tnc/pa_tnc_attr.h pa_tnc/pa_tnc_attr.c \
-       tcg/tcg_attr.h tcg/tcg_attr.c
-
+       tcg/tcg_attr.h tcg/tcg_attr.c \
+       tcg/tcg_pts_attr_req_proto_caps.h tcg/tcg_pts_attr_req_proto_caps.c \
+       tcg/tcg_pts_attr_proto_caps.h tcg/tcg_pts_attr_proto_caps.c \
+       tcg/tcg_pts_attr_meas_algo.h tcg/tcg_pts_attr_meas_algo.c \
+       tcg/tcg_pts_attr_meas_algo_selection.h tcg/tcg_pts_attr_meas_algo_selection.c \
+       tcg/tcg_pts_attr_get_tpm_version_info.h tcg/tcg_pts_attr_get_tpm_version_info.c \
+       tcg/tcg_pts_attr_tpm_version_info.h tcg/tcg_pts_attr_tpm_version_info.c \
+       tcg/tcg_pts_attr_get_aik.h tcg/tcg_pts_attr_get_aik.c \
+       tcg/tcg_pts_attr_aik.h tcg/tcg_pts_attr_aik.c
 SUBDIRS = .
 
 if USE_IMC_TEST
index 22fd4f0..f0de1c8 100644 (file)
@@ -31,7 +31,7 @@
 static const char imc_name[] = "Attestation";
 
 #define IMC_VENDOR_ID  PEN_TCG
-#define IMC_SUBTYPE            PA_SUBTYPE_TCG_PTS
+#define IMC_SUBTYPE    PA_SUBTYPE_TCG_PTS
 
 static imc_agent_t *imc_attestation;
  
@@ -201,6 +201,60 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
                        /**
                         * Handle TCG PTS attributes
                         */
+                       switch(attr->get_type(attr))
+                       {
+                               case TCG_PTS_REQ_PROTO_CAPS:
+                                       break;
+                               case TCG_PTS_DH_NONCE_PARAMS_REQ:
+                                       break;
+                               case TCG_PTS_DH_NONCE_FINISH:
+                                       break;
+                               case TCG_PTS_MEAS_ALGO:
+                                       break;
+                               case TCG_PTS_GET_TPM_VERSION_INFO:
+                                       break;
+                               case TCG_PTS_REQ_TEMPL_REF_MANI_SET_META:
+                                       break;
+                               case TCG_PTS_UPDATE_TEMPL_REF_MANI:
+                                       break;
+                               case TCG_PTS_GET_AIK:
+                                       break;
+                                       
+                               /* PTS-based Attestation Evidence */
+                               case TCG_PTS_REQ_FUNCT_COMP_EVID:
+                                       break;
+                               case TCG_PTS_GEN_ATTEST_EVID:
+                                       break;
+                               case TCG_PTS_REQ_FILE_META:
+                                       break;
+                               case TCG_PTS_REQ_FILE_MEAS:
+                                       break;
+                               case TCG_PTS_REQ_INTEG_MEAS_LOG:
+                                       break;
+                                       
+                               /* On Windows only*/
+                               case TCG_PTS_REQ_REGISTRY_VALUE:
+                               /* Received on IMV side only*/
+                               case TCG_PTS_PROTO_CAPS:
+                               case TCG_PTS_DH_NONCE_PARAMS_RESP:
+                               case TCG_PTS_MEAS_ALGO_SELECTION:
+                               case TCG_PTS_TPM_VERSION_INFO:
+                               case TCG_PTS_TEMPL_REF_MANI_SET_META:
+                               case TCG_PTS_AIK:                               
+                               case TCG_PTS_SIMPLE_COMP_EVID:
+                               case TCG_PTS_SIMPLE_EVID_FINAL:
+                               case TCG_PTS_VERIFICATION_RESULT:
+                               case TCG_PTS_INTEG_REPORT:
+                               case TCG_PTS_UNIX_FILE_META:
+                               case TCG_PTS_FILE_MEAS:
+                               case TCG_PTS_INTEG_MEAS_LOG:
+                               default:
+                                       DBG1(DBG_IMC, "received unsupported attribute '%N'",
+                                               tcg_attr_names, attr->get_type(attr));
+                                       break;
+                       }
+                       
+                       
                }
        }
        enumerator->destroy(enumerator);
index 47c3ffd..2aa52d8 100644 (file)
@@ -31,7 +31,7 @@
 static const char imv_name[] = "Attestation";
 
 #define IMV_VENDOR_ID  PEN_TCG
-#define IMV_SUBTYPE            PA_SUBTYPE_TCG_PTS
+#define IMV_SUBTYPE    PA_SUBTYPE_TCG_PTS
 
 static imv_agent_t *imv_attestation;
 
@@ -197,6 +197,59 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
                        /**
                         * Handle TCG PTS attributes
                         */
+                       switch(attr->get_type(attr))
+                       {
+                               case TCG_PTS_PROTO_CAPS:
+                                       break;
+                               case TCG_PTS_DH_NONCE_PARAMS_RESP:
+                                       break;
+                               case TCG_PTS_MEAS_ALGO_SELECTION:
+                                       break;
+                               case TCG_PTS_TPM_VERSION_INFO:
+                                       break;
+                               case TCG_PTS_TEMPL_REF_MANI_SET_META:
+                                       break;
+                               case TCG_PTS_AIK:
+                                       break;
+                               
+                               /* PTS-based Attestation Evidence */
+                               case TCG_PTS_SIMPLE_COMP_EVID:
+                                       break;
+                               case TCG_PTS_SIMPLE_EVID_FINAL:
+                                       break;
+                               case TCG_PTS_VERIFICATION_RESULT:
+                                       break;
+                               case TCG_PTS_INTEG_REPORT:
+                                       break;
+                               case TCG_PTS_UNIX_FILE_META:
+                                       break;
+                               case TCG_PTS_FILE_MEAS:
+                                       break;
+                               case TCG_PTS_INTEG_MEAS_LOG:
+                                       break;
+                                       
+                               /* On Windows only*/
+                               case TCG_PTS_WIN_FILE_META:
+                               case TCG_PTS_REGISTRY_VALUE:
+                               /* Received on IMC side only*/
+                               case TCG_PTS_REQ_PROTO_CAPS:
+                               case TCG_PTS_DH_NONCE_PARAMS_REQ:
+                               case TCG_PTS_DH_NONCE_FINISH:
+                               case TCG_PTS_MEAS_ALGO:
+                               case TCG_PTS_GET_TPM_VERSION_INFO:
+                               case TCG_PTS_REQ_TEMPL_REF_MANI_SET_META:
+                               case TCG_PTS_UPDATE_TEMPL_REF_MANI:
+                               case TCG_PTS_GET_AIK:
+                               case TCG_PTS_REQ_FUNCT_COMP_EVID:
+                               case TCG_PTS_GEN_ATTEST_EVID:
+                               case TCG_PTS_REQ_FILE_META:
+                               case TCG_PTS_REQ_FILE_MEAS:
+                               case TCG_PTS_REQ_INTEG_MEAS_LOG:
+                               default:
+                                       DBG1(DBG_IMC, "received unsupported attribute '%N'",
+                                               tcg_attr_names, attr->get_type(attr));
+                                       break;
+                       }
                }
        }
        enumerator->destroy(enumerator);
index 9a5e06b..d90227d 100644 (file)
@@ -49,7 +49,7 @@ enum tcg_attr_t {
        /* PTS-based Attestation Evidence */
        TCG_PTS_REQ_FUNCT_COMP_EVID =         0x00100000,
        TCG_PTS_GEN_ATTEST_EVID =             0x00200000,
-    TCG_PTS_SIMPLE_COMP_EVID =            0x00300000,
+       TCG_PTS_SIMPLE_COMP_EVID =            0x00300000,
        TCG_PTS_SIMPLE_EVID_FINAL =           0x00400000,
        TCG_PTS_VERIFICATION_RESULT =         0x00500000,
        TCG_PTS_INTEG_REPORT =                0x00600000,