@@ -281,10 +281,6 @@ class OmemoState:
|
|||||||
|
|
||||||
devices_list = self.device_list_for(jid, True)
|
devices_list = self.device_list_for(jid, True)
|
||||||
|
|
||||||
if len(devices_list) == 0:
|
|
||||||
log.error('No known devices')
|
|
||||||
return
|
|
||||||
|
|
||||||
payload, tag = encrypt(key, iv, plaintext)
|
payload, tag = encrypt(key, iv, plaintext)
|
||||||
|
|
||||||
key += tag
|
key += tag
|
||||||
@@ -315,10 +311,6 @@ class OmemoState:
|
|||||||
log.warning('Failed to find key for device ' +
|
log.warning('Failed to find key for device ' +
|
||||||
str(rid))
|
str(rid))
|
||||||
encrypted_jids.append(jid_to)
|
encrypted_jids.append(jid_to)
|
||||||
if len(encrypted_keys) == 0:
|
|
||||||
log_msg = 'Encrypted keys empty'
|
|
||||||
log.error(log_msg)
|
|
||||||
raise NoValidSessions(log_msg)
|
|
||||||
|
|
||||||
my_other_devices = set(self.own_devices) - set({self.own_device_id})
|
my_other_devices = set(self.own_devices) - set({self.own_device_id})
|
||||||
# Encrypt the message key with for each of our own devices
|
# Encrypt the message key with for each of our own devices
|
||||||
@@ -336,6 +328,10 @@ class OmemoState:
|
|||||||
log.exception('ERROR:')
|
log.exception('ERROR:')
|
||||||
log.warning('Failed to find key for device ' + str(dev))
|
log.warning('Failed to find key for device ' + str(dev))
|
||||||
|
|
||||||
|
if not encrypted_keys:
|
||||||
|
log.error('Encrypted keys empty')
|
||||||
|
raise NoValidSessions('Encrypted keys empty')
|
||||||
|
|
||||||
result = {'sid': self.own_device_id,
|
result = {'sid': self.own_device_id,
|
||||||
'keys': encrypted_keys,
|
'keys': encrypted_keys,
|
||||||
'jid': jid,
|
'jid': jid,
|
||||||
|
|||||||
@@ -236,11 +236,8 @@ class OmemoPlugin(GajimPlugin):
|
|||||||
if isinstance(chat_control, GroupchatControl):
|
if isinstance(chat_control, GroupchatControl):
|
||||||
room = chat_control.room_jid
|
room = chat_control.room_jid
|
||||||
missing = True
|
missing = True
|
||||||
own_jid = app.get_jid_from_account(account)
|
|
||||||
for nick in con.groupchat[room]:
|
for nick in con.groupchat[room]:
|
||||||
real_jid = con.groupchat[room][nick]
|
real_jid = con.groupchat[room][nick]
|
||||||
if real_jid == own_jid:
|
|
||||||
continue
|
|
||||||
if not con.are_keys_missing(real_jid):
|
if not con.are_keys_missing(real_jid):
|
||||||
missing = False
|
missing = False
|
||||||
if missing:
|
if missing:
|
||||||
|
|||||||
Reference in New Issue
Block a user