internal override TpmHash GetPolicyDigest(TpmAlgId hashAlg) { TpmCc commandCode = 0; if (TicketType == TpmSt.AuthSecret) { commandCode = TpmCc.PolicySecret; } else if (TicketType == TpmSt.AuthSigned) { commandCode = TpmCc.PolicySigned; } else { Globs.Throw <ArgumentException>("Ticket type is not recognized"); return(new TpmHash(hashAlg)); } if (ObjectName == null) { ObjectName = AuthorizingKey.GetName(); } var m = new Marshaller(); m.Put(commandCode, "ordinal"); m.Put(ObjectName, "name"); return(GetNextAcePolicyDigest(hashAlg).Extend(m.GetBytes()).Extend(PolicyRef)); }
internal override TpmRc Execute(Tpm2 tpm, AuthSession sess, PolicyTree policy) { if (ObjectName == null) { ObjectName = AuthorizingKey.GetName(); } tpm.PolicyTicket(sess, ExpirationTime, CpHash, PolicyRef, ObjectName, Ticket); return(tpm._GetLastResponseCode()); }