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