From e0fa29c9a103c45857ce3fd52d2b2c4f1a701d84 Mon Sep 17 00:00:00 2001 From: Sansar Choinyambuu Date: Mon, 24 Oct 2011 11:28:17 +0200 Subject: [PATCH] Implemented creating and handling of Optional PCR Composite field in Simple Evidence Final attribute --- src/libpts/pts/pts.c | 6 +++++- src/libpts/tcg/tcg_pts_attr_simple_evid_final.c | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libpts/pts/pts.c b/src/libpts/pts/pts.c index 2ce2545ee..95ed16fb4 100644 --- a/src/libpts/pts/pts.c +++ b/src/libpts/pts/pts.c @@ -810,7 +810,7 @@ METHOD(pts_t, quote_tpm, bool, TSS_VALIDATION valData; u_int32_t i; TSS_RESULT result; - chunk_t quote_sign; + chunk_t pcr_comp, quote_sign; result = Tspi_Context_Create(&hContext); if (result != TSS_SUCCESS) @@ -1143,6 +1143,10 @@ METHOD(pts_t, get_quote_info, bool, chunk_clear(&pcr_composite); chunk_clear(&hash_pcr_composite); + chunk_clear(&pcr_composite); + hasher->destroy(hasher); + writer->write_data(writer, *out_pcr_composite); + if (!this->secret.ptr) { DBG1(DBG_PTS, "Secret assessment value unavailable", diff --git a/src/libpts/tcg/tcg_pts_attr_simple_evid_final.c b/src/libpts/tcg/tcg_pts_attr_simple_evid_final.c index 4a85f402b..5f2bd6553 100644 --- a/src/libpts/tcg/tcg_pts_attr_simple_evid_final.c +++ b/src/libpts/tcg/tcg_pts_attr_simple_evid_final.c @@ -236,8 +236,7 @@ METHOD(pa_tnc_attr_t, process, status_t, /* Optional Composite Hash Algorithm and TPM PCR Composite field is included */ if (this->flags != PTS_SIMPLE_EVID_FINAL_FLAG_NO) { - /** u_int32_t pcr_comp_len;*/ - u_int32_t tpm_quote_sign_len; + u_int32_t pcr_comp_len, tpm_quote_sign_len; /** TODO: Ignoring Hashing algorithm field * There is no flag defined which indicates the precense of it