]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
PCR selection bitmask is 3
authorSansar Choinyambuu <schoinya@hsr.ch>
Wed, 7 Dec 2011 12:28:59 +0000 (13:28 +0100)
committerSansar Choinyambuu <schoinya@hsr.ch>
Wed, 7 Dec 2011 12:28:59 +0000 (13:28 +0100)
src/libpts/pts/pts.c

index dbd66be0d65497caac966d4bb0249e2cb8a4714b..269e3bd45830594449ff3ebb94f5d473400cd035 100644 (file)
@@ -956,7 +956,7 @@ METHOD(pts_t, quote_tpm, bool,
                {
                        i++;
                        f = 1;
-               }               
+               }
                if (this->pcr_select[i] & f)
                {
                        result = use_quote2 ?
@@ -1154,8 +1154,9 @@ METHOD(pts_t, get_quote_info, bool,
                                          "unable to construct TPM Quote Info2");
                return FALSE;
        }
-       
-       size_of_select = 1 + this->pcr_max / 8; 
+
+       /* TPM v1.2 24 PCR Registers, so bitmask field lenght is 3 */
+       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);