Hi,
we're having problems writing to NV_RAM with tpm2_nvwrite. We can define areas but not write
$ tpm2_nvlist
0x1800005:
hash algorithm:
friendly: sha256
value: 0xB
attributes:
friendly: ownerwrite|policywrite|ownerread|written
value: 0xA000220
size: 32
$ echo -n "hello" | tpm2_nvwrite -x 0x1800005 -a 0x40000001 -V
INFO on line: "135" in file: "tools/tpm2_nvwrite.c": The data(size=0) to be written:
INFO on line: "149" in file: "tools/tpm2_nvwrite.c": Success to write NV area at index 0x1800005 (25165829) offset 0x0.
INFO on line: "135" in file: "tools/tpm2_nvwrite.c": The data(size=0) to be written:
INFO on line: "149" in file: "tools/tpm2_nvwrite.c": Success to write NV area at index 0x1800005 (25165829) offset 0x0.
INFO on line: "135" in file: "tools/tpm2_nvwrite.c": The data(size=0) to be written:
INFO on line: "149" in file: "tools/tpm2_nvwrite.c": Success to write NV area at index 0x1800005 (25165829) offset 0x0.
INFO on line: "135" in file: "tools/tpm2_nvwrite.c": The data(size=0) to be written:
INFO on line: "149" in file: "tools/tpm2_nvwrite.c": Success to write NV area at index 0x1800005 (25165829) offset 0x0.
INFO on line: "135" in file: "tools/tpm2_nvwrite.c": The data(size=0) to be written:
INFO on line: "149" in file: "tools/tpm2_nvwrite.c": Success to write NV area at index 0x1800005 (25165829) offset 0x0.
…
Which loops infinitely
Relevant parts of the tpm2-tools and tpm2-tss code:
file: tpm2_nvwrite.c
113 res = tpm2_util_nv_max_buffer_size(sapi_context, &max_data_size);
The call to tpm2_nv_read_public should get the
TPM_PT_NV_BUFFER_MAX capability but and store it to
max_data_size.
In that part of the code max_data_size gets set to 0 and that causes the loop above.
The TPM_PT_NV_BUFFER_MAX seems not to be defined in the capabilities for this device: Infineon TPM 2.0 9665 as reported by tpm2_cap.
t.
Ian