コード例 #1
0
ファイル: TpmConfig.cs プロジェクト: siyingpoof/TSS.MSR
 public bool IsExtendablePcr(Tpm2 tpm, int pcr, int locality = 0)
 {
     byte[] extendablePcrs = ExtendablePcrs;
     if (locality != 0)
     {
         var props = new PtPcr[] { PtPcr.ExtendL1, PtPcr.ExtendL2,
                                   PtPcr.ExtendL3, PtPcr.ExtendL4 };
         extendablePcrs = Tpm2.GetPcrProperty(tpm, props[locality - 1]);
     }
     return(Globs.IsBitSet(extendablePcrs, (int)pcr));
 }
コード例 #2
0
ファイル: Tpm2Abstractions.cs プロジェクト: jimsdog/TSS.MSR
        public static byte[] GetPcrProperty(Tpm2 tpm, PtPcr prop)
        {
            ICapabilitiesUnion caps;

            tpm.GetCapability(Cap.PcrProperties, (uint)prop, 1, out caps);
            TaggedPcrSelect[] props = (caps as TaggedPcrPropertyArray).pcrProperty;
            if (props.Length == 0)
            {
                return(null);
            }
            if (props.Length != 1)
            {
                Globs.Throw("Unexpected return from GetCapability");
            }
            return(props[0].pcrSelect);
        }
コード例 #3
0
ファイル: TpmConfig.cs プロジェクト: siyingpoof/TSS.MSR
 public bool IsResettablePcr(Tpm2 tpm, int pcr, int locality = 0)
 {
     byte[] resettablePcrs = ResettablePcrs;
     if (locality == 4)
     {
         // In accordance with PTP 3.7.1:
         // "Note that since the hardware that performs the DRTM sequence at
         // Locality 4 is not capable of doing TPM2_PCR_Reset(), the TPM_PT_PCR_RESET_L4
         // attribute is repurposed to indicate the initial state of the PCR(0 or - 1)
         // and to indicate which PCR are set to 0 by a successful DRTM Sequence.
         return(false);
     }
     if (locality != 0)
     {
         var props = new PtPcr[] { PtPcr.ResetL1, PtPcr.ResetL2,
                                   PtPcr.ResetL3, PtPcr.ResetL4 };
         resettablePcrs = Tpm2.GetPcrProperty(tpm, props[locality - 1]);
     }
     return(Globs.IsBitSet(resettablePcrs, (int)pcr));
 }
コード例 #4
0
ファイル: Tpm2Abstractions.cs プロジェクト: Microsoft/TSS.MSR
 public static byte[] GetPcrProperty(Tpm2 tpm, PtPcr prop)
 {
     ICapabilitiesUnion caps;
     tpm.GetCapability(Cap.PcrProperties, (uint)prop, 1, out caps);
     TaggedPcrSelect[] props = (caps as TaggedPcrPropertyArray).pcrProperty;
     if (props.Length == 0)
     {
         return null;
     }
     if (props.Length != 1)
     {
         Globs.Throw("Unexpected return from GetCapability");
     }
     return props[0].pcrSelect;
 }
コード例 #5
0
ファイル: X_TpmDefs.cs プロジェクト: vishalishere/TSS.MSR
 ///<param name = "the_tag">the property identifier</param>
 ///<param name = "the_pcrSelect">the bit map of PCR with the identified property</param>
 public TaggedPcrSelect(
 PtPcr the_tag,
 byte[] the_pcrSelect
 )
 {
     this.tag = the_tag;
     this.pcrSelect = the_pcrSelect;
 }
コード例 #6
0
ファイル: X_TpmDefs.cs プロジェクト: vishalishere/TSS.MSR
 public TaggedPcrSelect(TaggedPcrSelect the_TaggedPcrSelect)
 {
     if((Object) the_TaggedPcrSelect == null ) throw new ArgumentException(Globs.GetResourceString("parmError"));
     tag = the_TaggedPcrSelect.tag;
     pcrSelect = the_TaggedPcrSelect.pcrSelect;
 }
コード例 #7
0
ファイル: X_TpmDefs.cs プロジェクト: vishalishere/TSS.MSR
 public TaggedPcrSelect()
 {
     tag = new PtPcr();
     pcrSelect = new byte[0];
 }
コード例 #8
0
ファイル: X_TpmDefs.cs プロジェクト: Microsoft/TSS.MSR
 public TaggedPcrSelect()
 {
     tag = new PtPcr();
     pcrSelect = null;
 }