rpms/python-crypto/devel python-crypto-fix_buffer_overflow.patch, NONE, 1.1 python-crypto.spec, 1.26, 1.27

Thorsten Leemhuis thl at fedoraproject.org
Fri Feb 13 16:34:32 UTC 2009


Author: thl

Update of /cvs/pkgs/rpms/python-crypto/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26979

Modified Files:
	python-crypto.spec 
Added Files:
	python-crypto-fix_buffer_overflow.patch 
Log Message:
* Fri Feb 13 2009 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.0.1-16
- add patch to fix #485298 / CVE-2009-0544


python-crypto-fix_buffer_overflow.patch:

--- NEW FILE python-crypto-fix_buffer_overflow.patch ---
diff -Naur pycrypto-2.0.1.org/src/ARC2.c pycrypto-2.0.1/src/ARC2.c
--- pycrypto-2.0.1.org/src/ARC2.c	2009-02-13 17:08:30.000000000 +0100
+++ pycrypto-2.0.1/src/ARC2.c	2009-02-13 17:08:47.000000000 +0100
@@ -11,6 +11,7 @@
  */
 
 #include <string.h>  
+#include "Python.h"
 
 #define MODULE_NAME ARC2
 #define BLOCK_SIZE 8
@@ -146,6 +147,12 @@
 	   We'll hardwire it to 1024. */
 #define bits 1024
 
+	if ((U32)keylength > sizeof(self->xkey)) {
+		PyErr_SetString(PyExc_ValueError,
+				"ARC2 key length must be less than 128 bytes");
+		return;
+	}
+
 	memcpy(self->xkey, key, keylength);
   
 	/* Phase 1: Expand input key to 128 bytes */


Index: python-crypto.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python-crypto/devel/python-crypto.spec,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- python-crypto.spec	7 Feb 2009 18:01:43 -0000	1.26
+++ python-crypto.spec	13 Feb 2009 16:34:02 -0000	1.27
@@ -10,7 +10,13 @@
 # FIXME: In the near future, new releases will be at http://www.dlitz.net/software/pycrypto/
 URL:		http://www.amk.ca/python/code/crypto.html
 Source:		http://www.amk.ca/files/python/crypto/pycrypto-2.0.1.tar.gz
-Patch0:		pycrypto-2.0.1-hashlib.patch
+# patch taken from 
+# http://gitweb2.dlitz.net/?p=crypto/pycrypto-2.x.git;a=commitdiff;h=d1c4875e1f220652fe7ff8358f56dee3b2aba31b
+Patch0: 	%{name}-fix_buffer_overflow.patch
+# similar patches upstream already 
+# http://gitweb.pycrypto.org/?p=crypto/pycrypto-2.x.git;a=commitdiff;h=d2311689910240e425741a546576129f4c9735e2
+# http://gitweb.pycrypto.org/?p=crypto/pycrypto-2.x.git;a=commitdiff;h=84b793416b52311643bfd456a4544444afbfb5da
+Patch1:		pycrypto-2.0.1-hashlib.patch
 
 Provides:	pycrypto = %{version}-%{release}
 BuildRequires:	python >= 2.2
@@ -27,8 +33,8 @@
 %prep
 %setup -n pycrypto-%{version} -q
 sed -i s:/lib:/%_lib:g setup.py
-
-%patch0 -b .hashlib
+%patch0 -b .patch0 -p1
+%patch1 -b .hashlib
 
 %build
 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
@@ -66,6 +72,9 @@
 
 
 %changelog
+* Fri Feb 13 2009 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.0.1-16
+- add patch to fix #485298 / CVE-2009-0544
+
 * Sat Feb 7 2009 Stewart Adam <s.adam at diffingo.com> - 2.0.1-15.1
 - Oops, actually apply the patch
 - Modify patch so modules remain compatible with PEP 247




More information about the scm-commits mailing list