You are of course correct.  The TPM is a slave device and certainly 
can't go out on the bus and read memory.

You can locally store the bytes any way you like, as an array or as a 
pointer to an array.  So can the TPM.  When you marshal/serialize the 
structure, the result must be the bit map, not a pointer to a bitmap.

This is explained at the beginning of the document:

~~~~~~

2.1.6 Structure Definitions

This is not a MIDL compatible specification. The syntax of a structure 
definition is just a hint. It should be used with Description column to 
determine the nature of a structure member.

4. BYTE* is an array of bytes whose length is specified by a previous 
structure member. The array is not present if the length is zero.

~~~~~~

and the description of the pcrSelect is:

"This SHALL be a bit map that indicates if a PCR is active or not"

It is NOT "a C language pointer to a bitmap"

On 3/2/2014 6:21 PM, Robert Sutton II wrote:
>
> typedef struct tdTPM_PCR_SELECTION {
> UINT16 sizeOfSelect;
> [size_is(sizeOfSelect)] BYTE* pcrSelect;
> } TPM_PCR_SELECTION;
>
> Is pcrSelect really a pointer into memory? This seems really odd. So
> when I save pcrSelect on my stack and pass the pointer to the TPM, does
> this mean the TPM is reading pcrSelect off my stack? Why not just
> include the bytes directly in the structure, instead of a pointer to
> memory? This makes more sense because pcrSelect will never be more than
> a couple of bytes. I honestly didn't even know the TPM could read
> directly from memory like that.




------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
TrouSerS-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-users

Reply via email to