fix encoding issue

This commit is contained in:
Yann Leboulanger 2013-07-28 20:50:11 +02:00
parent 7046cd0608
commit 8c7ee7a12b
1 changed files with 3 additions and 3 deletions

View File

@ -875,9 +875,9 @@ class Socks5:
Get sha of sid + Initiator jid + Target jid
"""
if self.file_props.is_a_proxy:
return hashlib.sha1('%s%s%s' % (self.sid,
self.file_props.proxy_sender, self.file_props.proxy_receiver)
).hexdigest()
return hashlib.sha1(('%s%s%s' % (self.sid,
self.file_props.proxy_sender, self.file_props.proxy_receiver)).\
encode('utf-8')).hexdigest()
return hashlib.sha1(('%s%s%s' % (self.sid, self.initiator,
self.target)).encode('utf-8')).hexdigest()