Skip to content

Test Mutations, Unit tests, ForceZero Unification, and Fixes for wolfTPM#480

Merged
dgarske merged 37 commits intowolfSSL:masterfrom
aidangarske:fenrir-fixes-5
Apr 15, 2026
Merged

Test Mutations, Unit tests, ForceZero Unification, and Fixes for wolfTPM#480
dgarske merged 37 commits intowolfSSL:masterfrom
aidangarske:fenrir-fixes-5

Conversation

@aidangarske
Copy link
Copy Markdown
Member

F-2944, F-2946, F-2951, F-2952, F-2953, F-2954, F-2955, F-2958, F-2959, F-2504, F-2505, F-2517, F-2531, 
F-2960, F-2956, F-2523, F-2524, F-2525, F-2526, F-2528, F-881, F-1228, F-1756, F-1757, F-2160, F-2945, 
F-2961, F-1763, F-2162, F-2163, F-2167, F-2168, F-2966, F-2527, F-2968, F-2970, F-2971

Two passes of skoll review already nothing substantial

…n.digest.size in TPM2_VerifySignature response parsing to prevent heap buffer overflow
…y.size in wolfTPM2_SpdmConnectNuvoton and wolfTPM2_SpdmConnectNations to prevent stack buffer overflow
…SensitiveToPrivate pinning KDFa STORAGE and INTEGRITY labels with test vector
…wolfTPM2_PolicyAuthValue verifying auth placed at authDigestSz offset preserving HMAC key slot
…ors for ATH, SECRET, and DUPLICATE labels pinning TPM 2.0 spec-mandated session key derivation labels

F-2954 - https://fenrir.wolfssl.com/finding/2954 - Add KDFa test vector for SECRET label
F-2955 - https://fenrir.wolfssl.com/finding/2955 - Add KDFa test vector for DUPLICATE label
…wolfTPM2_SetAuthHandle policyAuth branch verifying auth placed at authDigestSz offset

F-2959 - https://fenrir.wolfssl.com/finding/2959 - Add unit test for wolfTPM2_SetAuthHandleName policyAuth branch verifying auth placed at authDigestSz offset
…adding in wolfTPM2_CreatePrimaryKey_ex to pass auth as-is matching wolfTPM2_CreateKey behavior
…stead of silently truncating auth values in wolfTPM2_SetAuth, wolfTPM2_CreateKey, wolfTPM2_ChangeAuthKey, wolfTPM2_SetAuthHandleName, wolfTPM2_CreatePrimaryKey_ex, wolfTPM2_CreateLoadedKey, and wolfTPM2_PolicyPassword
…match check outside DEBUG_WOLFTPM guard so it executes in all builds
…for count and sizeofSelect in TPM2_Packet_AppendPCR matching parse-side validation
…pendSymmetric in TPM2_Duplicate to correctly handle TPM_ALG_NULL and TPM_ALG_XOR symmetric algorithms
…yHash boundary check from cc > TPM_CC_FIRST to cc >= TPM_CC_FIRST and add unit test covering cc=0, cc=TPM_CC_FIRST, and cc=TPM_CC_PolicyPCR
…V auth password in wolfTPM2_NVCreateAuthPolicy on all exit paths
…V write data buffer in wolfTPM2_NVWriteData before return
…V read output buffer in wolfTPM2_NVReadAuthPolicy before return
…ymmetric seed in wolfTPM2_ImportPrivateKey on all exit paths
…uth password in wolfTPM2_CreateLoadedKey on all exit path
… redundant alreadyExists check in wolfTPM2_NVCreateAuthPolicy
…efore accessing BIT STRING content in TPM2_ASN_DecodeX509Cert to prevent OOB read on zero-length fields
… parent parameter in wolfTPM2_NVCreateAuthPolicy to prevent NULL pointer dereference
… of TPM2_GetName return codes with sequential error checking in TPM2_CommandProcess
…aller size in XMEMCPY in wolfTPM2_StartSession instead of original unclamped value
…heck before serializing inScheme details in TPM2_Certify, TPM2_CertifyCreation, TPM2_Quote, TPM2_GetSessionAuditDigest, TPM2_GetCommandAuditDigest, TPM2_GetTime, and TPM2_NV_Certify
…pendSymmetric and TPM2_Packet_ParseSymmetric for SYMCIPHER case in AppendPublicParms and ParsePublicParms
…erived identity auth digest in wolfTPM2_SetIdentityAuth before return
…ew auth password in wolfTPM2_ChangeAuthKey on all exit paths
…ocal keyBlob in wolfTPM2_LoadRsaPrivateKey_ex, wolfTPM2_LoadEccPrivateKey, and wolfTPM2_CreateAndLoadKey
…uth password in wolfTPM2_CreateKey on all exit paths
…uth password in wolfTPM2_CreatePrimaryKey_ex on all exit paths
…CC private key in wolfTPM2_SpdmConnectNations error path after wc_ecc_export_public_raw failure
…SS padded buffer in wolfTPM2_PK_RsaPssSign before scope exit
…uth in wolfTPM2_HmacStart on all exit paths
…ey material at early return in wolfTPM2_LoadKeyedHashKey
…ession auth in wolfTPM2_UnloadHandles before return

This comment was marked as resolved.

wolfSSL-Fenrir-bot

This comment was marked as outdated.

@aidangarske aidangarske marked this pull request as ready for review April 14, 2026 21:31
@aidangarske aidangarske requested review from Copilot and dgarske and removed request for Copilot April 14, 2026 21:31
Comment thread src/tpm2_wrap.c
Comment thread tests/unit_tests.c Outdated
Comment thread tests/unit_tests.c Outdated
@dgarske dgarske removed their assignment Apr 14, 2026
…padding in wolfTPM2_CreatePrimaryKey_ex and add matching padding to wolfTPM2_CreateKey and wolfTPM2_CreateLoadedKey for consistent auth handling
@aidangarske aidangarske requested review from Copilot and removed request for Copilot April 14, 2026 22:37
@aidangarske aidangarske requested review from Copilot and dgarske and removed request for Copilot April 14, 2026 22:48
@dgarske dgarske merged commit 4556395 into wolfSSL:master Apr 15, 2026
86 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants