diff --git a/configure.ac b/configure.ac index 50a1ebd9..03d9a3e2 100644 --- a/configure.ac +++ b/configure.ac @@ -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 # | | | # +------+ | +---+ # | | | diff --git a/src/tpm2_wrap.c b/src/tpm2_wrap.c index c44c634b..5dd1e628 100755 --- a/src/tpm2_wrap.c +++ b/src/tpm2_wrap.c @@ -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; } diff --git a/wolftpm/tpm2_wrap.h b/wolftpm/tpm2_wrap.h index 69671178..4b1e5149 100755 --- a/wolftpm/tpm2_wrap.h +++ b/wolftpm/tpm2_wrap.h @@ -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); diff --git a/wolftpm/version.h b/wolftpm/version.h index 17ece8a8..69b391cb 100644 --- a/wolftpm/version.h +++ b/wolftpm/version.h @@ -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 }