#2270 fix bcrypt.hashpw unicode input
Closed by zhsj. Opened by zhsj.
zhsj/pagure fix-bcrypt  into  master

Download 2270.patch

when password is not ascii:

File "...pagure/lib/login.py", line 54, in generate_hashed_value
return '$2$' + bcrypt.hashpw(to_unicode(password), bcrypt.gensalt())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

the bcrypt.hashpw should take bytes, not unicode

the change is safe for old password, since whether to_unicode or
to_bytes, ascii password gets same result.

Signed-off-by: Shengjing Zhu zsj950618@gmail.com

Isn't this overlapping with https://pagure.io/pagure/pull-request/2014 ?

Isn't this overlapping with https://pagure.io/pagure/pull-request/2014 ?

I wasn't aware of this. Both fix the same problem.

Let's close this in favor of https://pagure.io/pagure/pull-request/2014

Pull-Request has been closed by zhsj

Metadata