summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/attachments/20120120/7b674eb6/attachment.diff
blob: 55a037a213d30635b5a590fdedea1bd5cd3f4e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/lib/Crypto/Random/OSRNG/posix.py b/lib/Crypto/Random/OSRNG/posix.py
index f88cd77..4661708 100644
--- a/lib/Crypto/Random/OSRNG/posix.py
+++ b/lib/Crypto/Random/OSRNG/posix.py
@@ -54,7 +54,10 @@ class DevURandomRNG(BaseRNG):
         self.__file.close()
 
     def _read(self, N):
-        return self.__file.read(N)
+        data = self.__file.read(N)
+        while len(data) < N:
+            data += self.__file.read(N - len(data))
+        return data
 
 def new(*args, **kwargs):
     return DevURandomRNG(*args, **kwargs)