diff options
author | Martin Willi <martin@revosec.ch> | 2014-01-09 17:29:35 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-06-04 15:53:07 +0200 |
commit | 2877355408d539af08b85586e1f30bceaa2933e1 (patch) | |
tree | 4e7d7ba87b3b82b6e33baeea3b441de3b1355f6c /src | |
parent | c9891716b8333c01857fe8a2d54a79286e281fa1 (diff) | |
download | strongswan-2877355408d539af08b85586e1f30bceaa2933e1.tar.bz2 strongswan-2877355408d539af08b85586e1f30bceaa2933e1.tar.xz |
libpts: Fix PCR read, avoid cast of a pointer to different sized integer
Diffstat (limited to 'src')
-rw-r--r-- | src/libpts/pts/pts.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libpts/pts/pts.c b/src/libpts/pts/pts.c index 075af5bcc..b82b74405 100644 --- a/src/libpts/pts/pts.c +++ b/src/libpts/pts/pts.c @@ -623,7 +623,8 @@ METHOD(pts_t, read_pcr, bool, TSS_HCONTEXT hContext; TSS_HTPM hTPM; TSS_RESULT result; - chunk_t rgbPcrValue; + BYTE *buf; + UINT32 len; bool success = FALSE; @@ -644,12 +645,12 @@ METHOD(pts_t, read_pcr, bool, { goto err; } - result = Tspi_TPM_PcrRead(hTPM, pcr_num, (UINT32*)&rgbPcrValue.len, &rgbPcrValue.ptr); + result = Tspi_TPM_PcrRead(hTPM, pcr_num, &len, &buf); if (result != TSS_SUCCESS) { goto err; } - *pcr_value = chunk_clone(rgbPcrValue); + *pcr_value = chunk_clone(chunk_create(buf, len)); DBG3(DBG_PTS, "PCR %d value:%B", pcr_num, pcr_value); success = TRUE; |