接前一篇文章:tpm2-tools源码分析之tpm2_load.c(5)
上一篇文章分析完了tpm2_load.c中的tpm2_tool_onrun函数的第3个函数load。本文分析第4个函数process_output。
先看一下调用该函数的代码片段:
/*
* 4. Process outputs
*/
return process_output(ectx);
process_output函数源码如下:
static tool_rc process_output(ESYS_CONTEXT *ectx) {
UNUSED(ectx);
/*
* 1. Outputs that do not require TPM2_CC_<command> dispatch
*/
bool is_file_op_success = true;
if (ctx.cp_hash_path) {
is_file_op_success = files_save_digest(&ctx.cp_hash, ctx.cp_hash_path);