Tpm2Lib.Tbs.ProcessUpdatedTpmState C# (CSharp) Method

ProcessUpdatedTpmState() private method

Updates TBS context database for commands that either fill or empty slots.
private ProcessUpdatedTpmState ( TbsContext caller, Tpm2Lib.CommandInfo command, TpmHandle responseHandles, ObjectContext inputObjects ) : void
caller TbsContext
command Tpm2Lib.CommandInfo
responseHandles TpmHandle
inputObjects ObjectContext
return void
        private void ProcessUpdatedTpmState(TbsContext caller, CommandInfo command, TpmHandle[] responseHandles, ObjectContext[] inputObjects)
        {
            switch (command.CommandCode)
            {
                // Commands that fill a slot (apart from contextLoad, which is more complex)
                case TpmCc.Load:
                case TpmCc.LoadExternal:
                case TpmCc.CreatePrimary:
                case TpmCc.HmacStart:
                case TpmCc.HashSequenceStart:
                case TpmCc.StartAuthSession:
                    var t = new TpmHandle(responseHandles[0].handle);
                    // ReSharper disable once UnusedVariable
                    ObjectContext context2 = ContextManager.CreateObjectContext(caller, t);
                    break;
                case TpmCc.ContextLoad:
                case TpmCc.ContextSave:
                    throw new Exception("ProcessUpdatedTpmState: Should not be here");
                case TpmCc.FlushContext:
                case TpmCc.SequenceComplete:
                    ContextManager.Remove(inputObjects[0]);
                    break;
                case TpmCc.EventSequenceComplete:
                    ContextManager.Remove(inputObjects[1]);
                    break;
            }
        }