Fixed #21362 -- Restored Python 2.5 compatibility.

This commit is contained in:
Florian Apolloner 2013-11-02 18:18:18 +01:00
parent b149d1fcd6
commit 848a759474
1 changed files with 3 additions and 3 deletions

View File

@ -134,9 +134,9 @@ def pbkdf2(password, salt, iterations, dklen=0, digest=None):
inner, outer = digest(), digest() inner, outer = digest(), digest()
if len(password) > inner.block_size: if len(password) > inner.block_size:
password = digest(password).digest() password = digest(password).digest()
password += b'\x00' * (inner.block_size - len(password)) password += '\x00' * (inner.block_size - len(password))
inner.update(password.translate(hmac.trans_36)) inner.update(password.translate(_trans_36))
outer.update(password.translate(hmac.trans_5C)) outer.update(password.translate(_trans_5c))
def F(i): def F(i):
def U(): def U():