Use /dev/urandom to avoid waiting for /dev/random

This commit is contained in:
Bastian Kleineidam 2009-11-21 12:13:49 +01:00
parent fd91ce08fa
commit d404b0b1bb
2 changed files with 6 additions and 1 deletions

View file

@ -4,6 +4,9 @@ Fixes:
- logging: Use default platform encoding instead of hardcoded one
of iso-8859-1.
Closes: SF bug #2770077
- dns: use /dev/urandom instead of /dev/random to get initial seed
on Linux machines since the last one can block indefinitely.
Closes: SF bug #2901667
5.1 "Let the right one in" (released 04.08.2009)

View file

@ -22,7 +22,9 @@ class EntropyPool(object):
self.next_byte = 0
if seed is None:
try:
r = file('/dev/random')
# Note that /dev/random can block indefinitely, so use
# /dev/urandom instead.
r = file('/dev/urandom')
try:
seed = r.read(16)
finally: