So now I will give you nearly the whole code:
TSS_HCONTEXT hContext_PCR;
TSS_RESULT result;
unsigned char* content = NULL;
char filename[] = "test";
unsigned char* hash;
UINT32 hashlen;
UINT32 PCRindex_store = 10;
UINT32 dataSize = 20;
UINT32 PCRsize;
BYTE *PCRvalue_store;
TSS_HTPM hTPM = 0;
result = Tspi_Context_Create(&hContext_PCR);
result = Tspi_Context_Connect(hContext_PCR,NULL);
result = Tspi_Context_GetTpmObject(hContext_PCR, &hTPM);
open_read_file(filename, &content);
hash = malloc(20*sizeof(unsigned char)+1);
hashlen = createHash(strlen(content),content, &hash);
result = Tspi_TPM_PcrExtend(hTPM, PCRindex_store, hashlen, hash, NULL,
&PCRsize, &PCRvalue_store);
free(hash);
free(content);
And here is the output I get on the console:
SUCCESS: Tspi_Context_Create()
SUCCESS: Tspi_Context_Connect()
SUCCESS: Tspi_Context_GetTpmObject()
File_Size: 12
Input: Hallo Jonas!
SUCCESS: open_read_file()
data size: 12 data content: Hallo Jonas!
hash size: 20 hash content: ╚á>Ìhn¹uT╬Bå·t©-♣¹;Q
SUCCESS: createHash()
SIZE:20
ERROR: Tspi_TPM_PcrExtend()returned -2144861184 (Unknown error)
Drücken Sie eine beliebige Taste . . .
So as I said before the error comes from the Tspi_TPM_PcrExtend()
function...perhaps you can help me now. THX
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1
_______________________________________________
TrouSerS-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-users