in src/tpm_comm_emulator.c [61:72]
static int read_sync_cmd(TPM_COMM_INFO* tpm_comm_info, uint32_t* tpm_bytes)
{
int result;
uint32_t bytes_len = sizeof(uint32_t);
result = read_sync_bytes(tpm_comm_info, (unsigned char*)tpm_bytes, &bytes_len);
if (result == 0)
{
int j = htonl(*tpm_bytes);
*tpm_bytes = j;
}
return result;
}