changeset b3824e6bda79 in /home/hg/repos/python-nbxmpp
details:http://hg.gajim.org/python-nbxmpp?cmd=changeset;node=b3824e6bda79 description: fix HMAC computation
diffstat:
nbxmpp/auth_nb.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diffs (22 lines):
diff -r f374d0edd731 -r b3824e6bda79 nbxmpp/auth_nb.py --- a/nbxmpp/auth_nb.py Wed Jan 02 22:42:32 2013 +0100 +++ b/nbxmpp/auth_nb.py Wed Jan 02 22:50:52 2013 +0100 @@ -378,7 +378,7 @@ s = s.encode('utf-8') except: pass - ui_1 = HMAC(s, (salt + '\0\0\0\01').encode('utf-8')) + ui_1 = HMAC(s, salt + b'\0\0\0\01') ui = ui_1 for i in range(iters - 1): ii += 1 @@ -399,8 +399,7 @@ r += ',r=' + data['r'] self.scram_soup += r self.scram_soup = self.scram_soup.encode('utf-8') - salt = base64.b64decode(data['s'].encode('utf-8')).decode( - 'utf-8') + salt = base64.b64decode(data['s'].encode('utf-8')) iter = int(data['i']) SaltedPassword = Hi(self.password, salt, iter) # TODO: Could cache this, along with salt+iter.