[Python-modules-commits] r20062 - in packages/python-crypto/trunk/debian (3 files)
sramacher-guest at users.alioth.debian.org
sramacher-guest at users.alioth.debian.org
Fri Jan 20 23:15:56 UTC 2012
Date: Friday, January 20, 2012 @ 23:15:54
Author: sramacher-guest
Revision: 20062
debian/patches: add posixread.patch to fix incorrect assumption on data
returned from read. (Closes: #654130)
Added:
packages/python-crypto/trunk/debian/patches/posixread.patch
Modified:
packages/python-crypto/trunk/debian/changelog
packages/python-crypto/trunk/debian/patches/series
Modified: packages/python-crypto/trunk/debian/changelog
===================================================================
--- packages/python-crypto/trunk/debian/changelog 2012-01-20 18:27:18 UTC (rev 20061)
+++ packages/python-crypto/trunk/debian/changelog 2012-01-20 23:15:54 UTC (rev 20062)
@@ -1,3 +1,10 @@
+python-crypto (2.5-2) UNRELEASED; urgency=low
+
+ * debian/patches: add posixread.patch to fix incorrect assumption on data
+ returned from read. (Closes: #654130)
+
+ -- Sebastian Ramacher <s.ramacher at gmx.at> Fri, 20 Jan 2012 17:51:15 +0100
+
python-crypto (2.5-1) unstable; urgency=low
* New upstream release.
Added: packages/python-crypto/trunk/debian/patches/posixread.patch
===================================================================
--- packages/python-crypto/trunk/debian/patches/posixread.patch (rev 0)
+++ packages/python-crypto/trunk/debian/patches/posixread.patch 2012-01-20 23:15:54 UTC (rev 20062)
@@ -0,0 +1,31 @@
+Description: fix incorrect assumption about the data returned from read
+ read may return less data than requested even if there is enough data available
+ to read.
+Author: Sebastian Ramacher <s.ramacher at gmx.at>
+Last-Update: 2012-01-20
+Forwarded: http://lists.dlitz.net/pipermail/pycrypto/2012q1/000546.html
+
+diff --git a/lib/Crypto/Random/OSRNG/posix.py b/lib/Crypto/Random/OSRNG/posix.py
+index f88cd77..234edfe 100644
+--- a/lib/Crypto/Random/OSRNG/posix.py
++++ b/lib/Crypto/Random/OSRNG/posix.py
+@@ -46,7 +46,6 @@ class DevURandomRNG(BaseRNG):
+ raise TypeError("%r is not a character special device" % (self.name,))
+
+ self.__file = f
+- self._read = f.read
+
+ BaseRNG.__init__(self)
+
+@@ -54,7 +53,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)
Property changes on: packages/python-crypto/trunk/debian/patches/posixread.patch
___________________________________________________________________
Added: svn:keywords
+ Id
Modified: packages/python-crypto/trunk/debian/patches/series
===================================================================
--- packages/python-crypto/trunk/debian/patches/series 2012-01-20 18:27:18 UTC (rev 20061)
+++ packages/python-crypto/trunk/debian/patches/series 2012-01-20 23:15:54 UTC (rev 20062)
@@ -1,3 +1,4 @@
dont-drop-g.patch
fix-unresolved-reference-size.patch
fix-epydoc-ignore.patch
+posixread.patch
More information about the Python-modules-commits
mailing list