Updated version to 1.3. Fixed scan-build warning with `wolfTPM2_ReadPCR`.

pull/23/head
David Garske 2018-07-20 11:08:49 -07:00
parent 19ef638dc0
commit aa27a2ab65
4 changed files with 14 additions and 12 deletions

View File

@ -3,7 +3,7 @@
# All right reserved.
AC_COPYRIGHT([Copyright (C) 2014-2018 wolfSSL Inc.])
AC_INIT([wolftpm],[1.1.0],[https://github.com/wolfssl/wolfTPM/issues],[wolftpm],[http://www.wolfssl.com])
AC_INIT([wolftpm],[1.3.0],[https://github.com/wolfssl/wolfTPM/issues],[wolftpm],[http://www.wolfssl.com])
AC_PREREQ([2.63])
AC_CONFIG_AUX_DIR([build-aux])
@ -23,7 +23,7 @@ AC_ARG_PROGRAM
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([src/config.h])
WOLFTPM_LIBRARY_VERSION=2:0:0
WOLFTPM_LIBRARY_VERSION=3:0:0
# | | |
# +------+ | +---+
# | | |

View File

@ -926,11 +926,12 @@ int wolfTPM2_RsaDecrypt(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* key,
int wolfTPM2_ReadPCR(WOLFTPM2_DEV* dev, int pcrIndex, int alg, byte* digest,
int* digest_len)
int* p_digest_len)
{
int rc;
PCR_Read_In pcrReadIn;
PCR_Read_Out pcrReadOut;
int digest_len;
if (dev == NULL)
return BAD_FUNC_ARG;
@ -942,18 +943,19 @@ int wolfTPM2_ReadPCR(WOLFTPM2_DEV* dev, int pcrIndex, int alg, byte* digest,
return rc;
}
if (digest_len)
*digest_len = (int)pcrReadOut.pcrValues.digests[0].size;
digest_len = (int)pcrReadOut.pcrValues.digests[0].size;
if (digest)
XMEMCPY(digest, pcrReadOut.pcrValues.digests[0].buffer,
pcrReadOut.pcrValues.digests[0].size);
XMEMCPY(digest, pcrReadOut.pcrValues.digests[0].buffer, digest_len);
#ifdef DEBUG_WOLFTPM
printf("TPM2_PCR_Read: Index %d, Digest Sz %d, Update Counter %d\n",
pcrIndex, *digest_len, (int)pcrReadOut.pcrUpdateCounter);
TPM2_PrintBin(digest, *digest_len);
pcrIndex, digest_len, (int)pcrReadOut.pcrUpdateCounter);
TPM2_PrintBin(digest, digest_len);
#endif
if (p_digest_len)
*p_digest_len = digest_len;
return rc;
}

View File

@ -115,7 +115,7 @@ WOLFTPM_API int wolfTPM2_RsaDecrypt(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* key,
TPM_ALG_ID padScheme, const byte* in, int inSz, byte* msg, int* msgSz);
WOLFTPM_API int wolfTPM2_ReadPCR(WOLFTPM2_DEV* dev,
int pcrIndex, int alg, byte* digest, int* digest_len);
int pcrIndex, int alg, byte* digest, int* p_digest_len);
WOLFTPM_API int wolfTPM2_NVCreate(WOLFTPM2_DEV* dev, TPM_HANDLE authHandle,
word32 nvIndex, word32 nvAttributes, word32 maxSize, const byte* auth, int authSz);

View File

@ -34,8 +34,8 @@
extern "C" {
#endif
#define LIBWOLFTPM_VERSION_STRING "1.1.0"
#define LIBWOLFTPM_VERSION_HEX 0x01001000
#define LIBWOLFTPM_VERSION_STRING "1.3.0"
#define LIBWOLFTPM_VERSION_HEX 0x01003000
#ifdef __cplusplus
}