[tor-bugs] #27299 [Core Tor/Tor]: hsv3: Clarify timing sources around hsv3 code

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Aug 24 12:49:43 UTC 2018


#27299: hsv3: Clarify timing sources around hsv3 code
------------------------------+------------------------------------------
     Reporter:  asn           |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: unspecified
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  tor-hs hsv3 refactoring easy
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+------------------------------------------
 A big source of bugs and confusions (e.g. #26980, #26930) in the HSv3 code
 stem from the fact that it uses various timing sources to compute time
 periods, SRV, etc. Some parts of the code use `time(NULL)`, others use the
 current consensus valid-after, and others use the voting-schedule.

 The code is currently not clear in which timing source is used in each
 case. As an example, some functions take as input `now` but they only use
 it to get a live consensus to use its valid-after, but that may confuse a
 reader that the `now` is used as the time source (e.g.
 `should_rotate_descriptors()` that caused the #26930 confusion).

 We should try to clarify and improve the function signatures around the
 HSv3 codebase on this regard.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27299>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list