Ticket #1515 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Incorrect padding when decoding the authentication cookie

Reported by: sprat Owned by: apoirier
Priority: major Component: uncategorized
Version: 0.3.0 Keywords:
Cc:

Description

Here is the traceback of an error that seems to appear randomly on my developer box with nagare 0.3.0 :

Traceback (most recent call last):
  File "/home/spt/projects/sandboxes/ipages/lib/python2.6/site-packages/nagare-0.3.0-py2.6.egg/nagare/wsgi.py", line 362, in __call__
    self.start_request(root, request, response)
  File "/home/spt/projects/pj-eureka/pj-eureka/ipages/app.py", line 137, in start_request
    super(EurekaApplication, self).start_request(shell_comp, request, response)
  File "/home/spt/projects/sandboxes/ipages/lib/python2.6/site-packages/nagare-0.3.0-py2.6.egg/nagare/wsgi.py", line 262, in start_request
    security.set_user(self.security.create_user(request, response)) # Create the User object
  File "/home/spt/projects/sandboxes/ipages/lib/python2.6/site-packages/nagare-0.3.0-py2.6.egg/nagare/security/common.py", line 150, in create_user
    (username, ids) = self.get_ids(request, response)
  File "/home/spt/projects/sandboxes/ipages/lib/python2.6/site-packages/nagare-0.3.0-py2.6.egg/nagare/security/basic_auth.py", line 58, in get_ids
    (username, password) = self._get_ids(request, response)
  File "/home/spt/projects/sandboxes/ipages/lib/python2.6/site-packages/nagare-0.3.0-py2.6.egg/nagare/security/form_auth.py", line 128, in _get_ids
    ids = self.get_ids_from_cookie(request.cookies)
  File "/home/spt/projects/sandboxes/ipages/lib/python2.6/site-packages/nagare-0.3.0-py2.6.egg/nagare/security/form_auth.py", line 97, in get_ids_from_cookie
    return self.cookie_decode(data)
  File "/home/spt/projects/sandboxes/ipages/lib/python2.6/site-packages/nagare-0.3.0-py2.6.egg/nagare/security/form_auth.py", line 82, in cookie_decode
    return [s.decode('base64').decode('utf-8') for s in cookie.split(':')]
  File "/home/spt/projects/sandboxes/ipages/lib/python2.6/encodings/base64_codec.py", line 42, in base64_decode
    output = base64.decodestring(input)
  File "/home/spt/opt/python-2.6.5-stackless/lib/python2.6/base64.py", line 321, in decodestring
    return binascii.a2b_base64(s)
Error: Incorrect padding

I'm not sure why the problem appear in the first place (I don't play with the cookie myself), but the decoding should never fail.

Change History

comment:1 Changed 6 years ago by Sylvain Prat <sylvain.prat@…>

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.