[tor-bugs] #20077 [Core Tor/Tor]: Make is_sensitive_dir_purpose and purpose_needs_anonymity consistent

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Oct 11 03:54:55 UTC 2016


#20077: Make is_sensitive_dir_purpose and purpose_needs_anonymity consistent
--------------------------+------------------------------
 Reporter:  teor          |          Owner:
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.2.???
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  refactor      |  Actual Points:
Parent ID:                |         Points:  1
 Reviewer:                |        Sponsor:
--------------------------+------------------------------

Comment (by chelseakomlo):

 See changes here:
 https://github.com/chelseakomlo/tor_patches/commit/c6d0255eebdafe7b635c6c762c8c16a5a45b5a2f

 In doing this ticket, I found that:
 1. The parameter router_purpose for purpose_needs_anonymity did not change
 the logic flow. In every case, unless the dir_purpose matched specific
 cases, the function would return true.

 2. The cases in is_sensitive_dir_purpose are compatible with
 purpose_needs_anonymity, so these two functions could easily be merged.The
 logic is in purpose_needs_anonymity is inverted- purpose_needs_anonymity
 returns true by default, unless in the specified cases, whereas
 is_sensitive_dir_purpose returned false unless certain cases were met.

 3. I struggled to write a clean/simple comment for purpose_needs_anonymity
 is accurate, please review!

 4. I wrote the unit tests to have names which describe their intended
 behavior. In each test, it states the expected behavior, under the given
 condition. However, because of column length, the wording for the test
 names is abbreviated, please let me know if the naming is confusing.

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


More information about the tor-bugs mailing list