Implemented creating and handling of Optional PCR Composite field in Simple Evidence...
authorSansar Choinyambuu <schoinya@hsr.ch>
Mon, 24 Oct 2011 09:28:17 +0000 (11:28 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 18:18:23 +0000 (19:18 +0100)
src/libpts/pts/pts.c
src/libpts/tcg/tcg_pts_attr_simple_evid_final.c

index 2ce2545..95ed16f 100644 (file)
@@ -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",
index 4a85f40..5f2bd65 100644 (file)
@@ -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