diff --git a/python-crypto-fix_buffer_overflow.patch b/python-crypto-fix_buffer_overflow.patch new file mode 100644 index 0000000..b16a307 --- /dev/null +++ b/python-crypto-fix_buffer_overflow.patch @@ -0,0 +1,24 @@ +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 ++#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 */ diff --git a/python-crypto.spec b/python-crypto.spec index 151a63e..f621219 100644 --- a/python-crypto.spec +++ b/python-crypto.spec @@ -4,11 +4,14 @@ Summary: Cryptography library for Python Name: python-crypto Version: 2.0.1 -Release: 13.1 +Release: 14%{?dist} License: Public Domain Group: Development/Libraries URL: http://www.amk.ca/python/code/crypto.html Source: http://www.amk.ca/files/python/crypto/pycrypto-2.0.1.tar.gz +# patch taken from +# http://gitweb2.dlitz.net/?p=crypto/pycrypto-2.x.git;a=commitdiff;h=d1c4875e1f220652fe7ff8358f56dee3b2aba31b +Patch0: %{name}-fix_buffer_overflow.patch Provides: pycrypto = %{version}-%{release} BuildRequires: python >= 2.2 BuildRequires: python-devel >= 2.2 @@ -24,7 +27,7 @@ etc.). %prep %setup -n pycrypto-%{version} -q sed -i s:/lib:/%_lib:g setup.py - +%patch0 -b .patch0 -p1 %build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build @@ -62,6 +65,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Feb 13 2009 Thorsten Leemhuis - 2.0.1-14 +- add patch to fix #485298 / CVE-2009-0544 + * Sun May 04 2008 Thorsten Leemhuis - 2.0.1-13 - provide pycrypto