View | Details | Raw Unified | Return to bug 248307
Collapse All | Expand All

(-)devel/py-rauth/Makefile (-1 / +2 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	rauth
4
PORTNAME=	rauth
5
PORTVERSION=	0.7.2
5
PORTVERSION=	0.7.2
6
PORTREVISION=	1
6
CATEGORIES=	devel www python
7
CATEGORIES=	devel www python
7
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
8
9
Lines 15-21 Link Here
15
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}requests>=1.2.3:www/py-requests@${PY_FLAVOR}
16
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}requests>=1.2.3:www/py-requests@${PY_FLAVOR}
16
TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}nose>=1.2.1:devel/py-nose@${PY_FLAVOR} \
17
TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}nose>=1.2.1:devel/py-nose@${PY_FLAVOR} \
17
		${PYTHON_PKGNAMEPREFIX}mock>=1.0.1:devel/py-mock@${PY_FLAVOR} \
18
		${PYTHON_PKGNAMEPREFIX}mock>=1.0.1:devel/py-mock@${PY_FLAVOR} \
18
		${PYTHON_PKGNAMEPREFIX}pycrypto>=2.5:security/py-pycrypto@${PY_FLAVOR}
19
		${PYTHON_PKGNAMEPREFIX}pycryptodome>=0:security/py-pycryptodome@${PY_FLAVOR}
19
20
20
USES=		python
21
USES=		python
21
USE_GITHUB=	yes
22
USE_GITHUB=	yes
(-)devel/py-rauth/files/patch-rauth__oauth.py (+29 lines)
Line 0 Link Here
1
commit 7fb3b7bf1a1869a52cf59ee3eb607d318e97265c
2
Author: John W. O'Brien <john@saltant.com>
3
Date:   Mon Jul 27 14:56:02 2020 -0400
4
5
    Support PyCryptodome as alternative to PyCrypto
6
7
--- rauth/oauth.py.orig	2015-11-05 16:01:31 UTC
8
+++ rauth/oauth.py
9
@@ -171,7 +171,8 @@ class RsaSha1Signature(SignatureMethod):
10
             from Crypto.Signature import PKCS1_v1_5 as p
11
             self.RSA, self.SHA, self.PKCS1_v1_5 = r, s, p
12
         except ImportError:  # pragma: no cover
13
-            raise NotImplementedError('PyCrypto is required for ' + self.NAME)
14
+            raise NotImplementedError('PyCrypto(dome) is required for '
15
+                                      + self.NAME)
16
 
17
     def sign(self,
18
              consumer_secret,
19
@@ -208,7 +209,9 @@ class RsaSha1Signature(SignatureMethod):
20
         # resolve the key
21
         if is_basestring(consumer_secret):
22
             consumer_secret = self.RSA.importKey(consumer_secret)
23
-        if not isinstance(consumer_secret, self.RSA._RSAobj):
24
+        valid_cls = (getattr(self.RSA, '_RSAobj', False)
25
+                     or getattr(self.RSA, 'RsaKey', False))
26
+        if not (valid_cls and isinstance(consumer_secret, valid_cls)):
27
             raise ValueError('invalid consumer_secret')
28
 
29
         # hash the string with RSA-SHA1
(-)devel/py-rauth/files/patch-setup.py (-1 / +1 lines)
Lines 14-20 Link Here
14
+tests_require = [
14
+tests_require = [
15
+    'nose',
15
+    'nose',
16
+    'mock',
16
+    'mock',
17
+    'pycrypto',
17
+    'pycryptodome',
18
+]
18
+]
19
+
19
+
20
 if sys.version_info[0] == 2 and sys.version_info[1] < 7:
20
 if sys.version_info[0] == 2 and sys.version_info[1] < 7:

Return to bug 248307