Lines Matching defs:command_info
114 MessageInfo command_info;
115 TPM_RC result = ParseCommand(command, &command_info);
121 if (command_info.code == TPM_CC_FlushContext) {
122 return ProcessFlushContext(command, command_info);
126 for (auto handle : command_info.handles) {
128 result = ProcessInputHandle(command_info, handle, &tpm_handle);
136 for (auto handle : command_info.session_handles) {
137 result = EnsureSessionIsLoaded(command_info, handle);
143 if (command_info.code == TPM_CC_ContextLoad) {
145 command_info.parameter_data);
150 if (actual_load_data != command_info.parameter_data &&
166 result = ParseResponse(command_info, response, &response_info);
170 if (!FixWarnings(command_info, response_info.code)) {
177 command_info.session_handles.size()) {
181 for (size_t i = 0; i < command_info.session_handles.size(); ++i) {
184 CleanupFlushedHandle(command_info.session_handles[i]);
189 if (command_info.code == TPM_CC_ContextSave) {
190 ProcessExternalContextSave(command_info, response_info);
274 TPM_RC ResourceManager::EnsureSessionIsLoaded(const MessageInfo& command_info,
286 TPM_RC result = LoadContext(command_info, &handle_info);
296 void ResourceManager::EvictObjects(const MessageInfo& command_info) {
300 std::find(command_info.handles.begin(),
301 command_info.handles.end(),
302 item.first) != command_info.handles.end()) {
305 TPM_RC result = SaveContext(command_info, &info);
322 void ResourceManager::EvictSession(const MessageInfo& command_info) {
324 if (!ChooseSessionToEvict(command_info.session_handles, &session_to_evict)) {
328 TPM_RC result = SaveContext(command_info, &info);
348 void ResourceManager::FixContextGap(const MessageInfo& command_info) {
367 TPM_RC result = LoadContext(command_info, &info);
373 result = SaveContext(command_info, &info);
393 bool ResourceManager::FixWarnings(const MessageInfo& command_info,
412 FixContextGap(command_info);
416 EvictObjects(command_info);
419 EvictSession(command_info);
422 EvictObjects(command_info);
423 EvictSession(command_info);
426 FlushSession(command_info);
432 void ResourceManager::FlushSession(const MessageInfo& command_info) {
435 if (!ChooseSessionToEvict(command_info.session_handles, &session_to_flush)) {
465 TPM_RC ResourceManager::LoadContext(const MessageInfo& command_info,
474 if (!FixWarnings(command_info, result)) {
495 MessageInfo* command_info) {
496 CHECK(command_info);
506 command_info->has_sessions = (tag == TPM_ST_SESSIONS);
517 result = Parse_TPM_CC(&buffer, &command_info->code, nullptr);
521 if (command_info->code < TPM_CC_FIRST || command_info->code > TPM_CC_LAST) {
525 size_t number_of_handles = GetNumberOfRequestHandles(command_info->code);
526 command_info->handles = ExtractHandlesFromBuffer(number_of_handles, &buffer);
527 if (number_of_handles != command_info->handles.size()) {
530 if (command_info->has_sessions) {
542 command_info->parameter_data = buffer.substr(authorization_size);
569 command_info->session_handles.push_back(handle);
570 command_info->session_continued.push_back((attributes & 1) == 1);
574 command_info->parameter_data = buffer;
579 TPM_RC ResourceManager::ParseResponse(const MessageInfo& command_info,
608 size_t number_of_handles = GetNumberOfResponseHandles(command_info.code);
653 const MessageInfo& command_info,
655 CHECK_EQ(command_info.code, TPM_CC_ContextSave);
656 if (command_info.handles.size() != 1) {
660 // We know command_info.handles[0] is valid because this is validated when the
662 TPM_HANDLE saved_handle = command_info.handles[0];
698 const MessageInfo& command_info) {
699 std::string buffer = command_info.parameter_data;
729 TPM_RC result = ParseResponse(command_info, response, &response_info);
741 TPM_RC ResourceManager::ProcessInputHandle(const MessageInfo& command_info,
755 TPM_RC result = LoadContext(command_info, &handle_info);
813 TPM_RC ResourceManager::SaveContext(const MessageInfo& command_info,
825 if (!FixWarnings(command_info, result)) {