Hi Rajiv,
I managed to make it work now with quite a lot of help by Evgeny.
In fact, I think I misunderstood the definition of "Tspi_Key_GetPubKey(...)".
Instead I try to get the public key modulus and exponent, which I pack into
a PEM-formatted string or file or whatever.
This PEM-formatted public key (pubKey), is then used to encrypt data using
openssl-functions (instead of binding the data with trousers-functions); The
encrypted data is then transferred back to my local client, where I can do
an "Unbind" with the previously generated key in order to get back my
cleartext.
Notice also, that I run the "Tspi_Context_FreeMemory(...)"-function too
early, such that data, that was just unbound, gets lost.
Another important factor was the TSS_KEY_TYPE_LEGACY-flag. It seems like by
setting it to TSS_KEY_TYPE_BIND, instead, unbinding stuff won't work
anymore. Since I don't know the entire spec, this may be a point I missed.
Please find the working code over here: http://pastebin.com/1VkvhEHk
Hope, it may once be useful for someone... :)
Many thanks to Evgeny for his code example and to Rajiv,
Best,
-Manuel
On Mon, Nov 22, 2010 at 12:51 AM, Manuel Jeckelmann
<[email protected]>wrote:
> Hi Rajiv,
>
> First of all, thank you for your reply!
>
> On Wed, Nov 17, 2010 at 4:28 PM, Rajiv Andrade
> <[email protected]>wrote:
>
>> On 05/11/10 08:44, Manuel Jeckelmann wrote:
>>
>>> And that's where my problem arises. Tspi_Data_Unbind returns everytime
>>> with an error code of 0x21 (or TSS_E_PS_KEY_EXISTS) which I don't
>>> understand...
>>>
>> Isn't it 0x121, TSS_E_ENC_NO_DATA? If so, how are you setting the EncData
>> blob?
>
>
> No, it is the 0x21, TSS_E_PS_KEY_EXISTS. In order to give you a better
> understanding, I coded a small test case, which does what I try to do.
> Please find it under http://pastebin.com/DpHiLdJE. It would be great if
> someone could test it.
>
> As I already mentionned in my first message, it may be a problem in
> relation with the TPM emulator I use. However, I could not test on another
> machine, so I am not sure at all...
>
> Thanks,
> -Manuel
>
------------------------------------------------------------------------------
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