Ensure non-ascii Jids are also converted properly in data dir name

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2020-01-22 18:18:48 +01:00
parent f755df9dba
commit 88540420b4
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -62,7 +62,7 @@ class Plugin(E2EEPlugin):
self.info = lambda i: self.api.information(i, 'Info') self.info = lambda i: self.api.information(i, 'Info')
jid_str = self.core.xmpp.boundjid.bare.encode('US-ASCII') jid_str = self.core.xmpp.boundjid.bare.encode('utf-8')
digest = hashlib.sha256(jid_str).digest() digest = hashlib.sha256(jid_str).digest()
hashed_jid = base64.b32encode(digest).decode('US-ASCII') hashed_jid = base64.b32encode(digest).decode('US-ASCII')
data_dir = os.path.join(DATA_HOME, 'omemo', hashed_jid) data_dir = os.path.join(DATA_HOME, 'omemo', hashed_jid)