This command includes a secret-based authorization to a policy. The caller proves knowledge of the secret value using either a password or an HMAC-based authorization session.
Наследование: TpmPolicyWithExpiration
Пример #1
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)
     {
         throw new Exception("No policy secret callback installed.");
     }
     PolicySecretCallback(this, ace, out authorizingSession, out authorizedEntityHandle, out flushAuthEntity);
 }
Пример #2
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);
 }
Пример #3
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;
 }
Пример #4
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;
 }
Пример #5
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);
 }