-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
DkimVerifier report both header and body result seperatly #601
Conversation
The problem with this is that it changes/breaks the API :-\ |
Yeah, would adding a method (under the current name) to maintain the existing interface be better? so you could have |
Yea, I was thinking along those lines - I just haven't come up with a good method name either. Another option I was thinking about was just making the core private method protected instead, but I hate exposing the The other thing that I was thinking was to modify the internal core method (the internal I really hate that the ArcVerifier returns an ArcValidationResult and that DKIM is already inconsistent and will be even more inconsistent with any change made here. I'm thinking I'd rather hold off on this until a "MimeKit 3.0" which would give me an excuse to break API. |
Would a cleaner temporary solution be to add 2 extra methods VeryBodyAsync and VerifyHeadersAsync? They could even be protected methods such that the VerifyAsync method just returns |
Pushed logic to verify the body hash and signature into DkimVerifierBase and made them protected methods to allow access to subclasses. Fixes issue #601
I added 2 new methods to DkimVerifierBase for verifying the body hash and the signature. |
Unless im missing something do ParseParameterTags and ValidateDkimSignatureParameters need to be protected as well so i can implement my own method like:
|
Ugh, I was hoping to keep those as an implementation detail since the APIs are kinda gross. |
Can you just copy & paste those 2 methods into your custom class? Exposing those methods traps me into never being able to change/refactor them. |
Yeah sure, thanks for the help. |
When verifying dkim in our use case it is useful to be able to tell if the header check failed or the body check failed (as opposed to currently where you just know that one of them failed).
So instead of the DkimVerifier Verify/VerifyAsync returning a bool they now return a DkimValidationResult with 2 property's: BodySignatureValid true if the body portion of the dkim check passes and HeaderSignatureValid true if the header portion passes. Dkim should only be considered to pass if both are true. I toyed with adding an extra property along the lines of
public bool VerificationResult => HeaderSignatureValid && BodySignatureValid;
but did not in the end.