Modify

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

Description

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/main.py", line 379, in dispatch_request

dispatcher.dispatch(req)

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

resp = chosen_handler.process_request(req)

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

return self.beginWithoutDiscovery(service)

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

auth_req = self.consumer.begin(service)

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

assoc = self._getAssociation(service_endpoint.server_url)

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

assoc_session, args = self._createAssociateRequest(server_url)

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

assoc_session = session_type()

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

dh = DiffieHellman.fromDefaults()

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

return cls(cls.DEFAULT_MOD, cls.DEFAULT_GEN)

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

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

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

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

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

r = getrandbits(k)

File "/usr/lib/python2.4/random.py", 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

Action
as new The owner will remain cygnus.
Author


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

 
Note: See TracTickets for help on using tickets.