Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a8947e6
F-3708 - Zero-initialize TBS_CONTEXT_PARAMS2 in TPM2_WinApi_SendCommand
aidangarske May 12, 2026
fc87b4b
F-3709 - NULL check wolfTPM2_NewKeyBlob in external_import
aidangarske May 12, 2026
25ccf1c
F-3710 - Use goto exit on TPM2_LoadExternal failure in make_credential
aidangarske May 12, 2026
e9d4f58
F-3711 - Set rc on cert/key buffer load failure in tls_client_notpm
aidangarske May 12, 2026
65e0daa
F-3918 - Bounds check pcrArray writes in secret_unseal and policy_sign
aidangarske May 12, 2026
1a91936
F-3919 - Treat swtpm response size as uint32_t and bound below by header
aidangarske May 12, 2026
660d3e7
F-3924 - Reject non-aligned size in block modes for EncryptDecryptBlock
aidangarske May 12, 2026
22c7b40
F-3722 - Reject x509sign keyHandle in FwCmd_Sign
aidangarske May 12, 2026
256faf9
F-3920 - Bitwise AND poll revents to accept POLLIN|POLLHUP
aidangarske May 12, 2026
6d90662
F-3921 - Restore goto exit on TPM2_ObjectChangeAuth failure in native…
aidangarske May 12, 2026
069dd33
F-3922 - Clamp -auth length in keygen example
aidangarske May 12, 2026
4e16a16
F-3926 - Clamp -ownerauth length in seal_nv example
aidangarske May 12, 2026
c13dc57
F-3927 - Clamp -password length in keyimport example
aidangarske May 12, 2026
1c06cba
F-3925 - Scale AES wrap to key strength in DecodeRsaDer and DecodeEccDer
aidangarske May 12, 2026
d695c06
F-3716 - ForceZero encKeyBuf and importedAuth in FwCmd_Import
aidangarske May 12, 2026
c4c1fb6
F-3717 - ForceZero authValue in FwCmd_LoadExternal
aidangarske May 12, 2026
fc35f9e
F-3718 - ForceZero SPDM vdMsg/vdRsp plaintext buffers before release
aidangarske May 12, 2026
acefdd2
F-3928 - ForceZero dataBuf in FwCmd_NV_Write before release
aidangarske May 12, 2026
1b6fcae
F-3720 - Zero in.auth on BAD_FUNC_ARG paths in NVCreateAuthPolicy_ex
aidangarske May 12, 2026
558dcc9
F-3721 - ForceZero HMAC/hash context in TPM2_KDFa_ex and TPM2_KDFe_ex
aidangarske May 12, 2026
e7de853
F-3931 - ForceZero GetRandom_Out in wolfTPM2_GetRandom
aidangarske May 12, 2026
3ebc3a0
F-3712 - Branch-free HMAC comparison for FwCmd_Sign ticket
aidangarske May 12, 2026
7d57dba
F-3713 - Branch-free HMAC comparison for FwCmd_CertifyCreation ticket
aidangarske May 12, 2026
6faedd7
F-3714 - Use TPM2_ConstantCompare for SPDM responder verify-data HMAC
aidangarske May 12, 2026
694b5cd
F-3715 - Add SHA3 and PQC reverse mappings in TPM2_GetAlgId
aidangarske May 12, 2026
e1f6d66
F-3723 - Replace derivedDataOrigin with firmwareLimited and svnLimited
aidangarske May 12, 2026
a1e161b
F-3923 - Log Zephyr getaddrinfo and per-attempt connect failures
aidangarske May 12, 2026
8037c0f
F-3929 - Unconditional left-pad of ECDH X-coordinate in HPKE encap/decap
aidangarske May 12, 2026
31b8121
F-3930 - Bound check offsets in ifx_fw_extract extractFW
aidangarske May 12, 2026
8db493a
F-3719 - Add KAT for TPM2_ParamEnc_AESCFB cross-checking KDFa+AES-CFB
aidangarske May 12, 2026
a48bfab
F-3722 - Guard x509sign check on WOLFTPM_V185 in FwCmd_Sign
aidangarske May 12, 2026
5149b3f
F-3714 - Use volatile inline accumulator for SPDM verify-data HMAC
aidangarske May 12, 2026
5f6988d
F-3918 - Use element-count form for pcrArray bounds check
aidangarske May 12, 2026
a8f9860
F-3723 - Keep TPMA_OBJECT_derivedDataOrigin as deprecated alias
aidangarske May 12, 2026
e4ac3db
F-3709 - Scope NULL guards to heap build in external_import
aidangarske May 12, 2026
3828dee
F-3711 - Use WOLFSSL_FATAL_ERROR not WOLFSSL_FAILURE in tls_client_notpm
aidangarske May 12, 2026
ca93d92
F-3709 - Zero-init dev in external_import before alloc-fail goto exit
aidangarske May 12, 2026
6e45e04
F-3929 - Restore dhSz<=nSk guard in HPKE ECDH pad to avoid truncation
aidangarske May 12, 2026
7943330
F-3928 - NULL-check dataBuf before ForceZero under WOLFTPM_SMALL_STACK
aidangarske May 12, 2026
27386cd
F-3922 - Use sizeof(auth.buffer) for -auth length check in keygen
aidangarske May 12, 2026
f30ce7f
F-3927 - Hoist mid-block declarations in keyimport and seal_nv examples
aidangarske May 12, 2026
66b650c
F-3924 - Document alignment contract and scrub per-iteration GetRando…
aidangarske May 12, 2026
852c2d2
F-3715 - Test SHA3/PQC GetAlgId, EncryptDecryptBlock alignment, and D…
aidangarske May 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/attestation/make_credential.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int TPM2_MakeCredential_Example(void* userCtx, int argc, char *argv[])
if (rc != TPM_RC_SUCCESS) {
printf("TPM2_LoadExternal: failed %d: %s\n", rc,
wolfTPM2_GetRCString(rc));
return rc;
goto exit;
}
printf("Public key for encryption loaded\n");
handle.hndl = loadExtOut.objectHandle;
Expand Down
6 changes: 6 additions & 0 deletions examples/boot/secret_unseal.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ int TPM2_Boot_SecretUnseal_Example(void* userCtx, int argc, char *argv[])
usage();
return 0;
}
if (pcrArraySz >= sizeof(pcrArray) / sizeof(pcrArray[0])) {
printf("Too many -pcr= arguments (max %zu)\n",
sizeof(pcrArray) / sizeof(pcrArray[0]));
usage();
return 0;
}
pcrArray[pcrArraySz] = pcrIndex;
pcrArraySz++;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/firmware/ifx_fw_extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,20 @@ static int extractFW(

READ_BE16(size16, fw, fw_size, offset);
offset += size16 + 1;
if (offset > fw_size) { LOG("FW file too short"); return -1; }

READ_BE16(size16, fw, fw_size, offset);
offset += size16;
if (offset > fw_size) { LOG("FW file too short"); return -1; }

READ_BE16(size16, fw, fw_size, offset);
offset2 = offset;
offset += size16;
if (offset > fw_size) { LOG("FW file too short"); return -1; }

READ_BE16(size16, fw, offset, offset2);
offset2 += size16;
if (offset2 > offset) { LOG("Bad manifest header size"); return -1; }

READ_BE16(num, fw, offset, offset2);

Expand All @@ -149,6 +153,10 @@ static int extractFW(

READ_BE16(size16, fw, offset, offset2);

if ((size_t)offset2 + size16 > offset) {
LOG("Bad manifest entry size");
return -1;
}
if (group == keygroup_id) {
printf("Chosen group found: %08x\n", group);
*manifest = &fw[offset2];
Expand Down
18 changes: 16 additions & 2 deletions examples/keygen/external_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,19 @@ int TPM2_ExternalImport_Example(void* userCtx, int argc, char *argv[])
argc--;
}

XMEMSET(&dev, 0, sizeof(dev));
XMEMSET(&storage, 0, sizeof(storage));
primary = &storage;

#ifndef WOLFTPM2_NO_HEAP
key2 = wolfTPM2_NewKeyBlob();
rsaKey3 = wolfTPM2_NewKeyBlob();
if (key2 == NULL || rsaKey3 == NULL) {
printf("wolfTPM2_NewKeyBlob allocation failed\n");
rc = MEMORY_E;
goto exit;
}
#endif
XMEMSET(&storage, 0, sizeof(storage));
primary = &storage;

rc = wolfTPM2_Init(&dev, TPM2_IoCb, NULL);
if (rc != TPM_RC_SUCCESS) {
Expand Down Expand Up @@ -237,8 +244,15 @@ int TPM2_ExternalImport_Example(void* userCtx, int argc, char *argv[])
}

exit:
#ifndef WOLFTPM2_NO_HEAP
if (rsaKey3 != NULL)
wolfTPM2_UnloadHandle(&dev, &rsaKey3->handle);
if (key2 != NULL)
wolfTPM2_UnloadHandle(&dev, &key2->handle);
#else
wolfTPM2_UnloadHandle(&dev, &rsaKey3->handle);
wolfTPM2_UnloadHandle(&dev, &key2->handle);
#endif
wolfTPM2_UnloadHandle(&dev, &primary->handle);

#ifndef WOLFTPM2_NO_HEAP
Expand Down
6 changes: 6 additions & 0 deletions examples/keygen/keygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ int TPM2_Keygen_Example(void* userCtx, int argc, char *argv[])
}
else if (XSTRNCMP(argv[argc-1], "-auth=", XSTRLEN("-auth=")) == 0) {
authStr = argv[argc-1] + XSTRLEN("-auth=");
if (XSTRLEN(authStr) > sizeof(auth.buffer)) {
printf("-auth value too long (max %zu)\n",
sizeof(auth.buffer));
usage();
return 0;
}
}
else if (argv[argc-1][0] != '-') {
outputFile = argv[argc-1];
Expand Down
10 changes: 9 additions & 1 deletion examples/keygen/keyimport.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,15 @@ int TPM2_Keyimport_Example(void* userCtx, int argc, char *argv[])

/* setup an auth value */
if (password != NULL) {
impKey.handle.auth.size = (int)XSTRLEN(password);
size_t pwLen;
pwLen = XSTRLEN(password);
if (pwLen > sizeof(impKey.handle.auth.buffer)) {
printf("-password too long (max %zu)\n",
sizeof(impKey.handle.auth.buffer));
rc = BUFFER_E;
goto exit;
}
impKey.handle.auth.size = (UINT16)pwLen;
XMEMCPY(impKey.handle.auth.buffer, password, impKey.handle.auth.size);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/native/native_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ int TPM2_Native_TestArgs(void* userCtx, int argc, char *argv[])
if (rc != TPM_RC_SUCCESS) {
printf("TPM2_ObjectChangeAuth failed 0x%x: %s\n", rc,
TPM2_GetRCString(rc));
//goto exit;
goto exit;
}
hmacKey.priv = cmdOut.objChgAuth.outPrivate;
printf("TPM2_ObjectChangeAuth: private %d\n", hmacKey.priv.size);
Expand Down
10 changes: 9 additions & 1 deletion examples/nvram/seal_nv.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,15 @@ int TPM2_NVRAM_SealNV_Example(void* userCtx, int argc, char *argv[])
/* Set owner auth */
parent.hndl = TPM_RH_OWNER;
if (XSTRLEN(ownerAuth) > 0) {
parent.auth.size = (int)XSTRLEN(ownerAuth);
size_t authLen;
authLen = XSTRLEN(ownerAuth);
if (authLen > sizeof(parent.auth.buffer)) {
fprintf(stderr, "-ownerauth value too long (max %zu)\n",
sizeof(parent.auth.buffer));
rc = BUFFER_E;
goto exit;
}
parent.auth.size = (UINT16)authLen;
XMEMCPY(parent.auth.buffer, ownerAuth, parent.auth.size);
}

Expand Down
6 changes: 6 additions & 0 deletions examples/pcr/policy_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ int TPM2_PCR_PolicySign_Example(void* userCtx, int argc, char *argv[])
usage();
return 0;
}
if (pcrArraySz >= sizeof(pcrArray) / sizeof(pcrArray[0])) {
printf("Too many -pcr= arguments (max %zu)\n",
sizeof(pcrArray) / sizeof(pcrArray[0]));
usage();
return 0;
}
pcrArray[pcrArraySz] = pcrIndex;
pcrArraySz++;
}
Expand Down
6 changes: 6 additions & 0 deletions examples/tls/tls_client_notpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ int TLS_ClientArgs(int argc, char *argv[])
ca_cert_der_2048, sizeof_ca_cert_der_2048,
WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
printf("Error loading ca_cert_der_2048 DER cert\n");
rc = WOLFSSL_FATAL_ERROR;
goto exit;
}
#elif defined(HAVE_ECC)
if (wolfSSL_CTX_load_verify_buffer(ctx,
ca_ecc_cert_der_256, sizeof_ca_ecc_cert_der_256,
WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
printf("Error loading ca_ecc_cert_der_256 DER cert\n");
rc = WOLFSSL_FATAL_ERROR;
goto exit;
}
#endif
Expand All @@ -149,22 +151,26 @@ int TLS_ClientArgs(int argc, char *argv[])
if (wolfSSL_CTX_use_certificate_buffer(ctx,
client_cert_der_2048, sizeof_client_cert_der_2048,
WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
rc = WOLFSSL_FATAL_ERROR;
goto exit;
}
if (wolfSSL_CTX_use_PrivateKey_buffer(ctx,
client_key_der_2048, sizeof_client_key_der_2048,
WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
rc = WOLFSSL_FATAL_ERROR;
goto exit;
}
#elif defined(HAVE_ECC)
if (wolfSSL_CTX_use_certificate_buffer(ctx,
cliecc_cert_der_256, sizeof_cliecc_cert_der_256,
WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
rc = WOLFSSL_FATAL_ERROR;
goto exit;
}
if (wolfSSL_CTX_use_PrivateKey_buffer(ctx,
ecc_clikey_der_256, sizeof_ecc_clikey_der_256,
WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
rc = WOLFSSL_FATAL_ERROR;
goto exit;
}
#endif
Expand Down
55 changes: 43 additions & 12 deletions src/fwtpm/fwtpm_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -4630,6 +4630,7 @@ static TPM_RC FwCmd_LoadExternal(FWTPM_CTX* ctx, TPM2_Packet* cmd,
FWTPM_FREE_BUF(qBuf);
TPM2_ForceZero(privKeyDer, FWTPM_MAX_PRIVKEY_DER);
FWTPM_FREE_BUF(privKeyDer);
TPM2_ForceZero(&authValue, sizeof(authValue));
return rc;
}

Expand Down Expand Up @@ -5024,6 +5025,8 @@ static TPM_RC FwCmd_Import(FWTPM_CTX* ctx, TPM2_Packet* cmd,
TPM2_ForceZero(seedBuf, sizeof(seedBuf));
TPM2_ForceZero(aesKey, sizeof(aesKey));
TPM2_ForceZero(hmacKeyBuf, sizeof(hmacKeyBuf));
TPM2_ForceZero(encKeyBuf, sizeof(encKeyBuf));
TPM2_ForceZero(&importedAuth, sizeof(importedAuth));
FWTPM_FREE_BUF(dupBuf);
FWTPM_FREE_BUF(symSeedBuf);
TPM2_ForceZero(privKeyDer, FWTPM_MAX_PRIVKEY_DER);
Expand Down Expand Up @@ -6087,6 +6090,16 @@ static TPM_RC FwCmd_Sign(FWTPM_CTX* ctx, TPM2_Packet* cmd,
if (!(obj->pub.objectAttributes & TPMA_OBJECT_sign))
rc = TPM_RC_KEY;
}
/* Part 3 Sec.20.5.1: keyHandle MUST NOT have x509sign SET on
* TPM2_Sign; that attribute restricts the key to X.509-cert signing
* via the dedicated commands. Reject with TPM_RC_ATTRIBUTES to match
* the gate already present in FwCmd_SignDigest and
* FwCmd_SignSequenceComplete. The attribute itself is v1.85-only. */
#ifdef WOLFTPM_V185
if (rc == 0 && (obj->pub.objectAttributes & TPMA_OBJECT_x509sign)) {
rc = TPM_RC_ATTRIBUTES;
}
#endif

/* Skip auth area */
if (rc == 0 && cmdTag == TPM_ST_SESSIONS) {
Expand Down Expand Up @@ -6185,14 +6198,20 @@ static TPM_RC FwCmd_Sign(FWTPM_CTX* ctx, TPM2_Packet* cmd,
}
}
if (rc == 0 && ticketSupplied) {
rc = FwComputeTicketHmac(ctx, ticketHier, obj->pub.nameAlg,
int hmacRc;
UINT16 sizeMismatch;
word32 cmpLen;
int diff;
hmacRc = FwComputeTicketHmac(ctx, ticketHier, obj->pub.nameAlg,
TPM_ST_HASHCHECK,
digest.buffer, digest.size,
NULL, 0,
expectedHmac, &expectedSz);
if (rc != 0 || vdSz != (UINT16)expectedSz ||
TPM2_ConstantCompare(ticketDigest, expectedHmac,
(word32)expectedSz) != 0) {
sizeMismatch = (vdSz != (UINT16)expectedSz);
cmpLen = (vdSz < (UINT16)expectedSz) ?
(word32)vdSz : (word32)expectedSz;
diff = TPM2_ConstantCompare(ticketDigest, expectedHmac, cmpLen);
if (hmacRc != 0 || (sizeMismatch | (UINT16)(diff != 0))) {
Comment thread
aidangarske marked this conversation as resolved.
rc = TPM_RC_TICKET;
}
TPM2_ForceZero(expectedHmac, sizeof(expectedHmac));
Expand Down Expand Up @@ -10752,6 +10771,10 @@ static TPM_RC FwCmd_NV_Write(FWTPM_CTX* ctx, TPM2_Packet* cmd,
FwRspNoParams(rsp, cmdTag);
}

#ifdef WOLFTPM_SMALL_STACK
if (dataBuf != NULL)
#endif
TPM2_ForceZero(dataBuf, FWTPM_MAX_NV_DATA);
FWTPM_FREE_BUF(dataBuf);
return rc;
}
Expand Down Expand Up @@ -11997,14 +12020,22 @@ static TPM_RC FwCmd_CertifyCreation(FWTPM_CTX* ctx, TPM2_Packet* cmd,
objToSign->name.size);
ticketDataSz += objToSign->name.size;

if (FwComputeTicketHmac(ctx, hier, objToSign->pub.nameAlg,
TPM_ST_CREATION,
ticketData, ticketDataSz,
NULL, 0,
expectedHmac, &expectedSz) != 0 ||
tickDSz != (UINT16)expectedSz ||
TPM2_ConstantCompare(ticketDigest, expectedHmac,
(word32)expectedSz) != 0) {
int hmacRc;
UINT16 sizeMismatch;
word32 cmpLen;
int diff;
hmacRc = FwComputeTicketHmac(ctx, hier,
objToSign->pub.nameAlg,
TPM_ST_CREATION,
ticketData, ticketDataSz,
NULL, 0,
expectedHmac, &expectedSz);
sizeMismatch = (tickDSz != (UINT16)expectedSz);
cmpLen = (tickDSz < (UINT16)expectedSz) ?
(word32)tickDSz : (word32)expectedSz;
diff = TPM2_ConstantCompare(ticketDigest, expectedHmac,
cmpLen);
if (hmacRc != 0 || (sizeMismatch | (UINT16)(diff != 0))) {
Comment thread
aidangarske marked this conversation as resolved.
rc = TPM_RC_TICKET;
}
TPM2_ForceZero(expectedHmac, sizeof(expectedHmac));
Expand Down
24 changes: 14 additions & 10 deletions src/fwtpm/fwtpm_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,13 +1209,15 @@ TPM_RC FwEncapsulateEcdhDhkem(WC_RNG* rng,
if (wc_ecc_shared_secret(ephKey, recipKey, dh, &dhSz) != 0)
rc = TPM_RC_FAILURE;
}
/* RFC 9180 Sec.7: left-pad X to Nsk for HPKE peer interop. */
/* RFC 9180 Sec.7: left-pad X to Nsk for HPKE peer interop. The
* dhSz <= nSk guard prevents a defensive truncation if
* wc_ecc_shared_secret ever returned more bytes than the curve size. */
if (rc == 0) {
int nSk = wc_ecc_get_curve_size_from_id(wcCurve);
if (nSk > 0 && (word32)nSk > dhSz &&
(word32)nSk <= sizeof(dh)) {
XMEMMOVE(dh + (nSk - dhSz), dh, dhSz);
XMEMSET(dh, 0, nSk - dhSz);
if (nSk > 0 && (word32)nSk <= sizeof(dh) && dhSz <= (word32)nSk) {
word32 padLen = (word32)nSk - dhSz;
XMEMMOVE(dh + padLen, dh, dhSz);
XMEMSET(dh, 0, padLen);
dhSz = (word32)nSk;
}
}
Expand Down Expand Up @@ -1317,13 +1319,15 @@ TPM_RC FwDecapsulateEcdhDhkem(WC_RNG* rng, const FWTPM_Object* recipObj,
if (wc_ecc_shared_secret(recipKey, ephKey, dh, &dhSz) != 0)
rc = TPM_RC_FAILURE;
}
/* Left-pad X to Nsk per RFC 9180 Sec.7 (mirrors Encap). */
/* Left-pad X to Nsk per RFC 9180 Sec.7 (mirrors Encap). The
* dhSz <= nSk guard prevents a defensive truncation if
* wc_ecc_shared_secret ever returned more bytes than the curve size. */
if (rc == 0) {
int nSk = wc_ecc_get_curve_size_from_id(wcCurve);
if (nSk > 0 && (word32)nSk > dhSz &&
(word32)nSk <= sizeof(dh)) {
XMEMMOVE(dh + (nSk - dhSz), dh, dhSz);
XMEMSET(dh, 0, nSk - dhSz);
if (nSk > 0 && (word32)nSk <= sizeof(dh) && dhSz <= (word32)nSk) {
word32 padLen = (word32)nSk - dhSz;
XMEMMOVE(dh + padLen, dh, dhSz);
XMEMSET(dh, 0, padLen);
dhSz = (word32)nSk;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/spdm/spdm_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ int wolfSPDM_ParseKeyExchangeRsp(WOLFSPDM_CTX* ctx, const byte* buf, word32 bufS
}
if (rc == WOLFSPDM_SUCCESS) {
word32 i;
int diff = 0;
volatile int diff = 0;
for (i = 0; i < WOLFSPDM_HASH_SIZE; i++) {
diff |= expectedHmac[i] ^ rspVerifyData[i];
}
Expand Down
2 changes: 1 addition & 1 deletion src/spdm/spdm_psk.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int wolfSPDM_ParsePskExchangeRsp(WOLFSPDM_CTX* ctx, const byte* buf,
}
if (rc == WOLFSPDM_SUCCESS) {
word32 i;
int diff = 0;
volatile int diff = 0;
wolfSPDM_DebugHex(ctx, "Expected HMAC", expectedHmac,
WOLFSPDM_HASH_SIZE);
wolfSPDM_DebugHex(ctx, "Received HMAC", rspVerifyData,
Expand Down
14 changes: 14 additions & 0 deletions src/tpm2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6964,6 +6964,20 @@ TPM_ALG_ID TPM2_GetAlgId(const char* name)
return TPM_ALG_CFB;
if (!XSTRCMP(name, "AES-ECB"))
return TPM_ALG_ECB;
if (!XSTRCMP(name, "SHA3_256"))
return TPM_ALG_SHA3_256;
if (!XSTRCMP(name, "SHA3_384"))
return TPM_ALG_SHA3_384;
if (!XSTRCMP(name, "SHA3_512"))
return TPM_ALG_SHA3_512;
#ifdef WOLFTPM_V185
if (!XSTRCMP(name, "ML-KEM"))
return TPM_ALG_MLKEM;
if (!XSTRCMP(name, "ML-DSA"))
return TPM_ALG_MLDSA;
if (!XSTRCMP(name, "HashML-DSA"))
return TPM_ALG_HASH_MLDSA;
#endif

return TPM_ALG_ERROR;
}
Expand Down
Loading
Loading