Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot receive OMEMO messages from Gajim or ChatSecure #1193

Closed
t2d opened this issue Sep 9, 2018 · 5 comments

Comments

@t2d
Copy link

commented Sep 9, 2018

First, thank you for this great peace of software.
Second, I wanted to try the OMEMO encryption, so I integrated libsignal into 4.0.0 as told in #497 (comment).

The lock appears and I can send OMEMO encrypted messages. However, if I want to reply from another client, conversejs is not showing anything. I only get

New remote ephemeral key

from libsignal in debug. I tried with ChatSecure and Gajim.

@jcbrand

This comment has been minimized.

Copy link
Member

commented Sep 10, 2018

Thanks. I'm not sure what the issue is here.

I've tested OMEMO between Converse and Conversations.

@t2d

This comment has been minimized.

Copy link
Author

commented Sep 11, 2018

I don't have an Android device so I cannot verify if this is a client specific problem. But I ran into problems with different OMEMO implementations before.

@jcbrand jcbrand changed the title Cannot receive OMEMO messages Cannot receive OMEMO messages from Gajim or ChatSecure Sep 23, 2018

@siikamiika

This comment has been minimized.

Copy link

commented Oct 12, 2018

I ran into the same problem and intercepted two messages sent to my converse.js, one from Gajim (doesn't work) and another from Conversations (works). Here are the messages, anonymized:

From Gajim (doesn't work):

<message xmlns="jabber:client" type="chat" to="ME/converse.js" from="ME">
  <received xmlns="urn:xmpp:carbons:2">
    <forwarded xmlns="urn:xmpp:forward:0">
      <message xmlns="jabber:client" type="chat" to="ME/Conversations" from="FRIEND/gajim" id="">
        <thread>...</thread>
        <request xmlns="urn:xmpp:receipts"/>
        <active xmlns="http://jabber.org/protocol/chatstates"/>
        <thread>...</thread>
        <origin-id xmlns="urn:xmpp:sid:0" id=""/>
        <encrypted xmlns="eu.siacs.conversations.axolotl">
            ...
        </encrypted>
        <encryption xmlns="urn:xmpp:eme:0" name="OMEMO" namespace="eu.siacs.conversations.axolotl"/>
        <store xmlns="urn:xmpp:hints"/>
      </message>
    </forwarded>
  </received>
</message>

from Conversations (works):

<message xmlns="jabber:client" type="chat" to="ME/converse.js" from="ME">
  <received xmlns="urn:xmpp:carbons:2">
    <forwarded xmlns="urn:xmpp:forward:0">
      <message xmlns="jabber:client" type="chat" to="ME" from="FRIEND/Conversations" id="">
        <body>I sent you an OMEMO encrypted message but your client doesn&#x2019;t seem to support that. Find more information on https://conversations.im/omemo</body>
        <encrypted xmlns="eu.siacs.conversations.axolotl">
            ...
        </encrypted>
        <request xmlns="urn:xmpp:receipts"/>
        <markable xmlns="urn:xmpp:chat-markers:0"/>
        <origin-id xmlns="urn:xmpp:sid:0" id=""/>
        <store xmlns="urn:xmpp:hints"/>
        <encryption xmlns="urn:xmpp:eme:0" name="OMEMO" namespace="eu.siacs.conversations.axolotl"/>
      </message>
    </forwarded>
  </received>
</message>

I don't know how converse.js works, but the message that doesn't work seems to be missing <body>, and I guess that could be the reason why the message isn't shown. In both messages, the structure of <encrypted> is identical.

@siikamiika

This comment has been minimized.

Copy link

commented Oct 13, 2018

I just confirmed that OMEMO encrypted messages work from Gajim to converse.js again if I add this to Gajim's OMEMO plugin:

diff --git a/omemo/omemo_connection.py b/omemo/omemo_connection.py
index c1cbf52..6ce0baa 100644
--- a/omemo/omemo_connection.py
+++ b/omemo/omemo_connection.py
@@ -546,6 +546,9 @@ class OMEMOConnection:
                     error=error, time_=time.time(), session=event.session))
             return
 
+        body = Node('body', payload='asdf')
+        event.msg_iq.addChild(node=body)
+
         encrypted_node = OmemoMessage(msg_dict)
         event.msg_iq.addChild(node=encrypted_node)

Not sure who's not following the spec, but at least this could be fixed in either client and Gajim isn't the only client with this problem.

@jcbrand

This comment has been minimized.

Copy link
Member

commented Oct 13, 2018

@siikamiika Excellent work, thanks for drilling down to find the problem.

According to XEP-0384, the <payload> corresponds to the message's <body>, so I think it should be fine for a message to not have a <body> tag.

I'll fix asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.