fwenzel/django-sha2 — Issue #10: Unicode passwords break sha512 hashing
Author: fwenzel
Created: 2011-10-28 16:12:21+00:00
State: open

Traceback (most recent call last):

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/src/django/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/src/django-session-csrf/session_csrf/__init__.py", line 107, in wrapper
response = f(request, *args, **kw)

File "/data/www/affiliates.mozilla.org/affiliates-app/apps/users/views.py", line 54, in register
form.cleaned_data['password'])

File "/data/www/affiliates.mozilla.org/affiliates-app/apps/users/models.py", line 95, in create_profile
profile.set_password(password)

File "/data/www/affiliates.mozilla.org/affiliates-app/apps/users/models.py", line 172, in set_password
self.password = hash_password(raw_password)

File "/data/www/affiliates.mozilla.org/affiliates-app/apps/users/utils.py", line 7, in hash_password
u.set_password(raw_password)

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/src/django-sha2/django_sha2/auth.py", line 53, in set_password
hsh = get_hexdigest(algo, salt, raw_password)

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/src/django-sha2/django_sha2/auth.py", line 87, in get_hexdigest
return getattr(hashlib, algorithm)(salt + raw_password).hexdigest()

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 29: ordinal not in range(128)