RSA u parameter not available when _slowmath in use

Bug #622879 reported by Jean-Paul Calderone
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Python-Crypto
Fix Released
Undecided
Unassigned

Bug Description

Consider this behavior when _fastmath is built and available:

>>> import Crypto.PublicKey._fastmath
>>> from Crypto.PublicKey import RSA
>>> RSA.construct((1L, 2L, 3L, 4L, 5L)).u
4L

Compare to this behavior when _slowmath, instead, must be used:

>>> import Crypto.PublicKey._fastmath
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named _fastmath
>>> from Crypto.PublicKey import RSA
>>> RSA.construct((1L, 2L, 3L, 4L, 5L)).u
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/exarkun/.local/lib/python2.6/site-packages/Crypto/PublicKey/RSA.py", line 55, in __getattr__
    return getattr(self.key, attrname)
AttributeError: '_RSAKey' object has no attribute 'u'
>>>

It seems that the _fastmath rsaKey calculates u if it is not provided, but _slowmath _RSAKey does not. This breaks Twisted Conch when _slowmath is in use.

Revision history for this message
Darsey Litzenberger (dlitz) wrote :
Changed in pycrypto:
status: New → Fix Committed
Revision history for this message
Darsey Litzenberger (dlitz) wrote :

This bug has been fixed in PyCrypto 2.3. Thanks!

Changed in pycrypto:
status: Fix Committed → Fix Released
Revision history for this message
Glyph Lefkowitz (glyph) wrote :

Wow, thanks a ton for the prompt turnaround, Dwayne!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.