PKCS7: decode detached SignedData in d2i_PKCS7 - #11374
Open
kojo1 wants to merge 2 commits into
Open
Conversation
|
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.
Description
wolfSSL_d2i_PKCS7() verified the signature while decoding, so a
detached SignedData - one whose content is not in the bundle - could
never be decoded through the OpenSSL compatibility layer. OpenSSL's
d2i_PKCS7() only decodes; the content is handed to PKCS7_verify()
afterwards.
Add wc_PKCS7_DecodeSignedData(). It parses certificates, signerInfo
and content type like wc_PKCS7_VerifySignedData() and verifies an
attached bundle as before. A detached bundle without content is only
parsed: pkcs7->detached is set and the signature is left for a later
wc_PKCS7_VerifySignedData() call with the content. The existing state
machine is reused with a parseOnly argument; no structure change.
Fixes zd#22345
Testing
Added test cases:
test_wc_PKCS7_DecodeSignedData
test_wolfSSL_PKCS7_d2i_detached
Checklist