-----Original Message-----
From: Muthukumar S [mailto:muthu.smk@gmail.com]
Sent: Wednesday, May 20, 2020 4:29 AM
To: tpm2(a)lists.01.org; Roberts, William C <william.c.roberts(a)intel.com>
Subject: authHandle issues
Hi Roberts,
Thanks a lot for your response. As per your suggestion , I remember that I set
"authHandle" as ESYS_TR type. And the test code that I have shared also has
the
same implementation.
Below is how I set the "authHandle" , which is of ESYS_TR type and passed as
argument to below Esys_NV_Read () API.
ESYS_TR authHandle = 0x40000001;
Just because the C type is an ESYS_TR doesn't mean the value you're assigning is
Correct. You're assigning the raw tpm handle to that ESYS_TR. ESYS doesn't
understand
That. You need to assign either:
1. The value of nv_index2 (saying authorize me by using the authvalue for the nv index)
2. ESYS_TR_RH_OWNER (saying authorize me by using the authvalue of the owner)
You can find the definition for ESYS_TR_RH_OWNER here:
https://github.com/tpm2-software/tpm2-tss/blob/master/include/tss2/tss2_e...
In retrospect, we should have made ESYS_TR an enum to make this more explicit.
rc = Esys_NV_Read(
ectx,
authHandle,
nv_index2, /* the nv index to read from */
ESYS_TR_PASSWORD,
ESYS_TR_NONE,
ESYS_TR_NONE,
20,
0,
&read_data);
if (rc != TSS2_RC_SUCCESS) {
printf("Esys_NV_Read <ERROR>: 0x%x\n", rc);
goto out;
}
Let me know , anything else am I missing?
BR,
Muthukumar