[Python-modules-commits] r14742 - in packages/python-keyczar/trunk/debian (4 files)
lfaraone at users.alioth.debian.org
lfaraone at users.alioth.debian.org
Sun Oct 24 19:35:45 UTC 2010
Date: Sunday, October 24, 2010 @ 19:35:36
Author: lfaraone
Revision: 14742
* debian/patches:
- Remove 0001-workaround-deprecated-interface
This patch did not work with older versions of PyCrypto. Closes: #601264
- Added 0001-use-os-urandom-for-entropy
This cherry-picked patch uses os.urandom() directly for entropy.
Added:
packages/python-keyczar/trunk/debian/patches/0001-use-os-urandom-for-entropy.patch
Modified:
packages/python-keyczar/trunk/debian/changelog
packages/python-keyczar/trunk/debian/patches/series
Deleted:
packages/python-keyczar/trunk/debian/patches/0001-workaround-deprecated-interface.patch
Modified: packages/python-keyczar/trunk/debian/changelog
===================================================================
--- packages/python-keyczar/trunk/debian/changelog 2010-10-24 18:28:46 UTC (rev 14741)
+++ packages/python-keyczar/trunk/debian/changelog 2010-10-24 19:35:36 UTC (rev 14742)
@@ -8,8 +8,13 @@
* debian/rules:
- Handle cases when Python 2.5 is not used during build. Fixes FTBFS when
running tests. Closes: #601259
+ * debian/patches:
+ - Remove 0001-workaround-deprecated-interface
+ This patch did not work with older versions of PyCrypto. Closes: #601264
+ - Added 0001-use-os-urandom-for-entropy
+ This cherry-picked patch uses os.urandom() directly for entropy.
- -- Luke Faraone <lfaraone at debian.org> Sun, 24 Oct 2010 14:21:58 -0400
+ -- Luke Faraone <lfaraone at debian.org> Sun, 24 Oct 2010 14:43:50 -0400
python-keyczar (0.6~b.061709-2) unstable; urgency=low
Added: packages/python-keyczar/trunk/debian/patches/0001-use-os-urandom-for-entropy.patch
===================================================================
--- packages/python-keyczar/trunk/debian/patches/0001-use-os-urandom-for-entropy.patch (rev 0)
+++ packages/python-keyczar/trunk/debian/patches/0001-use-os-urandom-for-entropy.patch 2010-10-24 19:35:36 UTC (rev 14742)
@@ -0,0 +1,40 @@
+Description: Use os.urandom() to get random bytes.
+
+For gathering random data, python-keyczar uses a PyCrypto module that has been
+deprecated recently in favor of a newer solution. To this end, the old
+PyCrypto interface now a wrapper around the new solution with the addition
+that it emits a DeprecationWarning.
+
+After discussion upstream, it was decided to use os.urandom() over a PyCrypto-
+specific solution for simplicity.
+
+Origin: upstream http://code.google.com/p/keyczar/source/detail?r=473
+Bug: http://code.google.com/p/keyczar/issues/detail?id=59
+
+--- a/src/keyczar/util.py
++++ b/src/keyczar/util.py
+@@ -22,13 +22,13 @@
+
+ import base64
+ import math
++import os
+ try:
+ # Import hashlib if Python >= 2.5
+ from hashlib import sha1
+ except ImportError:
+ from sha import sha as sha1
+
+-from Crypto.Util import randpool
+ from pyasn1.codec.der import decoder
+ from pyasn1.codec.der import encoder
+ from pyasn1.type import univ
+@@ -279,7 +279,8 @@
+
+ def RandBytes(n):
+ """Return n random bytes."""
+- return randpool.RandomPool(512).get_bytes(n)
++ # This function requires at least Python 2.4.
++ return os.urandom(n)
+
+ def Hash(*inputs):
+ """Return a SHA-1 hash over a variable number of inputs."""
Deleted: packages/python-keyczar/trunk/debian/patches/0001-workaround-deprecated-interface.patch
===================================================================
--- packages/python-keyczar/trunk/debian/patches/0001-workaround-deprecated-interface.patch 2010-10-24 18:28:46 UTC (rev 14741)
+++ packages/python-keyczar/trunk/debian/patches/0001-workaround-deprecated-interface.patch 2010-10-24 19:35:36 UTC (rev 14742)
@@ -1,38 +0,0 @@
-From: Christian Kastner <debian at kvr.at>
-Date: Fri, 16 Jul 2010 16:37:12 +0200
-Subject: [PATCH] Work around deprecated PyCrypto interface
-
-For gathering random data, python-keyczar uses a PyCrypto module that has been
-deprecated recently in favor of a newer solution. To this end, the old
-PyCrypto interface now a wrapper around the new solution with the addition
-that it emits a DeprecationWarning.
-
-While there is still debate going on whether to use PyCrypto at all for this
-task or to rely on lower-level OS interfaces, this patch will get rid of the
-DeprecationWarning by switching to the new interface.
-
-Bug: http://code.google.com/p/keyczar/issues/detail?id=59
-Last-Update: 2010-07-16
-
-Index: python-keyczar-0.6~b.061709/src/keyczar/util.py
-===================================================================
---- python-keyczar-0.6~b.061709.orig/src/keyczar/util.py 2010-07-16 13:09:07.561503218 +0200
-+++ python-keyczar-0.6~b.061709/src/keyczar/util.py 2010-07-16 13:09:54.645507131 +0200
-@@ -28,7 +28,7 @@
- except ImportError:
- from sha import sha as sha1
-
--from Crypto.Util import randpool
-+from Crypto import Random
- from pyasn1.codec.der import decoder
- from pyasn1.codec.der import encoder
- from pyasn1.type import univ
-@@ -279,7 +279,7 @@
-
- def RandBytes(n):
- """Return n random bytes."""
-- return randpool.RandomPool(512).get_bytes(n)
-+ return Random.new().read(n)
-
- def Hash(*inputs):
- """Return a SHA-1 hash over a variable number of inputs."""
Modified: packages/python-keyczar/trunk/debian/patches/series
===================================================================
--- packages/python-keyczar/trunk/debian/patches/series 2010-10-24 18:28:46 UTC (rev 14741)
+++ packages/python-keyczar/trunk/debian/patches/series 2010-10-24 19:35:36 UTC (rev 14742)
@@ -1 +1 @@
-0001-workaround-deprecated-interface.patch
+0001-use-os-urandom-for-entropy.patch
More information about the Python-modules-commits
mailing list