Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

open id fails incorrect padding #16

Open
mmack3540 opened this issue Jun 9, 2018 · 0 comments
Open

open id fails incorrect padding #16

mmack3540 opened this issue Jun 9, 2018 · 0 comments

Comments

@mmack3540
Copy link

mmack3540 commented Jun 9, 2018

I've done a little more research and not found a solution. There appears to be a python bug affecting the execution of your code. There is a discussion here
https://bugs.python.org/issue33770 and there WeblateOrg/weblate#1799 but no solution. In store.py line 80, the assoc. secret string is submitted that causes python3.6/base64.py", line 556, in decodebytes binascii.a2b_base64(s) to fail. An example string repr of assoc.secret is: b'OXk5VXGt7nVxguRqkZps2EAQYrU=\n'

According to this discussion, http://psf.upfronthosting.co.za/roundup/tracker/issue32491
there may be a bug causing this. The \n is not being ignored and throwing a Incorrect padding error.

The code executes without errors using python 3.55 and django 1.10. Something in python/django must have broken due to the change.

Any help in solving this would be very much appreciated.

Using python3.6 and django 2.06. Here's my traceback:
Traceback:
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
35. response = get_response(request)
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
128. response = self.process_exception_by_middleware(e, request)
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
126. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/malcolm/cel/qb5/django_openid_auth/views.py" in login_begin
188. openid_request = consumer.begin(openid_url)
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/site-packages/openid/consumer/consumer.py" in begin
359. return self.beginWithoutDiscovery(service, anonymous)
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/site-packages/openid/consumer/consumer.py" in beginWithoutDiscovery
382. auth_req = self.consumer.begin(service)
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/site-packages/openid/consumer/consumer.py" in begin
610. assoc = self._getAssociation(service_endpoint)
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/site-packages/openid/consumer/consumer.py" in _getAssociation
1178. assoc = self.store.getAssociation(endpoint.server_url)
File "/home/malcolm/cel/qb5/django_openid_auth/store.py" in getAssociation
80. base64.decodestring(assoc.secret.encode('utf-8')),
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/base64.py" in decodestring
564. return decodebytes(s)
File "/home/malcolm/anaconda3/envs/cel2/lib/python3.6/base64.py" in decodebytes
556. return binascii.a2b_base64(s)

Exception Type: Error at /openid/login/
Exception Value: Incorrect padding

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

No branches or pull requests

1 participant