I've tried this on real TPM (infineon) and TPM emulator. Got 0x21
decryption error on both systems.

So, are there any possible solutions? Is it possible to encrypt by RSA
public key and decrypt using Tspi_Data_Unbind?

Thank you so much in advance.
Evgeny


On Wed, Nov 24, 2010 at 1:44 PM, Evgeny Bronnikov <[email protected]> wrote:
> Thank you! It works now.
>
> But I have the last problem: Tspi_Data_Unbind returns 0x21 (Decryption error).
>
> Here is my workflow:
>
> 1) create and register RSA key, save public part to .pem (inside the 1st tool)
> 2) encrypt some data by this .pem using openssl tool:
>     openssl rsautl -encrypt -in ./data.txt -out ./data-secret.txt
> -pubin -inkey pubkey.pem
> 3) load stored key, and unbind data-secret.txt by this key
>
> Here is the code from 2nd tool:
>
> // init context, load SRK, set SRK password
>
> //create secret data object
> Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_ENCDATA,
> TSS_ENCDATA_BIND, &hEncData)
>
> //load data-secret.txt into variable "blob"
> // setup hEncData object
> Tspi_SetAttribData(hEncData, TSS_TSPATTRIB_ENCDATA_BLOB,
> TSS_TSPATTRIB_ENCDATABLOB_BLOB, blob_size, blob)
>
> // load stored key by UUID
> Tspi_Context_LoadKeyByUUID(hContext, TSS_PS_TYPE_SYSTEM, keyUUID, &hKey)
>
> //try to unbind the data:
> Tspi_Data_Unbind(hEncData, hKey, &unbind_size, &unbind_data)
> // got 0x21 decrypt error here
>
>
> I'm really sorry to trouble you, but I'm new to TPM programming.
> Everything is not so clear for me.
> Thank you very much for your help.
>
> Evgeny
>

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
TrouSerS-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-users

Reply via email to