[Python-modules-commits] r13963 - in packages/python-keyczar/trunk/debian (3 files)

chrisk-guest at users.alioth.debian.org chrisk-guest at users.alioth.debian.org
Fri Jul 16 18:22:13 UTC 2010


    Date: Friday, July 16, 2010 @ 18:22:08
  Author: chrisk-guest
Revision: 13963

Add patch to work around PyCrypto deprecation warning

Added:
  packages/python-keyczar/trunk/debian/patches/
  packages/python-keyczar/trunk/debian/patches/0001-workaround-deprecated-interface.patch
  packages/python-keyczar/trunk/debian/patches/series

Added: packages/python-keyczar/trunk/debian/patches/0001-workaround-deprecated-interface.patch
===================================================================
--- packages/python-keyczar/trunk/debian/patches/0001-workaround-deprecated-interface.patch	                        (rev 0)
+++ packages/python-keyczar/trunk/debian/patches/0001-workaround-deprecated-interface.patch	2010-07-16 18:22:08 UTC (rev 13963)
@@ -0,0 +1,37 @@
+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."""

Added: packages/python-keyczar/trunk/debian/patches/series
===================================================================
--- packages/python-keyczar/trunk/debian/patches/series	                        (rev 0)
+++ packages/python-keyczar/trunk/debian/patches/series	2010-07-16 18:22:08 UTC (rev 13963)
@@ -0,0 +1 @@
+0001-workaround-deprecated-interface.patch




More information about the Python-modules-commits mailing list