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

Improve tolerance for dirauths with skewed clocks #84

Merged
merged 7 commits into from
May 11, 2018

Conversation

tlyu
Copy link
Contributor

@tlyu tlyu commented May 4, 2018

@coveralls
Copy link

coveralls commented May 4, 2018

Coverage Status

Coverage increased (+0.02%) to 59.396% when pulling de343b4 on tlyu:bug25756 into 6bfa87d on torproject:master.

tlyu added 7 commits May 8, 2018 17:59
construct_consensus() in test_routerlist.c created votes using a
timestamp from time().  Tests that called construct_consensus() might
have nondeterministic results if they rely on time() not changing too
much on two successive calls.

Neither existing of the two existing tests that calls
construct_consensus is likely to have a failure due to this problem.
Factor out the early consensus warning code from
networkstatus_set_current_consensus() into a new function
warn_early_consensus().
Remove one level of indentation by returning early from the function.
Previously, an authority with a clock more than 60 seconds ahead could
cause a client with a correct clock to warn that the client's clock
was behind.  Now the clocks of a majority of directory authorities
have to be ahead of the client before this warning will occur.

Relax the early-consensus check so that a client's clock must be 60
seconds behind the earliest time that a given sufficiently-signed
consensus could possibly be available.

Add a new unit test that calls warn_early_consensus() directly.

Fixes bug 25756; bugfix on 0.2.2.25-alpha.
@tlyu tlyu force-pushed the bug25756 branch 3 times, most recently from 105d8e6 to de343b4 Compare May 9, 2018 02:30
@isislovecruft isislovecruft self-requested a review May 11, 2018 19:03
Copy link
Contributor

@isislovecruft isislovecruft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for writing well-documented code and really clean tests.

@tor-bot tor-bot merged commit de343b4 into torproject:master May 11, 2018
@tlyu tlyu deleted the bug25756 branch May 12, 2018 00:47
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.

4 participants