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
파일: Policy.cs 프로젝트: Microsoft/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);
 }
예제 #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
파일: Policy.cs 프로젝트: Microsoft/TSS.MSR
 /// <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);
 }
예제 #8
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);
 }