/// <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); }
/// <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); }
/// <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; }
/// <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; }