I have used this command successfully, but not in all its variations

I am having some trouble in getting it working using the second parameter
(which I figured I would do as a demonstration);

So I have two questions:

1) If I am calling this command with the second parameter set, do I have
first have to set the TSS_TSPATTRIB_NV_PCR attributes and subattributes?
(Section 2.3.2.8) of the NV object I have created?   (It seems as though
this would be redundant.)

2) If not, what is wrong with this:

Set the TPM owner_auth password
// Create a PCR object with
Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_PCRS, 0, &hPCR16);
Tspi_PcrComposite_SelectPcrIndex(hPCR16,16);
Tspi_PcrComposite_SetPcrValue(hPCR16,16,20,rgbPCRvalue); // here
rgbPCRvalue is a Byte array set to all zeros

// Create an NV object
Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_NV,0, &hNVStore);
Tspi_SetAttribUint32(hNVStore, TSS_TSPATTRIB_NV_PERMISSIONS,0,
TPM_NV_PER_OWNERWRITE);
Tspi_SetATTRIBUin32(hNVStore, TSS_TSPATTRIB_NV_INDEX, 0x00011101);
Tspi_SetAttribUin32(hNVStore, TSS_TSPATTRIB_NV_DATASIZE,0, 32);


Tspi_NV_DefineSpace(hNVStore,hPCR16,0);

>> Get an error that "Accessed object is in an inconsistent state"

Note that at this point Tspi_NV_DefineSpace(hNVStore,0,0) succeeds.

(I immediately do a Tspi_NV_ReleaseSpace(hNVStore) after this, to make sure
I can run it again, by the way).

I should also mention that I compile with -Wall with no warnings or errors.
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
TrouSerS-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-users

Reply via email to