[tor-bugs] #13696 [Tor]: Use syscall-based entropy reading where possible.

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Nov 26 23:18:21 UTC 2015


#13696: Use syscall-based entropy reading where possible.
-------------------------+--------------------------------
 Reporter:  nickm        |          Owner:  yawning
     Type:  enhancement  |         Status:  needs_revision
 Priority:  Medium       |      Milestone:  Tor: 0.2.???
Component:  Tor          |        Version:
 Severity:  Normal       |     Resolution:
 Keywords:  tor-relay    |  Actual Points:
Parent ID:               |         Points:
  Sponsor:               |
-------------------------+--------------------------------

Comment (by teor):

 Replying to [comment:7 teor]:
 > OS X has CCRandomGenerateBytes in CommonCrypto/CommonRandom.h, I would
 be happy to submit a patch...
 Replying to [comment:8 nickm]:
 > On top of Yawning's branch would be fine.

 It's pointless, CCRandomGenerateBytes eventually uses ccrng_system.c,
 which starts with the comment:
 {{{
 /* A very simple RNG for osx/ios user mode that just get random bytes from
 /dev/random */
 }}}

 The non-file-based read_random function is only available in OS X / iOS
 kernel-space.

 I can't see the point of calling a system call that wraps /dev/random.
 We'd just be reducing performance, and exposing ourselves to any security
 issues in the wrappers.

 However, it looks like iOS might not be able to read /dev/random directly,
 I'll check with an iOS dev.
 https://developer.apple.com/library/ios/documentation/Security/Reference/RandomizationReference/index.html#//apple_ref/c/func/SecRandomCopyBytes

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


More information about the tor-bugs mailing list