From a3be32a2d5577766ba8f36417617026659928cf5 Mon Sep 17 00:00:00 2001 From: Sansar Choinyambuu Date: Fri, 7 Oct 2011 11:15:37 +0200 Subject: [PATCH] Changed definition of output and set them in quote_tpm function --- src/libpts/pts/pts.c | 53 ++++++++++++++++++++++++++++---------------- src/libpts/pts/pts.h | 15 ++++++++----- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/src/libpts/pts/pts.c b/src/libpts/pts/pts.c index 4ee5d4936..14271f63f 100644 --- a/src/libpts/pts/pts.c +++ b/src/libpts/pts/pts.c @@ -716,7 +716,8 @@ METHOD(pts_t, extend_pcr, bool, } METHOD(pts_t, quote_tpm, bool, - private_pts_t *this, u_int32_t *pcrs, u_int32_t num_of_pcrs, chunk_t *output) + private_pts_t *this, u_int32_t *pcrs, u_int32_t num_of_pcrs, + chunk_t *pcr_composite, chunk_t *quote_signature) { TSS_HCONTEXT hContext; TSS_HTPM hTPM; @@ -731,6 +732,7 @@ METHOD(pts_t, quote_tpm, bool, u_int32_t i; TSS_RESULT result; chunk_t aik_key_encoding; + chunk_t pcr_composite_without_nonce; result = Tspi_Context_Create(&hContext); if (result != TSS_SUCCESS) @@ -822,7 +824,7 @@ METHOD(pts_t, quote_tpm, bool, DBG1(DBG_PTS, "Invalid PCR number: %d", pcr); goto err3; } - result = Tspi_PcrComposite_SelectPcrIndex(hPcrComposite, 1); + result = Tspi_PcrComposite_SelectPcrIndex(hPcrComposite, pcr); if (result != TSS_SUCCESS) { goto err3; @@ -842,23 +844,36 @@ METHOD(pts_t, quote_tpm, bool, quoteInfo = (TPM_QUOTE_INFO *)valData.rgbData; - //display quote info - printf("version:\n"); - for(i=0;i<4;i++) - printf("%02x ",valData.rgbData[i]); - printf("\n"); - printf("fixed value:\n"); - for(i=4;i<8;i++) - printf("%c",valData.rgbData[i]); - printf("\n"); - printf("pcr digest:\n"); - for(i=8;i<28;i++) - printf("%02x ",valData.rgbData[i]); - printf("\n"); - printf("nonce:\n"); - for(i=28;i