Show More
@@ -113,6 +113,6 b' def passwd_check(hashed_passphrase, passphrase):' | |||||
113 | if len(pw_digest) == 0: |
|
113 | if len(pw_digest) == 0: | |
114 | return False |
|
114 | return False | |
115 |
|
115 | |||
116 |
h.update(cast_bytes(passphrase, 'utf-8') + st |
|
116 | h.update(cast_bytes(passphrase, 'utf-8') + cast_bytes(salt, 'ascii')) | |
117 |
|
117 | |||
118 | return h.hexdigest() == pw_digest |
|
118 | return h.hexdigest() == pw_digest |
@@ -1,3 +1,4 b'' | |||||
|
1 | # coding: utf-8 | |||
1 | from IPython.lib import passwd |
|
2 | from IPython.lib import passwd | |
2 | from IPython.lib.security import passwd_check, salt_len |
|
3 | from IPython.lib.security import passwd_check, salt_len | |
3 | import nose.tools as nt |
|
4 | import nose.tools as nt | |
@@ -19,3 +20,7 b' def test_bad():' | |||||
19 | nt.assert_equal(passwd_check(p, 'a:b:c:d'), False) |
|
20 | nt.assert_equal(passwd_check(p, 'a:b:c:d'), False) | |
20 | nt.assert_equal(passwd_check(p, 'a:b'), False) |
|
21 | nt.assert_equal(passwd_check(p, 'a:b'), False) | |
21 |
|
22 | |||
|
23 | def test_passwd_check_unicode(): | |||
|
24 | # GH issue #4524 | |||
|
25 | phash = u'sha1:23862bc21dd3:7a415a95ae4580582e314072143d9c382c491e4f' | |||
|
26 | assert passwd_check(phash, u"łe¶ŧ←↓→") No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now