BitLocker - Sstic
BitLocker - Sstic
BitLocker - Sstic
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
A. Bordes 39<br />
9 Annexe 2 - Code (partiel) de lecture des registres PCR<br />
# include < windows .h><br />
# include <br />
# include <br />
# include <br />
# include " tpm .h"<br />
# define BUFFER_SIZE 512<br />
// Note : les structures ( TPM_PCRRead_In ) et constantes ( TPM_TAG )<br />
// doivent etre definies conformement a la norme TGS<br />
# define TPM_TAG_RQU_COMMAND 0 x00C1<br />
VOID TPMReadPcr ( TBS_HCONTEXT hContext )<br />
{<br />
TBS_RESULT rv;<br />
TPM_PCRRead_In Blob_TPM_PCRRead_In ;<br />
PTPM_PCRRead_Out pBlob_TPM_PCRRead_Out ;<br />
BYTE bInputSize ;<br />
BYTE buf [ BUFFER_SIZE ];<br />
UINT32 buf_len = BUFFER_SIZE ;<br />
bInputSize = sizeof ( Blob_TPM_PCRRead_In );<br />
for ( int i =0; i u.<br />
returnCode );<br />
PrintHex (( PBYTE )& pBlob_TPM_PCRRead_Out -> outDigest , digestSize );<br />
printf ("\r\n");<br />
int main ( int argc , char * argv [])<br />
{<br />
TBS_CONTEXT_PARAMS pContextParams ;<br />
TBS_HCONTEXT hContext ;<br />
TBS_RESULT rv;<br />
pContextParams . version = TBS_CONTEXT_VERSION_ONE ;<br />
rv = Tbsi_Context_Create (& pContextParams , & hContext );