Add support for verifying S/MIME messages#12267
Open
Conversation
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.
As promised in #11555, I'm opening this PR with an initial implementation of S/MIME verification, in order to better discuss the API design, and to start the reviews while I finish some other features.
Namely, the new
pkcs7_verifyfunctions do not handle the certificate verification feature as of now. It as similar to aopenssl smime -verifywith the-noverifyflag, to verify the signature but not the certificates (similar to what #12116 needs). Can you point me towards some existing code verifying X.509 certificates, if some exists?Also, I have one question about the
certificateparameter in the functions: should we verify against one certificates? Multiple ones? All the ones that are stored in the signature (if any)?My essential thoughts for testing were to do the round-trip: signature using the
PKCS7SignatureBuilderand verifying using thepkcs_decryptfunctions. For now, I've not replaced thetest_support.pkcs7_verifyfunction, but I'm planning to do so as soon as the certificate verification feature is developed.I'm still new to rust, so please let me know if you see some issues in variable lifetime, or some unnecessary copying between Python & Rust.
cc @alex