-
Notifications
You must be signed in to change notification settings - Fork 39
Add clock drift tolerance to signature validation #28
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
Conversation
chibenwa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution.
A clock drift tolerence of 5 minutes being the operational norm (OpenDKIM default) this contribution is welcome but I would personally love to have this configurable.
|
I do think the tolerated clock drift can be a field of the verifier. |
|
CF https://issues.apache.org/jira/browse/JDKIM-49 I can squash this upon merge to get the issue number into the commit message. |
After I pushed the PR I saw the other PR with API change proposal, I tought a setter would not be welcome, but it was the my first solution and it is what I'm running in my mail server. I agree with it, but I think instead of throwing an exception in the setter we could just keep it with the default value when parameter is negative. |
b4e3038 to
07a9ffb
Compare
|
Updated commit message |
|
If mutability is an issue we can make the field final and have a field in DkimVerifier that does a copy of it and update that only field. Regarding API proposed in #27 I think we would be able to easily add that useful feature in it. Thoughts? |
I don't see a problem with mutability with this configuration alone, I suggested to remove the exception just to avoid a runtime error if there's some weird bug on the user side, I prefer to throw exceptions in the constructor to avoid weird object states if more features are added. Looking to just this config, I'm fine with both solutions. In the future if more configuration options are needed, maybe an Options class containing parameters could be added to a second constructor in DKIMVerifier. EDIT: something like this |
|
Let me know what is more aligned with your view of the possible API changes and I will update this PR. |
This looks great to me 👍 |
Avoids signature validation failures when clock drift is lower than the threshold.
07a9ffb to
4601cf9
Compare
|
I kept |
chibenwa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
I will wait 1 day or 2 to let the chance others to review before I merge this, but it looks perfect as is.
Arsnael
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for this work @epinter !
|
Thanks @epinter for this very nice contribution and everyone for the review! |
Avoids signature validation failures when clock drift is lower than the threshold.