siskin-im icon indicating copy to clipboard operation
siskin-im copied to clipboard

"Your client doesn't support OMEMO"

Open LupusArgentum opened this issue 3 years ago • 14 comments

Describe the bug In group chats as well as in private messages, sometimes my client seems not to be able to deal with OMEMO encrypted messages. The behaviour seems to happen randomly. Instead of the message, I get presented with the following text: You received a message encrypted with OMEMO but your client doesn't support OMEMO. In 95% of the cases however, everything works just fine, but this issue keeps coming up from time to time. In group chats, only one person (not always the same) causes the problems, the other persons' messages don't put up any issues. After I reply in chat stating that I can't read the message, all following messages by that person are readable just fine. The OMEMO lock symbol is always present, even in the "warning" messages.

To Reproduce Steps to reproduce the behavior:

  1. Open a group chat or private message
  2. See that the messages of one person are not shown properly and instead I see the following warning message: You received a message encrypted with OMEMO but your client doesn't support OMEMO.

Expected behavior No OMEMO issues

Screenshots N/A

Details (please complete the following information):

  • Siskin Version: 6.4
  • iOS version: 14.7.1
  • iPhone model: 8 Plus

Additional context N/A

LupusArgentum avatar Jul 29 '21 15:07 LupusArgentum

This message which is presented to you is most likely sent by another client. It is a "placeholder" message to be displayed if receiving client does not support OMEMO.

Siskin IM supports OMEMO and if it would fail to decrypt the message it would present a different message. This message which you see may only be presented if Siskin IM was unable to "find" OMEMO encryption elements in the message which you received.

That is why I assume that either message is modified by some entity after being sent by the sender and before it was received by your device, or the sender sent a malformed message.

If you know that usually only one client/user sends those messages, could you find out which XMPP client software is being used?

hantu85 avatar Jul 29 '21 15:07 hantu85

Most users in the group use Conversations and/or Gajim. As I said, the problem is not limited to one specific user.

LupusArgentum avatar Jul 29 '21 17:07 LupusArgentum

In one private MUC with OMEMO my profanity often fails to encrypt to the Apple participant using Siskin. I did not yet find out why profanity sometimes stumbles to encrypt to siskin.

mdosch avatar Jan 02 '22 14:01 mdosch

A Siskin user reported a similar problem: only some OMEMO messages can't be decrypted.

We may have found steps to reproduce:

  • start a private group chat between Alice (using siskin) and Bob
  • write messages with OMEMO and check that messages can be decrypted from both sides
  • Alice's iphone goes asleep, making Alice "offline" in the group chat
  • Bob writes a new message
  • Bob disconnects
  • Alice reconnects and last Bob's message can't be decrypted

So it looks like Siskin can't decrypt OMEMO messages from MAM, when the sender is offline at the time of MAM retrieval. Does it sound plausible?

pitchum avatar Jun 30 '22 06:06 pitchum

What is the actual message shown in SiskinIM?

To me, it looks like a case when the message was not encrypted for Alice's SiskinIM by Bob when her device was offline (encrypted for occupants (currently connected users) instead of room members).

hantu85 avatar Jun 30 '22 06:06 hantu85

Which client Bob uses?

licaon-kter avatar Jun 30 '22 07:06 licaon-kter

What is the actual message shown in SiskinIM?

Message decryption failed! Error code: -1008

Which client Bob uses?

There were many Bobs :) at least, one Dino, one Gajim, and probably one Conversations All 3 of them were previously used in the same group chat and Alice was able to decrypt their messages.

FYI: The server hosting the group chat is chapril.org running ejabberd 21.01.

pitchum avatar Jun 30 '22 07:06 pitchum

Do you by any chance known how long it was since Alice went offline till Bob tried to send her a message.

Error -1008 suggests that there is no OMEMO session between Alice and Bob, just like there was a message initiating this session that was lost.

All 3 of them were previously used in the same group chat and Alice was able to decrypt their messages.

When was that? What is different now?

hantu85 avatar Jun 30 '22 08:06 hantu85

Do you by any chance known how long it was since Alice went offline till Bob tried to send her a message.

Long enough to make Alice appear offline. In ejabberd logs, Alice's session is explicitly closed: Closing c2s session for alice@xxxxxx

Error -1008 suggests that there is no OMEMO session between Alice and Bob, just like there was a message initiating this session that was lost.

I'm not really familiar with how OMEMO sessions work. From the way you speak of it, it seems that OMEMO is only possible when both participants are online. Right?

All 3 of them were previously used in the same group chat and Alice was able to decrypt their messages.

When was that? What is different now?

When the group chat was created, both Alice and Bob were online and chatting with OMEMO. Then, when Bob writes new messages while Alice is offline (happens every time the iphone goes asleep), Alice won't be able to read those messages when she comes back online. And while she's online, she is able to read new OMEMO messages from Bob.

That's why I suspect the issue only occur when retrieving OMEMO messages from MAM.

pitchum avatar Jun 30 '22 08:06 pitchum

I'm not really familiar with how OMEMO sessions work. From the way you speak of it, it seems that OMEMO is only possible when both participants are online. Right?

No, it will work even if participants are offline. However, it is possible that the OMEMO session was invalidated (and/or recreated) before the message was received from MAM. That would end up with a missing OMEMO session in Siskin IM.

The question is why this happened.

Which version of SiskinIM is in use? From testflight or from the AppStore?

hantu85 avatar Jun 30 '22 08:06 hantu85

Alice uses Siskin from the AppStore.

pitchum avatar Jun 30 '22 12:06 pitchum

This issue is 100% reproducible in a private room on muc.chapril.org. Could you create a private room on muc.tigase.org to compare the results?

pitchum avatar Jul 03 '22 11:07 pitchum

@hantu85 one issue I found during private group chat that is When message sender edit his message, everyone in the group can see edited version of messages except owner, owner see a placeholder message like I send you omemo.....

This happened in omemo encryption enabled. Can you please guide me about how I can resolved this

SulemanAli303 avatar Jan 26 '24 01:01 SulemanAli303

@pitchum for private group chat(by setting up whoiam to anyone) I customed little bit of code like fetching all users(even list of admins and owners, members) in group at the time of entrance. Then send message to all instead of only online users

SulemanAli303 avatar Jan 26 '24 01:01 SulemanAli303