wolfTPM Release v2.1.0 preparation.

* Updated copyright
* Fixed minor cast warning.
* Fixed minor scan-build warnings.
* Cleanup print public and fix possible print of uninitialized field.
pull/151/head
David Garske 2021-03-17 08:40:15 -07:00
parent d086eba2c3
commit 2b8cfb8692
68 changed files with 187 additions and 155 deletions

View File

@ -1,6 +1,20 @@
## Release Notes
# Release Notes
### wolfTPM Release 2.0 (12/07/2020)
## wolfTPM Release 2.1 (03/17/2021)
* Fixed possible KDFa buffer overrun (PR #147)
* Fixed typo on `WOLFTPM_USER_SETTINGS` (PR #140)
* Improved examples to use the key templates. (PR #136)
* Added symmetric key support for key generation examples (PR #143)
* Added NVRAM examples (PR #145)
* Added STM32 CubeMX I2C support (PR #142)
* Added details for TPM 2.0 with Windows TBS (PR #144)
* Added alternate subject name to example certificates for TLS (PR #141)
* Updated expired wolfSSL certs (PR #139)
* Removed EK from the attestation and signed timestamp examples (PR #152)
## wolfTPM Release 2.0 (12/07/2020)
**Summary**
@ -28,7 +42,7 @@ Added AES CFB parameter encryption, HMAC sessions, TPM simulator, Windows TPM (T
* Add script to run unit tests with software TPM (PR #124)
### wolfTPM Release 1.9 (08/24/2020)
## wolfTPM Release 1.9 (08/24/2020)
**Summary**
@ -53,7 +67,7 @@ Added NPCT75x Nuvoton support, dynamic module detection, and attestation key wra
* Add TPM benchmarking results for Nuvoton NPCT650 TPM2.0 module. (PR #92)
### wolfTPM Release 1.8 (04/28/2020)
## wolfTPM Release 1.8 (04/28/2020)
**Summary**
@ -75,7 +89,7 @@ Added Xilinx Zynq UltraScale+ MPSoC, Linux TIS kernel driver, Nuvoton and Nation
* Moved the chip specific settings to `tpm2_types.h`. (PR #85)
### wolfTPM Release 1.7 (12/27/2019)
## wolfTPM Release 1.7 (12/27/2019)
**Summary**
@ -91,7 +105,7 @@ Adds new wrappers for Non-Volatile (NV), changing auth for a key and shutdown.
* Added new wrappers for shutdown and handle cleanup. (PR #81)
### wolfTPM Release 1.6 (08/01/2019)
## wolfTPM Release 1.6 (08/01/2019)
**Summary**
@ -124,7 +138,7 @@ Improvements for compatibility, chip detection, initialization options and small
* Added way to include generated `wolftpm/options.h` (or customized one) using `WOLFTPM_USER_SETTINGS`. (PR #63)
### wolfTPM Release 1.5 (02/20/2019)
## wolfTPM Release 1.5 (02/20/2019)
**Summary**
@ -155,7 +169,7 @@ Adds support for the Microchip ATTPM20 TPM 2.0 module and Barebox bootloader. Im
* Updated benchmarks and console output for examples in README.md.
### wolfTPM Release 1.4 (11/13/2018)
## wolfTPM Release 1.4 (11/13/2018)
* Fixed cryptodev ECC callback to use R and S for the signature verify. (PR #39)
* Fixed printf type warnings with `DEBUG_WOLFTPM` defined. (PR #37)
@ -198,7 +212,7 @@ Adds support for the Microchip ATTPM20 TPM 2.0 module and Barebox bootloader. Im
* Cleanup to move types and configuration/port specific items into new `tpm2_types.h`. (PR #24)
### wolfTPM Release 1.3 (07/20/2018)
## wolfTPM Release 1.3 (07/20/2018)
* Fixed the TIS TPM_BASE_ADDRESS to conform to specification. (PR #19)
* Fixed static analysis warnings. (PR #20)
@ -215,7 +229,7 @@ Adds support for the Microchip ATTPM20 TPM 2.0 module and Barebox bootloader. Im
* Moved some of the example configuration into `./examples/tpm_io.h`. (PR #17)
### wolfTPM Release 1.1 (03/09/2018)
## wolfTPM Release 1.1 (03/09/2018)
* Added TPM2 wrapper layer to simplify key creation, RSA encrypt/decrypt, ECC sign/verify and ECDH.
* Added TPM2 wrapper example code.
@ -229,7 +243,7 @@ Adds support for the Microchip ATTPM20 TPM 2.0 module and Barebox bootloader. Im
* New tests for TPM2 native API's (test coverage is about 75%).
### wolfTPM Release 1.0 (02/06/2018)
## wolfTPM Release 1.0 (02/06/2018)
* Support for all TPM2 native API's using TIS and SPI IO callback.
* Helper for getting TPM return code string `TPM2_GetRCString`.

View File

@ -1,6 +1,6 @@
/* wolftpm_example.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* wolftpm_example.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,9 +1,9 @@
# wolftpm
# Copyright (C) 2020 wolfSSL Inc.
# Copyright (C) 2021 wolfSSL Inc.
# All right reserved.
AC_COPYRIGHT([Copyright (C) 2014-2020 wolfSSL Inc.])
AC_INIT([wolftpm],[2.0.0],[https://github.com/wolfssl/wolfTPM/issues],[wolftpm],[http://www.wolfssl.com])
AC_COPYRIGHT([Copyright (C) 2014-2021 wolfSSL Inc.])
AC_INIT([wolftpm],[2.1.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=10:0:0
WOLFTPM_LIBRARY_VERSION=11:0:0
# | | |
# +------+ | +---+
# | | |
@ -392,7 +392,7 @@ rm -f $OPTION_FILE
echo "/* wolftpm options.h" > $OPTION_FILE
echo " * generated from configure options" >> $OPTION_FILE
echo " *" >> $OPTION_FILE
echo " * Copyright (C) 2006-2020 wolfSSL Inc." >> $OPTION_FILE
echo " * Copyright (C) 2006-2021 wolfSSL Inc." >> $OPTION_FILE
echo " *" >> $OPTION_FILE
echo " * * This file is part of wolfTPM." >> $OPTION_FILE
echo " *" >> $OPTION_FILE

View File

@ -1,6 +1,6 @@
/* bench.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* bench.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* csr.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* csr.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -146,11 +146,11 @@ int TPM2_Keygen_Example(void* userCtx, int argc, char *argv[])
/* Did the user provide specific options? */
if (argv[argc-1][SYM_EXTRA_OPTS_POS] == '=') {
rc = symChoice(argv[argc-1], &algSym, &keyBits, symMode);
}
/* In case of incorrect extra options, abort execution */
if (rc != TPM_RC_SUCCESS) {
usage();
return 0;
/* In case of incorrect extra options, abort execution */
if (rc != TPM_RC_SUCCESS) {
usage();
return 0;
}
}
/* Otherwise, defaults are used: AES CTR, 256 key bits */
}

View File

@ -1,6 +1,6 @@
/* keygen.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* keyimport.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* keyload.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* flush.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* flush.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* native_test.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* native_test.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -169,7 +169,6 @@ int TPM2_NVRAM_Read_Example(void* userCtx, int argc, char *argv[])
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintPublicArea(&keyBlob.pub);
printf("\n");
#endif
}

View File

@ -179,7 +179,6 @@ int TPM2_NVRAM_Store_Example(void* userCtx, int argc, char *argv[])
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintPublicArea(&keyBlob.pub);
printf("\n");
#endif
}
if (partialStore != PUBLIC_PART_ONLY) {

View File

@ -1,6 +1,6 @@
/* store.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* extend.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* extend.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* quote.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* quote.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* reset.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* reset.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* pkcs7.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* pkcs7.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* clock_set.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* clock_set.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* signed_timestamp.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* signed_timestamp.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tls_client.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tls_client.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tls_client_notpm.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tls_common.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tls_server.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tls_server.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm_io.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm_io.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm_test.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm_test_keys.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*
@ -50,14 +50,15 @@ int writeKeyBlob(const char* filename,
/* Make publicArea in encoded format to eliminate empty fields, save space */
rc = TPM2_AppendPublic(pubAreaBuffer, (word32)sizeof(pubAreaBuffer),
&pubAreaSize, &key->pub);
if (rc != TPM_RC_SUCCESS) return rc;
if (rc != TPM_RC_SUCCESS)
return rc;
if (pubAreaSize != (key->pub.size + (int)sizeof(key->pub.size))) {
#ifdef DEBUG_WOLFTPM
printf("writeKeyBlob: Sanity check for publicArea size failed\n");
#endif
return -1;
return BUFFER_E;
}
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintBin(pubAreaBuffer, pubAreaSize);
#endif
/* Write size marker for the public part */
fileSz += XFWRITE(&key->pub.size, 1, sizeof(key->pub.size), fp);
/* Write the public part with bytes aligned */
@ -117,9 +118,9 @@ int readKeyBlob(const char* filename, WOLFTPM2_KEYBLOB* key)
rc = TPM2_ParsePublic(&key->pub, pubAreaBuffer,
(word32)sizeof(pubAreaBuffer), &pubAreaSize);
if (rc != TPM_RC_SUCCESS) return rc;
#ifdef DEBUG_WOLFTPM
#ifdef DEBUG_WOLFTPM
TPM2_PrintPublicArea(&key->pub);
#endif
#endif
if (fileSz > 0) {
printf("Reading the private part of the key\n");
@ -309,7 +310,7 @@ int getRSAkey(WOLFTPM2_DEV* pDev,
#if !defined(WOLFTPM2_NO_WOLFCRYPT) && !defined(NO_RSA)
if (pWolfRsaKey) {
/* setup wolf RSA key with TPM deviceID, so crypto callbacks are used */
rc = wc_InitRsaKey_ex(pWolfRsaKey, NULL, tpmDevId);
rc = wc_InitRsaKey_ex((RsaKey*)pWolfRsaKey, NULL, tpmDevId);
if (rc != 0) return rc;
/* load public portion of key into wolf RSA Key */
@ -343,7 +344,7 @@ int getECCkey(WOLFTPM2_DEV* pDev,
#if !defined(WOLFTPM2_NO_WOLFCRYPT) && defined(HAVE_ECC)
if (pWolfEccKey) {
/* setup wolf ECC key with TPM deviceID, so crypto callbacks are used */
rc = wc_ecc_init_ex(pWolfEccKey, NULL, tpmDevId);
rc = wc_ecc_init_ex((ecc_key*)pWolfEccKey, NULL, tpmDevId);
if (rc != 0) return rc;
/* load public portion of key into wolf ECC Key */

View File

@ -1,6 +1,6 @@
/* tpm_test_keys.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* wrap_test.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* wrap_test.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*
@ -226,7 +226,6 @@ static int TPM2_CommandProcess(TPM2_CTX* ctx, TPM2_Packet* packet,
#else
(void)handleValue;
(void)handlePos;
return NOT_COMPILED_IN;
#endif
}
@ -331,7 +330,6 @@ static int TPM2_ResponseProcess(TPM2_CTX* ctx, TPM2_Packet* packet,
}
#else
(void)cmdCode;
return NOT_COMPILED_IN;
#endif
/* Handle session request for decryption */
@ -5847,85 +5845,106 @@ void TPM2_PrintAuth(const TPMS_AUTH_COMMAND* authCmd)
void TPM2_PrintPublicArea(const TPM2B_PUBLIC* pub)
{
printf("publicArea:\n");
printf("Total public area size is = %d\n", pub->size);
printf("Public Area (size %d):\n", pub->size);
/* Sanity check */
if (pub->size > (sizeof(TPM2B_PUBLIC)) || pub->size == 0) {
printf("Incorrect publicArea size. Aborting debug print\n");
printf("Invalid TPM2B_PUBLIC size\n");
return;
}
printf("algType = 0x%2.2X\n", pub->publicArea.type);
printf("nameAlg = 0x%2.2X\n", pub->publicArea.nameAlg);
printf("objectAttributes = 0x%X\n", pub->publicArea.objectAttributes);
printf("authPolicy size = %d\n", pub->publicArea.authPolicy.size);
/* authPolicy is optional */
if (pub->publicArea.authPolicy.size > 0 &&
pub->publicArea.authPolicy.size < sizeof(pub->publicArea.authPolicy)) {
TPM2_PrintBin(pub->publicArea.authPolicy.buffer,
pub->publicArea.authPolicy.size);
}
else {
printf("authPolicy size is incorrect = %d\n", pub->publicArea.authPolicy.size);
}
printf(" Type: %s (0x%X), name: %s (0x%X), objAttr: 0x%X, authPolicy sz: %d\n",
TPM2_GetAlgName(pub->publicArea.type), pub->publicArea.type,
TPM2_GetAlgName(pub->publicArea.nameAlg), pub->publicArea.nameAlg,
pub->publicArea.objectAttributes,
pub->publicArea.authPolicy.size);
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintBin(pub->publicArea.authPolicy.buffer, pub->publicArea.authPolicy.size);
#endif
/* parameters and unique field depend on algType */
switch(pub->publicArea.type) {
switch (pub->publicArea.type) {
case TPM_ALG_KEYEDHASH:
printf("KeyedHash scheme = 0x%2.2X\n", pub->publicArea.parameters.keyedHashDetail.scheme.scheme);
printf("KeyedHash details = 0x%2.2X\n", pub->publicArea.parameters.keyedHashDetail.scheme.details.hmac.hashAlg);
printf("KeyedHash unique\n");
printf(" Keyed Hash: scheme: %s (0x%X), scheme hash: %s (0x%X), unique size %d\n",
TPM2_GetAlgName(pub->publicArea.parameters.keyedHashDetail.scheme.scheme),
pub->publicArea.parameters.keyedHashDetail.scheme.scheme,
TPM2_GetAlgName(pub->publicArea.parameters.keyedHashDetail.scheme.details.hmac.hashAlg),
pub->publicArea.parameters.keyedHashDetail.scheme.details.hmac.hashAlg,
pub->publicArea.unique.keyedHash.size);
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintBin(pub->publicArea.unique.keyedHash.buffer, pub->publicArea.unique.keyedHash.size);
#endif
break;
case TPM_ALG_SYMCIPHER:
printf("symDetail algorithm = 0x%2.2X\n", pub->publicArea.parameters.symDetail.sym.algorithm);
printf("symDetail keyBits = 0x%2.2X\n", pub->publicArea.parameters.symDetail.sym.keyBits.sym);
printf("symDetail mode = 0x%2.2X\n", pub->publicArea.parameters.symDetail.sym.mode.sym);
printf("symDetail unique\n");
printf(" Symmetric Cipher: algorithm: %s (0x%X), keyBits: %d, mode: %s (0x%X), unique size %d\n",
TPM2_GetAlgName(pub->publicArea.parameters.symDetail.sym.algorithm),
pub->publicArea.parameters.symDetail.sym.algorithm,
pub->publicArea.parameters.symDetail.sym.keyBits.sym,
TPM2_GetAlgName(pub->publicArea.parameters.symDetail.sym.mode.sym),
pub->publicArea.parameters.symDetail.sym.mode.sym,
pub->publicArea.unique.sym.size);
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintBin(pub->publicArea.unique.sym.buffer, pub->publicArea.unique.sym.size);
#endif
break;
case TPM_ALG_RSA:
printf("rsaDetail algorithm = 0x%2.2X\n", pub->publicArea.parameters.rsaDetail.symmetric.algorithm);
printf("rsaDetail keyBits = 0x%2.2X\n", pub->publicArea.parameters.rsaDetail.symmetric.keyBits.sym);
printf("rsaDetail mode = 0x%2.2X\n", pub->publicArea.parameters.rsaDetail.symmetric.mode.sym);
printf("rsaDetail scheme = 0x%2.2X\n", pub->publicArea.parameters.rsaDetail.scheme.scheme);
printf("rsaDetail scheme details = 0x%2.2X\n", pub->publicArea.parameters.rsaDetail.scheme.details.anySig.hashAlg);
printf("rsaDetail keyBits = 0x%2.2X\n", pub->publicArea.parameters.rsaDetail.keyBits);
printf("rsaDetail exponent = 0x%X\n", pub->publicArea.parameters.rsaDetail.exponent);
printf("RSA Detail unique\n");
printf(" RSA: sym algorithm: %s (0x%X), sym keyBits: %d, sym mode: %s (0x%X)\n",
TPM2_GetAlgName(pub->publicArea.parameters.rsaDetail.symmetric.algorithm),
pub->publicArea.parameters.rsaDetail.symmetric.algorithm,
pub->publicArea.parameters.rsaDetail.symmetric.keyBits.sym,
TPM2_GetAlgName(pub->publicArea.parameters.rsaDetail.symmetric.mode.sym),
pub->publicArea.parameters.rsaDetail.symmetric.mode.sym);
printf(" scheme: %s (0x%X), scheme hash: %s (0x%X)\n",
TPM2_GetAlgName(pub->publicArea.parameters.rsaDetail.scheme.scheme),
pub->publicArea.parameters.rsaDetail.scheme.scheme,
TPM2_GetAlgName(pub->publicArea.parameters.rsaDetail.scheme.details.anySig.hashAlg),
pub->publicArea.parameters.rsaDetail.scheme.details.anySig.hashAlg);
printf(" keyBits: %d, exponent: 0x%X, unique size %d\n",
pub->publicArea.parameters.rsaDetail.keyBits,
pub->publicArea.parameters.rsaDetail.exponent,
pub->publicArea.unique.rsa.size);
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintBin(pub->publicArea.unique.rsa.buffer, pub->publicArea.unique.rsa.size);
#endif
break;
case TPM_ALG_ECC:
printf("eccDetail algorithm = 0x%2.2X\n", pub->publicArea.parameters.eccDetail.symmetric.algorithm);
printf("eccDetail keyBits = 0x%2.2X\n", pub->publicArea.parameters.eccDetail.symmetric.keyBits.sym);
printf("eccDetail mode = 0x%2.2X\n", pub->publicArea.parameters.eccDetail.symmetric.mode.sym);
printf("eccDetail scheme = 0x%2.2X\n", pub->publicArea.parameters.eccDetail.scheme.scheme);
printf("eccDetail scheme details = 0x%2.2X\n", pub->publicArea.parameters.eccDetail.scheme.details.any.hashAlg);
printf("eccDetail curveID = 0x%2.2X\n", pub->publicArea.parameters.eccDetail.curveID);
printf("eccDetail KDF scheme = 0x%X\n", pub->publicArea.parameters.eccDetail.kdf.scheme);
printf("eccDetail KDF details = 0x%X\n", pub->publicArea.parameters.eccDetail.kdf.details.any.hashAlg);
printf("ECC Detail unique X\n");
printf(" ECC: sym algorithm: %s (0x%X), sym keyBits: %d, sym mode: %s (0x%X)\n",
TPM2_GetAlgName(pub->publicArea.parameters.eccDetail.symmetric.algorithm),
pub->publicArea.parameters.eccDetail.symmetric.algorithm,
pub->publicArea.parameters.eccDetail.symmetric.keyBits.sym,
TPM2_GetAlgName(pub->publicArea.parameters.eccDetail.symmetric.mode.sym),
pub->publicArea.parameters.eccDetail.symmetric.mode.sym);
printf(" scheme: %s (0x%X), scheme hash: %s (0x%X), curveID: size %d, 0x%X\n",
TPM2_GetAlgName(pub->publicArea.parameters.eccDetail.scheme.scheme),
pub->publicArea.parameters.eccDetail.scheme.scheme,
TPM2_GetAlgName(pub->publicArea.parameters.eccDetail.scheme.details.any.hashAlg),
pub->publicArea.parameters.eccDetail.scheme.details.any.hashAlg,
TPM2_GetCurveSize(pub->publicArea.parameters.eccDetail.curveID),
pub->publicArea.parameters.eccDetail.curveID);
printf(" KDF scheme: %s (0x%X), KDF alg: %s (0x%X), unique X/Y size %d/%d\n",
TPM2_GetAlgName(pub->publicArea.parameters.eccDetail.kdf.scheme),
pub->publicArea.parameters.eccDetail.kdf.scheme,
TPM2_GetAlgName(pub->publicArea.parameters.eccDetail.kdf.details.any.hashAlg),
pub->publicArea.parameters.eccDetail.kdf.details.any.hashAlg,
pub->publicArea.unique.ecc.x.size,
pub->publicArea.unique.ecc.y.size);
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintBin(pub->publicArea.unique.ecc.x.buffer, pub->publicArea.unique.ecc.x.size);
printf("ECC Detail unique Y\n");
TPM2_PrintBin(pub->publicArea.unique.ecc.y.buffer, pub->publicArea.unique.ecc.y.size);
#endif
break;
default:
/* derive does not seem to have specific fields in the parameters struct */
printf("Derive unique label\n");
TPM2_PrintBin(pub->publicArea.unique.derive.label.buffer, pub->publicArea.unique.derive.label.size);
printf("Derive unique context\n");
printf("Derive Type: unique label size %d, context size %d\n",
pub->publicArea.unique.derive.label.size,
pub->publicArea.unique.derive.context.size);
#ifdef WOLFTPM_DEBUG_VERBOSE
TPM2_PrintBin(pub->publicArea.unique.derive.label.buffer,pub->publicArea.unique.derive.label.size);
TPM2_PrintBin(pub->publicArea.unique.derive.context.buffer, pub->publicArea.unique.derive.context.size);
#endif
break;
}
printf("\n");
}
#endif
#endif /* DEBUG_WOLFTPM */
/******************************************************************************/
/* --- END Helpful API's -- */

View File

@ -1,6 +1,6 @@
/* tpm2_linux.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_packet.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_param_enc.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*
@ -176,7 +176,6 @@ int TPM2_KDFa(
memcpy(keyStream, hash, copyLen);
keyStream += copyLen;
}
ret = pos;
ret = keySz;
exit:

View File

@ -1,6 +1,6 @@
/* tpm2_swtpm.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_tis.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_winapi.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_wrap.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*
@ -925,6 +925,7 @@ int wolfTPM2_CreateKey(WOLFTPM2_DEV* dev, WOLFTPM2_KEYBLOB* keyBlob,
/* clear output key buffer */
XMEMSET(keyBlob, 0, sizeof(WOLFTPM2_KEYBLOB));
XMEMSET(&createOut, 0, sizeof(createOut)); /* make sure pub struct is zero init */
/* set session auth for parent key */
wolfTPM2_SetAuthHandle(dev, 0, parent);
@ -955,7 +956,6 @@ int wolfTPM2_CreateKey(WOLFTPM2_DEV* dev, WOLFTPM2_KEYBLOB* keyBlob,
#ifdef DEBUG_WOLFTPM
printf("TPM2_Create key: pub %d, priv %d\n",
createOut.outPublic.size, createOut.outPrivate.size);
TPM2_PrintBin(createOut.outPrivate.buffer, createOut.outPrivate.size);
TPM2_PrintPublicArea(&createOut.outPublic);
#endif
@ -3470,6 +3470,7 @@ int wolfTPM2_LoadKeyedHashKey(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* key,
#ifdef DEBUG_WOLFTPM
printf("TPM2_Create key: pub %d, priv %d\n", createOut.outPublic.size,
createOut.outPrivate.size);
TPM2_PrintPublicArea(&createOut.outPublic);
#endif
key->handle.symmetric = createOut.outPublic.publicArea.parameters.asymDetail.symmetric;
key->pub = createOut.outPublic;

View File

@ -1,6 +1,6 @@
/* unit_tests.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* options.h.in
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_linux.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_packet.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_param_enc.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_socket.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_swtpm.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_tis.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_types.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_winapi.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* tpm2_wrap.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* version.h.in
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*
@ -34,8 +34,8 @@
extern "C" {
#endif
#define LIBWOLFTPM_VERSION_STRING "2.0.0"
#define LIBWOLFTPM_VERSION_HEX 0x02000000
#define LIBWOLFTPM_VERSION_STRING "2.1.0"
#define LIBWOLFTPM_VERSION_HEX 0x02001000
#ifdef __cplusplus
}

View File

@ -1,6 +1,6 @@
/* version.h.in
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*

View File

@ -1,6 +1,6 @@
/* visibility.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfTPM.
*