Opened 8 years ago

Last modified 7 years ago

#1101 new defect

OpenID plugin fails with: number of bits must be greater than zero

Reported by: sander.sweers@… Owned by: cygnus
Priority: high Component: OpenidPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10


I got this while testing the plugin for a project. Any help would be appreciated.

Thanks Sander

Python Traceback

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/trac/web/", line 379, in dispatch_request


File "/usr/lib/python2.4/site-packages/trac/web/", line 230, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-x86_64/egg/openidauth/", line 162, in process_request File "build/bdist.linux-x86_64/egg/openidauth/", line 205, in _start_login File "/usr/lib/python2.4/site-packages/openid/consumer/", line 308, in begin

return self.beginWithoutDiscovery(service)

File "/usr/lib/python2.4/site-packages/openid/consumer/", line 331, in beginWithoutDiscovery

auth_req = self.consumer.begin(service)

File "/usr/lib/python2.4/site-packages/openid/consumer/", line 423, in begin

assoc = self._getAssociation(service_endpoint.server_url)

File "/usr/lib/python2.4/site-packages/openid/consumer/", line 619, in _getAssociation

assoc_session, args = self._createAssociateRequest(server_url)

File "/usr/lib/python2.4/site-packages/openid/consumer/", line 639, in _createAssociateRequest

assoc_session = session_type()

File "/usr/lib/python2.4/site-packages/openid/consumer/", line 378, in init

dh = DiffieHellman.fromDefaults()

File "/usr/lib/python2.4/site-packages/openid/", line 17, in fromDefaults

return cls(cls.DEFAULT_MOD, cls.DEFAULT_GEN)

File "/usr/lib/python2.4/site-packages/openid/", line 25, in init

self._setPrivate(cryptutil.randrange(1, modulus - 1))

File "/usr/lib/python2.4/", line 189, in randrange

return int(istart + self._randbelow(width))

File "/usr/lib/python2.4/", line 236, in _randbelow

r = getrandbits(k)

File "/usr/lib/python2.4/", line 764, in getrandbits

raise ValueError('number of bits must be greater than zero')

ValueError: number of bits must be greater than zero

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by wkornew

  • Owner changed from wkornew to cygnus

Assigning to new owner.

comment:2 Changed 8 years ago by sander.sweers@…

Testing it a bit more and found this does not happen when trac is run under mod_python. The trace above is only when it is run as a cgi.

comment:3 Changed 7 years ago by dalius

If you want you can test this problem with AuthOpenIdPlugin which uses newer version of OpenID library which is potential source of problem.

Add Comment

Modify Ticket

as new The owner will remain cygnus.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.