Base class for PWAP and HMAC sessions. Policy sessions are a flavor of HMAC sessions.
示例#1
0
 /// <summary>
 /// This callback function provides authorization in the form of an HMAC session
 /// </summary>
 static public void PolicySecretCallback2(
     PolicyTree policyTree,
     TpmPolicySecret ace,
     out SessionBase authorizingSession,
     out TpmHandle authorizedEntityHandle,
     out bool flushAuthEntity)
 {
     AuthSession s0 = _sharedTpm.StartAuthSessionEx(TpmSe.Hmac, TpmAlgId.Sha1);
     authorizingSession = s0;
     authorizedEntityHandle = _publicSealedObjectHandle;
     flushAuthEntity = true;
 }
示例#2
0
 /// <summary>
 /// Called from TpmPolicyNV.
 /// </summary>
 /// <returns></returns>
 internal void ExecutePolicyNvCallback(TpmPolicyNV ace, out TpmHandle authHandle, out TpmHandle nvHandle, out SessionBase authSession)
 {
     if (PolicyNVCallback == null)
     {
         Globs.Throw("No policyNV callback installed.");
         authHandle = new TpmHandle();
         nvHandle = new TpmHandle();
         authSession = new AuthSession(new TpmHandle());
         return;
     }
     PolicyNVCallback(this, ace, out authSession, out authHandle, out nvHandle);
 }
示例#3
0
 /// <summary>
 /// This callback function provides authorization in plain text
 /// </summary>
 static public void PolicySecretCallback(
     PolicyTree policyTree,
     TpmPolicySecret ace,
     out SessionBase authorizingSession,
     out TpmHandle authorizedEntityHandle,
     out bool flushAuthEntity)
 {
     authorizingSession = _publicAuthorizationValue;
     authorizedEntityHandle = _publicSealedObjectHandle;
     flushAuthEntity = false;
 }
示例#4
0
 /// <summary>
 /// Called from TpmPolicySecret.
 /// </summary>
 /// <returns></returns>
 internal void ExecutePolicySecretCallback(TpmPolicySecret ace, out SessionBase authorizingSession, out TpmHandle authorizedEntityHandle, out bool flushAuthEntity)
 {
     if (PolicySecretCallback == null)
     {
         Globs.Throw("No policy secret callback installed.");
         authorizingSession = new AuthSession(new TpmHandle());
         authorizedEntityHandle = new TpmHandle();
         flushAuthEntity = false;
         return;
     }
     PolicySecretCallback(this, ace, out authorizingSession, out authorizedEntityHandle, out flushAuthEntity);
 }
示例#5
0
 /// <summary>
 /// Checks if the given reference is a placeholder indicating the type
 /// of authorization to be used in command buffer in its stead.
 /// </summary>
 internal static bool IsPlaceholder(SessionBase s)
 {
     return s == Default || s == Hmac || s == Pw;
 }
示例#6
0
文件: Policy.cs 项目: tes001/TSS.MSR
 /// <summary>
 /// Called from TpmPolicyNV.
 /// </summary>
 /// <returns></returns>
 internal void ExecutePolicyNvCallback(TpmPolicyNV ace, out TpmHandle authHandle, out TpmHandle nvHandle, out SessionBase authSession)
 {
     if (PolicyNVCallback == null)
     {
         Globs.Throw("No policyNV callback installed.");
         authHandle  = new TpmHandle();
         nvHandle    = new TpmHandle();
         authSession = new AuthSession(new TpmHandle());
         return;
     }
     PolicyNVCallback(this, ace, out authSession, out authHandle, out nvHandle);
 }
示例#7
0
 /// <summary>
 /// Called from TpmPolicyNV.
 /// </summary>
 /// <returns></returns>
 internal void ExecutePolicyNvCallback(TpmPolicyNV ace, out TpmHandle authHandle, out TpmHandle nvHandle, out SessionBase authSession)
 {
     if (PolicyNVCallback == null)
     {
         throw new Exception("No policyNV callback installed.");
     }
     PolicyNVCallback(this, ace, out authSession, out authHandle, out nvHandle);
 }
 /// <summary>
 /// Checks if the given reference is a placeholder indicating the type
 /// of authorization to be used in command buffer in its stead.
 /// </summary>
 internal static bool IsPlaceholder(SessionBase s)
 {
     return(s == Default || s == Hmac || s == Pw);
 }