From: Bob Halley Date: Tue, 23 Jun 2009 17:23:46 +0000 (+0100) Subject: Open /dev/random unbuffered X-Git-Tag: v1.8.0~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd9547c33612e6992c598b61359dfe46a0f56ab6;p=thirdparty%2Fdnspython.git Open /dev/random unbuffered --- diff --git a/ChangeLog b/ChangeLog index c9778bb4..534d74b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-23 Bob Halley + + * dns/entropy.py (EntropyPool.__init__): open /dev/random unbuffered; + there's no need to consume more randomness than we need. Thanks + to Brian Wellington for the patch. + 2009-06-19 Bob Halley * (Version 1.7.1 released) diff --git a/dns/entropy.py b/dns/entropy.py index ecbb48da..83262f4e 100644 --- a/dns/entropy.py +++ b/dns/entropy.py @@ -22,7 +22,7 @@ class EntropyPool(object): self.next_byte = 0 if seed is None: try: - r = file('/dev/random') + r = file('/dev/random', 'r', 0) try: seed = r.read(16) finally: