[tor-bugs] #17795 [Tor]: Refactor usage of digests_t, crypto_digest_all, etc.

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Feb 6 01:43:15 UTC 2016

#17795: Refactor usage of digests_t, crypto_digest_all, etc.
 Reporter:  nickm   |          Owner:  nickm
     Type:  defect  |         Status:  needs_revision
 Priority:  Medium  |      Milestone:  Tor: 0.2.8.x-final
Component:  Tor     |        Version:
 Severity:  Normal  |     Resolution:
 Keywords:          |  Actual Points:
Parent ID:          |         Points:
  Sponsor:          |
Changes (by mikeperry):

 * status:  needs_review => needs_revision


 While currently correct, this seems weird and hacky to me. At the very
 minimum, the comment on crypto_digest_all is now wrong. I also don't like
 leaving the loop there for only 1 hash (SHA256). Seems
 confusing/misleading. There's now also deliberate deadcode with an assert.

 I think we should re-name this function to something like
 crypto_digest_common, make it really clear it only does the two hashes
 (ie: kill that loop), and fix its comment. It's not used in very many
 places anyway.

 Later, we can create a digests_all_t and a real crypto_digest_all() that
 does all the things, if we still need that.

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

More information about the tor-bugs mailing list