Repository navigation
Conversation
…size FwSignDigestAndAppend and FwVerifySignatureCore sized their PKCS#1 v1.5 DigestInfo buffers as WC_MAX_DIGEST_SIZE + MAX_ENCODED_DIG_ASN_SZ, which leaves out the outer SEQUENCE and the AlgorithmIdentifier. A SHA-512 DigestInfo is 83 bytes. Size both buffers with MAX_DER_DIGEST_SZ, the constant wolfCrypt uses for this encoding. - Reject TPM2_Sign with TPM_RC_SIZE when the digest size does not match the resolved scheme hashAlg (Part 3 Sec.20.2.1), matching FwCmd_SignDigest. - examples/pcr/policy_sign: size the DigestInfo buffer with WOLFTPM_MAX_DER_DIGEST_SZ, since older wolfSSL does not export MAX_DER_DIGEST_SZ. - tests: add RSASSA-SHA512 Sign/VerifySignature and Sign digest-size mismatch tests, run the SignDigest RSA roundtrip with SHA-512 too, and move BuildRsa2048SignPrimary out of the WOLFTPM_V185 block so builds without v1.85 can use it.
dgarske
requested changes
Oct 27, 2026
dgarske
approved these changes
Oct 27, 2026
Member
Author
|
Customer has confirmed this fix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Size checking in
FwSignDigestAndAppend,FwVerifySignatureCore, andTPM2_SignFixes ZD22700
Thanks to Alexandre Laroche for submitting this issue and confirming the fix.