接前一篇文章:tpm2-tools源码分析之tpm2_nvundefine.c(1)
本文对tpm2_nvundefine.c中的tpm2_tool_onstart函数进行详细解析。
先再次贴出该函数源码:
static bool tpm2_tool_onstart(tpm2_options **opts) {
/*
* The tool does both undefine and undefine space special and so the options
* are interpreted accordingly.
*
* Case NV_Undefine:
* 1. 'C' and 'P' correspond to either TPM2_RH_OWNER or TPM2_RH_PLATFORM
* 2. In this case, two aux sessions are allowed.
* Case NV_UndefineSpaceSpecial:
* 1. 'S' is for the NV-Index --> Object#1, Session#1.
* 2. 'C' and 'P' is defaulted to TPM2_RH_PLATFORM --> Object#2, Session#2
* 3. I