Build fixes when using `WOLFTPM2_USE_SW_ECDHE`.

pull/86/head
David Garske 2020-04-16 07:09:04 -07:00
parent e6672d94a6
commit 80c5e5a2b6
2 changed files with 8 additions and 0 deletions

View File

@ -85,7 +85,9 @@ int TPM2_TLS_Client(void* userCtx)
#ifdef HAVE_ECC
WOLFTPM2_KEY eccKey;
ecc_key wolfEccKey;
#ifndef WOLFTPM2_USE_SW_ECDHE
WOLFTPM2_KEY ecdhKey;
#endif
#endif
TPMT_PUBLIC publicTemplate;
TpmCryptoDevCtx tpmCtx;
@ -222,9 +224,11 @@ int TPM2_TLS_Client(void* userCtx)
rc = wolfTPM2_EccKey_TpmToWolf(&dev, &eccKey, &wolfEccKey);
if (rc != 0) goto exit;
#ifndef WOLFTPM2_USE_SW_ECDHE
/* Ephemeral Key */
XMEMSET(&ecdhKey, 0, sizeof(ecdhKey));
tpmCtx.ecdhKey = &ecdhKey;
#endif
#endif /* HAVE_ECC */

View File

@ -82,7 +82,9 @@ int TPM2_TLS_Server(void* userCtx)
#ifdef HAVE_ECC
WOLFTPM2_KEY eccKey;
ecc_key wolfEccKey;
#ifndef WOLFTPM2_USE_SW_ECDHE
WOLFTPM2_KEY ecdhKey;
#endif
#endif
TPMT_PUBLIC publicTemplate;
TpmCryptoDevCtx tpmCtx;
@ -230,9 +232,11 @@ int TPM2_TLS_Server(void* userCtx)
rc = wolfTPM2_EccKey_TpmToWolf(&dev, &eccKey, &wolfEccKey);
if (rc != 0) goto exit;
#ifndef WOLFTPM2_USE_SW_ECDHE
/* Ephemeral Key */
XMEMSET(&ecdhKey, 0, sizeof(ecdhKey));
tpmCtx.ecdhKey = &ecdhKey;
#endif
#endif /* HAVE_ECC */