Hi Max,

I agree with Ken that the man page/document should be updated to:
The *pbPcrData* parameter is a pointer to data which will be used in the
extend operation.

In the case when pcrEvent != NULL, the function will generate a hash of 20
bytes for you. Therefore,
the data size you passed into (different than 20) was still valid.

In the case when pcrEvent == NULL, you must provide a 20 bytes data,
typically SHA-1 hash.  Otherwise, you'll get a
bad parameter error.

Thank you and Ken.  I'll update the man page.


Regards,
Vicky


On Tue, Jun 9, 2015 at 11:21 PM, Massimo Gaggiano <[email protected]>
wrote:

>  ..no error if pcrEvent != NULL and data size != 20.
>
> Is this regular?
>
>   ------------------------------
> Da: Massimo Gaggiano <[email protected]>
> Inviato: ‎08/‎06/‎2015 01:27
> A: [email protected]
> Oggetto: [TrouSerS-users] PcrExtend() explanation
>
>  Hi all,
> I use IBM Software TPM.
>
> If the param 'pPcrEvent' is NULL I get the error 3003 "Bad parameter"
> when extending with data size different than 20.
> (No error with "12345678901234567890")
>
> Is there something I'm ignoring?
>
> Thank you very much.
> Max
>
> Here is my code in summary:
>
> const char *data = "s";
> UINT32 dataLen = strlen(data);
> Tspi_TPM_PcrExtend(hTPM, pcrIndex, dataLen, (BYTE *)data, NULL, \
>                                           &pcrValueLen, &pcrValue);
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> TrouSerS-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/trousers-users
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> TrouSerS-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/trousers-users
>
>
------------------------------------------------------------------------------
_______________________________________________
TrouSerS-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-users

Reply via email to