aboutsummaryrefslogtreecommitdiffstats
path: root/security/py-pycrypto
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2009-02-16 05:51:27 +0800
committermiwi <miwi@FreeBSD.org>2009-02-16 05:51:27 +0800
commit6f5e9ededa8aafaf667d5a457605bb63d9f6ccb0 (patch)
treee63155fae4a0112c6c6975654d7618a3ddd6353a /security/py-pycrypto
parentbbd34480ae0a0bd0f3b95d217c11cddfc7cf57c4 (diff)
downloadfreebsd-ports-gnome-6f5e9ededa8aafaf667d5a457605bb63d9f6ccb0.tar.gz
freebsd-ports-gnome-6f5e9ededa8aafaf667d5a457605bb63d9f6ccb0.tar.zst
freebsd-ports-gnome-6f5e9ededa8aafaf667d5a457605bb63d9f6ccb0.zip
- Fix ARC2 Buffer Overflow
- Bump PORTREVISION Obtained from: pycrypto git Security: http://www.vuxml.org/freebsd/5a021595-fba9-11dd-86f3-0030843d3802.html
Diffstat (limited to 'security/py-pycrypto')
-rw-r--r--security/py-pycrypto/Makefile2
-rw-r--r--security/py-pycrypto/files/patch-src-ARC2.c25
-rw-r--r--security/py-pycrypto/pkg-descr2
3 files changed, 27 insertions, 2 deletions
diff --git a/security/py-pycrypto/Makefile b/security/py-pycrypto/Makefile
index 7ac26bd45021..a3afd63442bf 100644
--- a/security/py-pycrypto/Makefile
+++ b/security/py-pycrypto/Makefile
@@ -7,7 +7,7 @@
PORTNAME= pycrypto
PORTVERSION= 2.0.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security python
MASTER_SITES= http://www.amk.ca/files/python/crypto/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
diff --git a/security/py-pycrypto/files/patch-src-ARC2.c b/security/py-pycrypto/files/patch-src-ARC2.c
new file mode 100644
index 000000000000..e4df631c1ce2
--- /dev/null
+++ b/security/py-pycrypto/files/patch-src-ARC2.c
@@ -0,0 +1,25 @@
+diff --git a/src/ARC2.c b/src/ARC2.c
+index eb61713..35d9151 100644
+--- src/ARC2.c
++++ src/ARC2.c
+@@ -11,6 +11,7 @@
+ */
+
+ #include <string.h>
++#include "Python.h"
+
+ #define MODULE_NAME ARC2
+ #define BLOCK_SIZE 8
+@@ -144,6 +145,12 @@ block_init(block_state *self, U8 *key, int keylength)
+ 197,243,219, 71,229,165,156,119, 10,166, 32,104,254,127,193,173
+ };
+
++ 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/security/py-pycrypto/pkg-descr b/security/py-pycrypto/pkg-descr
index 893f5df880c7..3eb3de691de0 100644
--- a/security/py-pycrypto/pkg-descr
+++ b/security/py-pycrypto/pkg-descr
@@ -5,4 +5,4 @@ This is a collection of both secure hash functions (such as MD5 and
SHA), and various encryption algorithms (AES, DES, IDEA, RSA, ElGamal,
etc.) for Python.
-WWW: http://www.amk.ca/python/code/crypto.html
+WWW: http://pycrypto.org