From 2e845382991613fbac7d4a8cc7d97123a3cb2c97 Mon Sep 17 00:00:00 2001 From: Sansar Choinyambuu Date: Wed, 2 Nov 2011 16:38:06 +0100 Subject: [PATCH] Defined functional components within ITA namespace Implemented handling of functional components evidence request/response --- src/libpts/pts/pts.c | 24 +------------------ .../tcg/tcg_pts_attr_req_funct_comp_evid.c | 2 +- .../tcg/tcg_pts_attr_simple_comp_evid.c | 2 +- .../tcg/tcg_pts_attr_simple_comp_evid.h | 4 ++-- 4 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/libpts/pts/pts.c b/src/libpts/pts/pts.c index 5a5f05b24..504ef08b2 100644 --- a/src/libpts/pts/pts.c +++ b/src/libpts/pts/pts.c @@ -27,10 +27,6 @@ #include #include -#include -#include -#include - #define PTS_BUF_SIZE 4096 typedef struct private_pts_t private_pts_t; @@ -934,20 +930,6 @@ METHOD(pts_t, quote_tpm, bool, return FALSE; } -/** - * Comparison function for pcr_entry_t struct - */ -static int pcr_entry_compare(const pcr_entry_t *a, const pcr_entry_t *b) -{ - return (a->pcr_number - b->pcr_number); -} - -static int pcr_entry_compare_qsort(const void *a, const void *b) -{ - return pcr_entry_compare(*(const pcr_entry_t *const *)a - , *(const pcr_entry_t *const *)b); -} - METHOD(pts_t, add_pcr_entry, void, private_pts_t *this, pcr_entry_t *new) { @@ -1026,11 +1008,7 @@ METHOD(pts_t, does_pcr_value_match, bool, } } DESTROY_IF(e); - this->pcrs->insert_last(this->pcrs, new); - - qsort(this->pcrs, this->pcrs->get_count(this->pcrs), - sizeof(pcr_entry_t *), pcr_entry_compare_qsort); } /** @@ -1166,7 +1144,7 @@ METHOD(pts_t, get_quote_info, bool, else { *out_pcr_composite = chunk_clone(pcr_composite); - DBG4(DBG_PTS, "calculated PCR Composite: %B", out_pcr_composite); + DBG3(DBG_PTS, "calculated PCR Composite: %B", out_pcr_composite); } /* SHA1 hash of PCR Composite to construct TPM_QUOTE_INFO */ diff --git a/src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.c b/src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.c index 123bd9b23..7f08f57de 100644 --- a/src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.c +++ b/src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.c @@ -303,7 +303,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_funct_comp_evid_create( pts_attr_req_funct_comp_evid_flag_t flags, u_int32_t depth, u_int32_t vendor_id, pts_qualifier_t qualifier, - pts_funct_comp_name_t name) + pts_ita_funct_comp_name_t name) { private_tcg_pts_attr_req_funct_comp_evid_t *this; diff --git a/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c b/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c index 5625a7230..58d9e922b 100644 --- a/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c +++ b/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c @@ -484,7 +484,7 @@ METHOD(tcg_pts_attr_simple_comp_evid_t, get_qualifier, pts_qualifier_t, return this->qualifier; } -METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_funct_name, pts_funct_comp_name_t, +METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_funct_name, pts_ita_funct_comp_name_t, private_tcg_pts_attr_simple_comp_evid_t *this) { return this->name; diff --git a/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h b/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h index f72429c0c..ff846fc8b 100644 --- a/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h +++ b/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h @@ -68,7 +68,7 @@ struct tcg_pts_attr_simple_comp_evid_params_t { u_int32_t depth; u_int32_t vendor_id; pts_qualifier_t qualifier; - pts_funct_comp_name_t name; + pts_ita_funct_comp_name_t name; u_int32_t extended_pcr; pts_meas_algorithms_t hash_algorithm; pts_pcr_transform_t transformation; @@ -137,7 +137,7 @@ struct tcg_pts_attr_simple_comp_evid_t { * * @return Component Functional Name */ - pts_funct_comp_name_t (*get_comp_funct_name)(tcg_pts_attr_simple_comp_evid_t *this); + pts_ita_funct_comp_name_t (*get_comp_funct_name)(tcg_pts_attr_simple_comp_evid_t *this); /** * Get Measurement Type