TPM2 - 在 Windows 和 Tbsip_Submit_Command 下创建持久主键

TPM2 - Create a persistent primary key under Windows with Tbsip_Submit_Command

使用 Tbsip_Submit_Command 与我的 TPM 芯片一起玩 我可以看到 Windows 分析了我发送给它的帧。

为了简单起见,我使用了关机命令。

例如,我试图发送一个 TPM_CC_Shutdown 并在参数中包含 TPM_SU_CLEAR。所以框架是 => 80 01 00 00 00 0C 00 00 01 45 00 00

为了更详细和解释:

80 01         is TPM_ST_NO_SESSIONS
00 00 00 0C   size of the frame
00 00 01 45   TPM_CC_Shutdown
00 00         is TPM_SU_CLEAR

Windows 回复我 => 80 01 00 00 00 0A 80 28 04 00
再次使其更详细:

80 01         is TPM_ST_NO_SESSIONS
00 00 00 0A   size of the command
80 28 04 00   error code 0x80280400 => TPM_E_COMMAND_BLOCKED

我发现错误代码 here。 所以很明显 Windows 打断了我并放弃了我的命令。我可以理解它不希望 TPM 断电,但是对于我想要创建主键并将其保存在芯片中的命令,我得到了相同的结果。

所以我有一个芯片,但如果我想直接使用它我不能,我被迫使用密码术 API:下一代但在我的情况下我不能。

有人能帮帮我吗? 也许我可以直接与编码驱动程序的芯片通信并绕过 Windows 层(如果有人知道如何做到这一点)? 或者可以在注册表中配置一个值,让 windows 让我用我的 TPM 芯片做我想做的事?

如前所述 here 命令是否被阻止取决于您的配置。可以解锁命令,但我无法使用它。

据《A Practical Guide to TPM 2.0》一书 在第 10 章键(第 126 页)上,它说:

The TPM library specification includes symmetric encryption keys that can be used for general-purpose encryption such as AES. It’s uncertain whether TPM vendors will include these functions, due to potential export restrictions. The commands are optional in the PC Client platform specification. Historically, TPM vendors haven’t implemented optional TPM features.

您可以使用带有参数 TPM_CAP_COMMANDS 的命令 TPM2_GetCapability 来检索已执行命令的列表。如果您要使用的命令未列出,则 TPM 供应商可能未实现它。

请参阅 https://docs.microsoft.com/en-us/windows-hardware/test/hlk/testref/tpm-v20-command-and-signal-profile,从 Windows 的角度查看 包含的 可选的 命令的列表。