Is it possible to increase the available number of TPM persistent handles or extend the usable capacity of the NV storage?
I would like to manage additional key pairs and certificates.
The following device has the fTPM feature enabled:
Environment:
- Device: reComputer Industrial Orin J401
- JetPack: 6.2.2 (L4T R36.5.0)
- OP-TEE: fTPM feature enabled
Persistent Handle Capacity:
A total of 3 handles can be used.
As configured:
TPM2_PT_HR_PERSISTENT: 0x3
TPM2_PT_HR_PERSISTENT_AVAIL: 0x0
Attempting to exceed this limit results in an insufficient space for NV allocation error.
Operations succeed when the count is below this threshold.
root@test-desktop:~/work# tpm2_getcap properties-variable
TPM2_PT_PERMANENT:
ownerAuthSet: 0
endorsementAuthSet: 0
lockoutAuthSet: 0
reserved1: 0
disableClear: 0
inLockout: 0
tpmGeneratedEPS: 1
reserved2: 0
TPM2_PT_STARTUP_CLEAR:
phEnable: 1
shEnable: 1
ehEnable: 1
phEnableNV: 1
reserved1: 0
orderly: 1
TPM2_PT_HR_NV_INDEX: 0x2
TPM2_PT_HR_LOADED: 0x0
TPM2_PT_HR_LOADED_AVAIL: 0x3
TPM2_PT_HR_ACTIVE: 0x0
TPM2_PT_HR_ACTIVE_AVAIL: 0x40
TPM2_PT_HR_TRANSIENT_AVAIL: 0x3
TPM2_PT_HR_PERSISTENT: 0x3
TPM2_PT_HR_PERSISTENT_AVAIL: 0x0
TPM2_PT_NV_COUNTERS: 0x0
TPM2_PT_NV_COUNTERS_AVAIL: 0xC
TPM2_PT_ALGORITHM_SET: 0x0
TPM2_PT_LOADED_CURVES: 0x5
TPM2_PT_LOCKOUT_COUNTER: 0x0
TPM2_PT_MAX_AUTH_FAIL: 0x3
TPM2_PT_LOCKOUT_INTERVAL: 0x3E8
TPM2_PT_LOCKOUT_RECOVERY: 0x3E8
TPM2_PT_NV_WRITE_RECOVERY: 0x0
TPM2_PT_AUDIT_COUNTER_0: 0x0
TPM2_PT_AUDIT_COUNTER_1: 0x0
root@test-desktop:~/work#
NV Storage Capacity:
A total of 2,792 bytes of NV storage can be used.
When defining an NV area with the following command, an insufficient space for NV allocation error occurs:
The operation fails due to insufficient NV allocation space. Reducing the specified size would allow the operation to succeed.
root@test-desktop:~/work# size=`wc -c < cert.der`
root@test-desktop:~/work# tpm2_nvdefine 0x0181FFFE -C o -s ${size}
WARNING:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:344:Esys_NV_DefineSpace_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:122:Esys_NV_DefineSpace() Esys Finish ErrorCode (0x0000014b)
ERROR: Failed to define NV area at index 0x181FFFE
ERROR: Esys_NV_DefineSpace(0x14B) - tpm:error(2.0): insufficient space for NV allocation
ERROR: Failed to create NV index 0x181fffe.
ERROR: Unable to run tpm2_nvdefine
root@test-desktop:~/work#