From 6d3b46668f36231034a5a794474240e0dd4d95b6 Mon Sep 17 00:00:00 2001 From: Sansar Choinyambuu Date: Sun, 18 Dec 2011 18:36:36 +0100 Subject: [PATCH] TrouSerS expects a bitmask field length of at least 3 bytes --- src/libpts/pts/pts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libpts/pts/pts.c b/src/libpts/pts/pts.c index 2f13ffce2..6469f7cc4 100644 --- a/src/libpts/pts/pts.c +++ b/src/libpts/pts/pts.c @@ -1155,7 +1155,11 @@ METHOD(pts_t, get_quote_info, bool, return FALSE; } - size_of_select = 1 + this->pcr_max / 8; + /** + * A TPM v1.2 has 24 PCR Registers + * so the bitmask field length used by TrouSerS is at least 3 bytes + */ + size_of_select = max(PCR_MAX_NUM / 8, 1 + this->pcr_max / 8); pcr_comp_len = 2 + size_of_select + 4 + this->pcr_count * this->pcr_len; writer = bio_writer_create(pcr_comp_len);