Hi Darcy,

> /* set the public key data in the TSS object */
> result = Tspi_SetAttribData(*hKey, TSS_TSPATTRIB_KEY_BLOB,
> TSS_TSPATTRIB_KEYBLOB_PUBLIC_KEY,
> sizeN, n);

  The flags above will actually try to set RSA modulus data as the
key's TPM_KEY blob, so that will fail.  Take a look at our example
testcase for wrapping a key here [1].  You should use the flags
TSS_TSPATTRIB_RSAKEY_INFO, TSS_TSPATTRIB_KEYINFO_RSA_MODULUS instead
of what the book has.  In the testcase we use a helper function called
set_public_modulus() to do this, but that's not necessary -
set_public_modulus duplicates the code called when you use the
RSAKEY_INFO flags.

Kent

[1] 
http://trousers.git.sourceforge.net/git/gitweb.cgi?p=trousers/testsuite;a=blob;f=tcg/key/Tspi_Key_WrapKey01.c;h=fe8da6e8a1db9ed372a6c1588c267b1d29742c1c;hb=HEAD

>         /* set the private key data in the TSS object */
> result = Tspi_SetAttribData(*hKey, TSS_TSPATTRIB_KEY_BLOB,
> TSS_TSPATTRIB_KEYBLOB_PRIVATE_KEY,
> sizeP, p);
>          result = Tspi_Key_WrapKey(*hKey, hParentKey, hPcrs);
>          return result;
> }
>
> I list the core code of this function. Executing this,
> the Tspi_SetAttribData function returns an error "TSS_E_OUTOFMEMORY". ! I'm
> so confused, may anyone tell me why this happens? How can this problem be
> solved?
> I really need your help, sorry for my bad english. Thank you all!
>
> Best regards!
> Darcy.
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> TrouSerS-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/trousers-users
>



-- 
IBM LTC Security

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
TrouSerS-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-users

Reply via email to