我正在学习本教程,但我使用的是Ubuntu21.04:https://run.tournament.org.il/ubuntu-20-04-and-tpm2-encrypted-system-disk/
当我运行第二个命令时:
sudo tpm2_nvdefine -s 64 0x1500016
我知道错误:
WARNING:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:337:Esys_NV_DefineSpace_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:122:Esys_NV_DefineSpace() Esys Finish ErrorCode (0x000009a2)
ERROR: Failed to define NV area at index 0x1500016
ERROR: Esys_NV_DefineSpace(0x9A2) - tpm:session(1):authorization failure without DA implications
ERROR: Failed to create NV index 0x1500016.
ERROR: Unable to run tpm2_nvdefine
我也尝试过:
sudo tpm2_clear
其结果是:
WARNING:esys:src/tss2-esys/api/Esys_Clear.c:291:Esys_Clear_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_Clear.c:97:Esys_Clear() Esys Finish ErrorCode (0x0000098e)
ERROR: Esys_Clear(0x98E) - tpm:session(1):the authorization HMAC check failed and DA counter incremented
ERROR: Unable to run tpm2_clear
这让我看到了现状:
$ sudo tpm2_getcap properties-variable | egrep 'TPM2_PT_(MAX|LOCKOUT).*'
TPM2_PT_LOCKOUT_COUNTER: 0x0
TPM2_PT_MAX_AUTH_FAIL: 0xA
TPM2_PT_LOCKOUT_INTERVAL: 0x1C20
TPM2_PT_LOCKOUT_RECOVERY: 0x1C20
我也尝试过:
sudo tpm2_dictionarylockout --setup-parameters --max-tries=4294967295 --clear-lockout
这也会导致类似的错误:
WARNING:esys:src/tss2-esys/api/Esys_DictionaryAttackLockReset.c:288:Esys_DictionaryAttackLockReset_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_DictionaryAttackLockReset.c:98:Esys_DictionaryAttackLockReset() Esys Finish ErrorCode (0x00000921)
ERROR: Esys_DictionaryAttackLockReset(0x921) - tpm:warn(2.0): authorizations for objects subject to DA protection are not allowed at this time because the TPM is in DA lockout mode
ERROR: Unable to run tpm2_dictionarylockout
我还尝试了tpm2-tools教程中关于磁盘加密的第一个命令:https://tpm2-software.github.io/2020/04/13/Disk-Encryption.html
上面写着:
sudo tpm2_createprimary -Q -C o -c prim.ctx
并导致类似的错误:
WARNING:esys:src/tss2-esys/api/Esys_CreatePrimary.c:393:Esys_CreatePrimary_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_CreatePrimary.c:135:Esys_CreatePrimary() Esys Finish ErrorCode (0x000009a2)
ERROR: Esys_CreatePrimary(0x9A2) - tpm:session(1):authorization failure without DA implications
ERROR: Unable to run tpm2_createprimary
我已经搜索了所有这些错误,但找不到一个可以理解的解释。有很多信息,但来自tpm工具和/或完全不正确的参数。看来tpm2_*命令变化很快!
这是否意味着我的TPM已被禁用或被锁定?
我注意到tpm2_takeownership已经不在Ubuntu包中了(也不在20.04中),所以我在互联网上找到的其他解决方案将无法工作(除非我从源代码中安装它),但我认为如果它不在包中,这是预料不到的。
其他事情(如tpm2_pcrread)不会引发错误。那么,是否有可能我的TPM是可读的,但不能写的?我如何重新设置它,或者这是制造商的设置,或我需要在BIOS中做的事情,使它可写?
发布于 2021-09-30 21:52:09
在ubuntu20.04上设置TPM时,我也遇到了同样的错误。我的情况是,我以前的操作系统是Windows 10,为所有驱动器设置了TPM位储物柜。
对我来说,解决方案是用
$ echo 5 > /sys/class/tpm/tpm0/ppi/request
$ reboot
然后,TPM被重置,命令按预期工作。
编辑:根据OP:https://run.tournament.org.il/ubuntu-20-04-and-tpm2-encrypted-system-disk/链接中的注释之一,TPM被Windows 10位锁锁在引导加载程序和硬件的某种组合中(即Windows 10拥有TPM的所有权)。因此,如果使用的是新操作系统,则需要重置TPM才能使用。
https://askubuntu.com/questions/1357694
复制相似问题