Fix `WOLFTPM2_USE_SW_ECDHE`.

pull/428/head
David Garske 2025-07-23 13:19:51 -07:00
parent 082f22ed43
commit 679020dd70
2 changed files with 6 additions and 4 deletions

View File

@ -180,11 +180,15 @@ int wolfTPM2_CryptoDevCb(int devId, wc_CryptoInfo* info, void* ctx)
int curve_id;
WOLFTPM2_KEY* key;
#ifdef WOLFTPM2_USE_SW_ECDHE
if (tlsCtx->ecdhKey == NULL) {
return exit_rc;
}
#endif
if ( tlsCtx->eccKey == NULL
&& tlsCtx->ecdsaKey == NULL
#ifndef WOLFTPM2_USE_SW_ECDHE
&& tlsCtx->ecdhKey == NULL
#endif
) {
#ifdef DEBUG_WOLFTPM
printf("No crypto callback key pointer set!\n");

View File

@ -3347,9 +3347,7 @@ typedef struct TpmCryptoDevCtx {
#ifdef HAVE_ECC
WOLFTPM2_KEY* eccKey; /* ECDSA - public only */
WOLFTPM2_KEYBLOB* ecdsaKey; /* ECDSA - retain encrypted private portion from keygen */
#ifndef WOLFTPM2_USE_SW_ECDHE
WOLFTPM2_KEY* ecdhKey; /* ECDH */
#endif
#endif
WOLFTPM2_KEY* storageKey;
#ifdef WOLFTPM_USE_SYMMETRIC