Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_oauth.OAuthTestRsaSha1Case throws errors with PyCryptodome #210

Open
neirbowj opened this issue Jul 27, 2020 · 1 comment · May be fixed by #211
Open

test_oauth.OAuthTestRsaSha1Case throws errors with PyCryptodome #210

neirbowj opened this issue Jul 27, 2020 · 1 comment · May be fixed by #211

Comments

@neirbowj
Copy link

When the Crypto package dependency is met with PyCryptodome instead of PyCrypto, rauth.oauth.RsaSha1Signature raises AttributeError because the internal implementation details differ in Crypto.PublicKey.RSA.

======================================================================
======================================================================
ERROR: test_rsasha1_badargument (test_oauth.OAuthTestRsaSha1Case)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/neirbowj/src/github/rauth/tests/test_oauth.py", line 214, in test_rsasha1_badargument
    self.req_kwargs)
  File "/usr/local/lib/python2.7/unittest/case.py", line 473, in assertRaises
    callableObj(*args, **kwargs)
  File "/home/neirbowj/src/github/rauth/rauth/oauth.py", line 211, in sign
    if not isinstance(consumer_secret, self.RSA._RSAobj):
AttributeError: 'module' object has no attribute '_RSAobj'

======================================================================
ERROR: test_rsasha1_signature (test_oauth.OAuthTestRsaSha1Case)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/neirbowj/src/github/rauth/tests/test_oauth.py", line 199, in test_rsasha1_signature
    self.req_kwargs)
  File "/home/neirbowj/src/github/rauth/rauth/oauth.py", line 211, in sign
    if not isinstance(consumer_secret, self.RSA._RSAobj):
AttributeError: 'module' object has no attribute '_RSAobj'

@neirbowj neirbowj linked a pull request Jul 27, 2020 that will close this issue
@neirbowj
Copy link
Author

Based on source code analysis, it should also be fine to remove the isinstance check entirely, because both implementations either return a valid object or raise an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant