Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust PKCS7_VerifySignedData to correctly verify precomputed content hash with detached signature #3996

Merged
merged 2 commits into from Nov 30, 2021

Conversation

cconlon
Copy link
Member

@cconlon cconlon commented Apr 29, 2021

This PR adjusts the PKCS7_VerifySignedData() function in pkcs7.c to correctly verify a SignedData detached signature bundle where the user passes in a pre-computed content message digest into wc_PKCS7_VerifySignedData_ex().

There are two options for users verifying a detached PKCS7 SignedData signature. They can set pkcs7->content and pkcs7->contentSz before calling wc_PKCS7_VerifySignedData(), and wolfSSL will compute the content message digest internally. Or, for users who do not have the entire content up front, they can create the content message digest on their own and pass that to wc_PKCS7_VerifySignedData_ex(). This fixes the later use case.

@JacobBarthelmeh
Copy link
Contributor

I see we have some wc_PKCS7_VerifySignedData_ex tests in tests/api.c. If the test case is succeeding without this change do we need to make some updates to what we are testing or add an additional test to avoid regressions?

@cconlon
Copy link
Member Author

cconlon commented Oct 26, 2021

@JacobBarthelmeh test added, ready for review

@cconlon cconlon assigned JacobBarthelmeh and unassigned cconlon Oct 26, 2021
@JacobBarthelmeh JacobBarthelmeh merged commit b69a1c8 into wolfSSL:master Nov 30, 2021
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.

None yet

2 participants