From: Xu, J. <jam...@in...> - 2007-06-14 01:25:02
|
Hi Kent,=20 I will change the codes and initialize the result value in the = obj_nvstore_create_pcrshortinfo().=20 About the pcr select structure, we originally also use 0 as the default = sizeofselect. But when the sizeofselect is 0, the TPM devices (we tried = the ATMEL and Infineon TPM device) will return TPM_E_BAD_PARAMETER. I = think it is because when sizeofselect is 0, then there is no space for = pcrSelect. The TPM devices will not parse this type of = TPM_PCR_INFO_SHORT. So we use 3 as the default sizeofselect and 00 00 00 = as pcrSelect. Thanks, James -----Original Message----- From: Kent Yoder [mailto:shp...@gm...]=20 Sent: 2007=C4=EA6=D4=C214=C8=D5 4:07 To: Xu, James Cc: tro...@li...; Wei, Gang Subject: Re: Re-submit of the trousers patch after modifying as your = suggestions Hi James, On 6/12/07, Xu, James <jam...@in...> wrote: > Hi Kent, > > About the obj_nvstore_create_pcrshortinfo(),I am not quite clear what = is the problem. The main problem is that the code has something like: TSS_RESULT result; if (a) { result =3D val; } ... return result; which will return an uninitialized 'result' var when a=3D=3D0. > Maybe I can give a little explanation first. Because the = TPM_PCR_INFO_SHORT for reading and writing are required when we send the = public data to TPM device, so if when hReadPcrComposite or = hWritePcrComposite is 0, we also will call the = obj_nvstore_create_pcrshortinfo() and produce a default value for them. > > What is done in our implementation: > if hReadPcrComposite !=3D 0, then we will produce the = TPM_PCR_INFO_SHORT structure according to the value in = hReadPcrComposite. > Else if hReadPcrComposite =3D=3D 0, then we will use the default = value. > > TPM_PCR_INFO_SHORT: > TPM_PCR_SELECTION > 00 03(sizeOfSelect) 00 00 00 (pcrSelect, no pcr values are associated = with reading from this NV space) I don't believe you will need to touch the pcr select struct unless some PCRs are selected -- meaning you can leave sizeOfSelect=3D0 and pcrSelect=3DNULL in that case. > TPM_LOCALITY_SELECTION > 1f (no locality limitation when reading from this NV space) Yep, this should still be set. > TPM_COMPOSITE_HASH > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > Do you think this implementation is ok? It is fine, you just might be able to make it a little simpler than it is in the case of the pcr select structure. :-) Kent > > Thanks, > James > > -----Original Message----- > From: Kent Yoder [mailto:shp...@gm...] > Sent: 2007=C4=EA6=D4=C213=C8=D5 3:51 > To: Xu, James > Cc: tro...@li... > Subject: Re: Re-submit of the trousers patch after modifying as your = suggestions > > Hi James, > > I started running the testcases and have run into something I didn't > notice at first. In Tspi_NV_DefineSpace for instance, when > obj_nvstore_create_pcrshortinfo() is called and = hReadPcrComposite=3D=3D0, > obj_nvstore_create_pcrshortinfo will return an unitialized return > value. To be similar to other trousers functions, you could add a > check if (hReadPcrComposite) before calling > obj_nvstore_create_pcrshortinfo, then remove that check inside > obj_nvstore_create_pcrshortinfo... > > Kent > > -- > Kent Yoder > IBM LTC Security Dev. > --=20 Kent Yoder IBM LTC Security Dev. |