The problem is solved. I've just used wrong pointer for bind_data_buf.

Evgeny



On Thu, Nov 25, 2010 at 6:36 PM, Evgeny Bronnikov <[email protected]> wrote:
> Hello!
>
> I have strange problem with unbinding data (0x21 Decryption error):
>
>
> // init context, load SRK
> // .....
>
> // create key
> TSS_FLAG initFlags = TSS_KEY_TYPE_LEGACY | TSS_KEY_SIZE_2048 |
> TSS_KEY_VOLATILE | TSS_KEY_NO_AUTHORIZATION | TSS_KEY_NOT_MIGRATABLE;
> Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_RSAKEY, initFlags, &hKey);
> Tspi_Key_CreateKey(hKey, hSRK, 0);
> Tspi_Key_LoadKey(hKey, hSRK);
>
> //bind some data
> Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_ENCDATA,
> TSS_ENCDATA_LEGACY, &hEncData); //also tried TSS_ENCDATA_BIND
> Tspi_Data_Bind(hEncData, hKey, some_data_size, some_data_buf);
> Tspi_GetAttribData(hEncData, TSS_TSPATTRIB_ENCDATA_BLOB,
> TSS_TSPATTRIB_ENCDATABLOB_BLOB, &bind_data_size, &bind_data_buf);
>
> //try to unbind data
> TSS_HENCDATA hAnotherData
> Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_ENCDATA,
> TSS_ENCDATA_LEGACY, &hAnotherData); //also tried TSS_ENCDATA_BIND
> Tspi_SetAttribData(hAnotherData, TSS_TSPATTRIB_ENCDATA_BLOB,
> TSS_TSPATTRIB_ENCDATABLOB_BLOB, bind_data_size, bind_data_buf);
> Tspi_Data_Unbind(hAnotherData, hKey, &unbind_data_size, &unbind_data_buf);
> // Got error here: 0x21 (Decryption error)
>
>
> Tspi_Data_Unbind returns decryption error. But if I use the same data
> object (hEncData) - everything works ok.
> Are there any other necessary attributes required for another data
> object before unbind?
>
> Thanks in advance.
>

------------------------------------------------------------------------------
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