• Home
  • Raw
  • Download

Lines Matching full:command

38 // control flow for TPM command execution.
45 // Uncomment this next #include if doing static command/response buffer sizing
52 // a) Parses the command header from input buffer.
53 // b) Calls ParseHandleBuffer() to parse the handle area of the command.
60 // 1) unmarshal the command parameters from the command buffer;
61 // 2) call the routine that performs the command actions; and
87 uint32_t requestSize, // IN: command buffer size in ExecuteCommand()
88 unsigned char *request, // IN: command buffer in ExecuteCommand()
93 // Command local variables in ExecuteCommand()
95 COMMAND command; in ExecuteCommand() local
99 TPM_RC result; // return code for the command in ExecuteCommand()
101 // This next function call is used in development to size the command and response in ExecuteCommand()
103 // not the sizes of the canonical forms of the command response structures. Also, in ExecuteCommand()
104 // the sizes do not include the tag, command.code, requestSize, or the authorization in ExecuteCommand()
121 // accessibility of NV does not change during the execution of a command. in ExecuteCommand()
122 // Specifically, if NV is available when the command execution starts and then in ExecuteCommand()
128 // synchronized with the system clock whenever a command is received. in ExecuteCommand()
130 // a snapshot of the hardware timer at the beginning of the command allows in ExecuteCommand()
131 // the time value to be consistent for the duration of the command execution. in ExecuteCommand()
134 // Any command through this function will unceremoniously end the in ExecuteCommand()
139 // Get command buffer size and command buffer. in ExecuteCommand()
140 command.parameterBuffer = request; in ExecuteCommand()
141 command.parameterSize = requestSize; in ExecuteCommand()
143 // Parse command header: tag, commandSize and command.code. in ExecuteCommand()
146 result = TPMI_ST_COMMAND_TAG_Unmarshal(&command.tag, in ExecuteCommand()
147 &command.parameterBuffer, in ExecuteCommand()
148 &command.parameterSize); in ExecuteCommand()
153 &command.parameterBuffer, in ExecuteCommand()
154 &command.parameterSize); in ExecuteCommand()
161 // as the input processing (the function that receives the command bytes and in ExecuteCommand()
169 // Unmarshal the command code. in ExecuteCommand()
170 result = TPM_CC_Unmarshal(&command.code, &command.parameterBuffer, in ExecuteCommand()
171 &command.parameterSize); in ExecuteCommand()
174 // Check to see if the command is implemented. in ExecuteCommand()
175 command.index = CommandCodeToCommandIndex(command.code); in ExecuteCommand()
176 if(UNIMPLEMENTED_COMMAND_INDEX == command.index) in ExecuteCommand()
182 // If the TPM is in FUM, then the only allowed command is in ExecuteCommand()
184 if(IsFieldUgradeMode() && (command.code != TPM_CC_FieldUpgradeData)) in ExecuteCommand()
194 if((!TPMIsStarted() && command.code != TPM_CC_Startup) in ExecuteCommand()
195 || (TPMIsStarted() && command.code == TPM_CC_Startup)) in ExecuteCommand()
200 // Start regular command process. in ExecuteCommand()
203 result = ParseHandleBuffer(&command); in ExecuteCommand()
208 result = EntityGetLoadStatus(&command); in ExecuteCommand()
211 // Authorization session handling for the command. in ExecuteCommand()
212 ClearCpRpHashes(&command); in ExecuteCommand()
213 if(command.tag == TPM_ST_SESSIONS) in ExecuteCommand()
216 result = UINT32_Unmarshal((UINT32 *)&command.authSize, in ExecuteCommand()
217 &command.parameterBuffer, in ExecuteCommand()
218 &command.parameterSize); in ExecuteCommand()
223 // the command, then it is an error. NOTE: This check could pass but the in ExecuteCommand()
226 if(command.authSize < 9 in ExecuteCommand()
227 || command.authSize > command.parameterSize) in ExecuteCommand()
232 command.parameterSize -= command.authSize; in ExecuteCommand()
235 // As the sessions are parsed command.parameterBuffer is advanced so, on a in ExecuteCommand()
236 // successful return, command.parameterBuffer should be pointing at the in ExecuteCommand()
238 result = ParseSessionBuffer(&command); in ExecuteCommand()
244 command.authSize = 0; in ExecuteCommand()
245 // The command has no authorization sessions. in ExecuteCommand()
246 // If the command requires authorizations, then CheckAuthNoSession() will in ExecuteCommand()
248 result = CheckAuthNoSession(&command); in ExecuteCommand()
253 // response parameters starting at the address in command.responseBuffer. in ExecuteCommand()
254 //*response = MemoryGetResponseBuffer(command.index); in ExecuteCommand()
255 // leave space for the command header in ExecuteCommand()
256 command.responseBuffer = *response + STD_RESPONSE_HEADER; in ExecuteCommand()
259 if(command.tag == TPM_ST_SESSIONS) in ExecuteCommand()
260 command.responseBuffer += sizeof(UINT32); in ExecuteCommand()
261 if(IsHandleInResponse(command.index)) in ExecuteCommand()
262 command.responseBuffer += sizeof(TPM_HANDLE); in ExecuteCommand()
267 result = CommandDispatcher(&command); in ExecuteCommand()
272 BuildResponseSession(&command); in ExecuteCommand()
286 // RAM whenever an "evict" object handle is used in a command so that the in ExecuteCommand()
288 // cleared from RAM whether the command succeeds or fails. in ExecuteCommand()
293 BuildResponseHeader(&command, *response, result); in ExecuteCommand()
296 // command execution. This check should be made for both succeeded and failed in ExecuteCommand()
298 // This is the only place in the command execution path that may call the NV in ExecuteCommand()
308 pAssert((UINT32)command.parameterSize <= maxResponse); in ExecuteCommand()
314 *responseSize = (UINT32)command.parameterSize; in ExecuteCommand()