]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Open /dev/random unbuffered
authorBob Halley <halley@nominum.com>
Tue, 23 Jun 2009 17:23:46 +0000 (18:23 +0100)
committerBob Halley <halley@nominum.com>
Tue, 23 Jun 2009 17:23:46 +0000 (18:23 +0100)
ChangeLog
dns/entropy.py

index c9778bb44323da2ca83e6fcb39935641d702f525..534d74b38ce5c49ad8aecdcd28e1fa7253ecc6f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-23  Bob Halley  <halley@dnspython.org>
+
+       * 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  <halley@dnspython.org>
 
        * (Version 1.7.1 released)
index ecbb48dac5bdf0ab6d1db315218894d130368a4f..83262f4e19e1bdeb762cbcd52980ffacb882c9af 100644 (file)
@@ -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: