aTalk has implemented most of the basic features supporting Omemo using smack 4.2.1. I have tested aTalk with Xmpp client conversations.
Currently aTalk is able to set up Omemo chat with conversations; sending and receiving of the omemo encrypted chat messages are working properly. However aTalk is facing problem in omemo support for muc. Below is the sendMessage() implementation for muc in aTalk. However when executing the following statement, smack throws an exception (log below)
encryptedMucMessage = omemoManager.encrypt(multiUserChat, msgContent);
(note: Message message is aTalk implementation is different from org.jivesoftware.smack.packet.Message)
I investigated the process how conversations setup the omemo muc. From the ejabberd xmpp server I can only detect the following stanza being send from conversations i.e. without the âattribute node=âeu.siacs.conversations.axolotl.devicelistââ
2017-06-24 10:28:34.809 [debug] <0.23198.0>@ejabberd_receiver:process_data:284 Received XML on stream = <<"">>
With the modified conversations source, I managed to capture limited xmpp messages send/receive by conversations during startup as shown in below log.
While receive muc encrypted message
aTalk also failed to receive encryptedMucMessage sends from conversations (see log). I thinks it is because it cannot retrieve the omemodevice list for the muc members
However the message is received/sent OK with another conversation muc member.
I see there is a OmemoManager#buildSessionsWith(BareJid contact) for contact in setting up single user chat. How do I set up a conference chat session for omemo muc chat?
======== aTalk sendMessage() method for omemo muc chat ==========
public void sendMessage(Message message, OmemoManager omemoManager)
throws OperationFailedException
{
try {
assertConnected();
String msgContent = message.getContent();
org.jivesoftware.smack.packet.Message encryptedMucMessage = new org.jivesoftware.smack.packet.Message();
try {
EntityBareJid multiUserChat = mMultiUserChat.getRoom();
encryptedMucMessage = omemoManager.encrypt(multiUserChat, msgContent);
}
catch (CryptoFailedException | UndecidedOmemoIdentityException
| NoSuchAlgorithmException | InterruptedException
| CannotEstablishOmemoSessionException | SmackException.NotConnectedException
| SmackException.NoResponseException e) {
e.printStackTrace();
}
mMultiUserChat.sendMessage(encryptedMucMessage);
}
catch (NotConnectedException | InterruptedException e) {
logger.error("Failed to send message " + message, e);
throw new OperationFailedException("Failed to send message " + message,
OperationFailedException.GENERAL_ERROR, e);
}
}
========= Smack exception log for omemoManager.encrypt(multiUserChat, msgContent); ============
06-24 08:44:05.751 D/SMACK: SENT (0):
06-24 08:44:05.761 D/SMACK: RECV (0): The feature requested is not supported by the conference
06-24 08:44:05.771 D/SMACK: SENT (0):
06-24 08:44:05.821 D/SMACK: RECV (0): The feature requested is not supported by the conference
06-24 08:44:05.831 D/SMACK: RECV (0):
06-24 08:44:05.841 D/SMACK: SENT (0):
06-24 08:44:05.841 W/αTalk: [1] org.jivesoftware.smackx.omemo.OmemoService.refreshDeviceList() Could not fetch device list of chatroom@conference.atalk.org: org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPP error reply received from chatroom@conference.atalk.org: XMPPError: service-unavailable - cancel
org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPP error reply received from chatroom@conference.atalk.org: XMPPError: service-unavailable - cancel
at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:2 56)
at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:2 08)
at org.jivesoftware.smackx.pubsub.LeafNode.getItems(LeafNode.java:196)
at org.jivesoftware.smackx.pubsub.LeafNode.getItems(LeafNode.java:189)
at org.jivesoftware.smackx.pubsub.LeafNode.getItems(LeafNode.java:139)
at org.jivesoftware.smackx.pubsub.PubSubManager.getLeafNodeProsodyWorkaround(PubSu bManager.java:346)
at org.jivesoftware.smackx.pubsub.PubSubManager.getLeafNode(PubSubManager.java:329 )
at org.jivesoftware.smackx.omemo.OmemoService.fetchDeviceListNode(OmemoService.jav a:435)
at org.jivesoftware.smackx.omemo.OmemoService.fetchDeviceList(OmemoService.java:45 2)
at org.jivesoftware.smackx.omemo.OmemoService.refreshDeviceList(OmemoService.java: 504)
at org.jivesoftware.smackx.omemo.OmemoService.buildOrCreateOmemoSessionsFromBundle s(OmemoService.java:605)
at org.jivesoftware.smackx.omemo.OmemoService.processSendingMessage(OmemoService.j ava:810)
at org.jivesoftware.smackx.omemo.OmemoService.processSendingMessage(OmemoService.j ava:787)
at org.jivesoftware.smackx.omemo.OmemoManager.encrypt(OmemoManager.java:209)
at net.java.sip.communicator.impl.protocol.jabber.ChatRoomJabberImpl.sendMessage(C hatRoomJabberImpl.java:813)
at org.atalk.android.gui.chat.conference.ConferenceChatTransport.sendInstantMessag e(ConferenceChatTransport.java:169)
at org.atalk.android.gui.chat.ChatController.sendMessage(ChatController.java:263)
at org.atalk.android.gui.chat.ChatController.onClick(ChatController.java:365)
at android.view.View.performClick(View.java:5181)
at android.view.View$PerformClick.run(View.java:20887)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5938)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1389 )
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
06-24 08:44:05.851 D/SMACK: SENT (0): I sent you an OMEMO encrypted message but your client doesnât seem to support that. Find more information on https://conversations.im/omemo5g0A7LjYAScYhG3CGbs93Q==grk0jA==</p ayload>
06-24 08:44:05.861 D/SMACK: SENT (0):
06-24 08:44:05.991 D/SMACK: RECV (0):
06-24 08:44:06.041 D/SMACK: RECV (0): 5g0A7LjYAScYhG3CGbs93Q==grk0jA==</p ayload>I sent you an OMEMO encrypted message but your client doesnât seem to support that. Find more information on https://conversations.im/omemo
06-24 08:44:06.041 D/SMACK: RECV (0):
06-24 08:44:06.051 D/SMACK: SENT (0):
06-24 08:44:06.051 E/αTalk: [37] org.jivesoftware.smack.AbstractXMPPConnection.run() Exception in async packet listener
java.lang.NullPointerException: Attempt to invoke virtual method âint java.lang.Object.hashCode()â on a null object reference
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:746)
at org.jivesoftware.smackx.muc.MultiUserChat.getOccupantPresence(MultiUserChat.jav a:1667)
at org.jivesoftware.smackx.muc.MultiUserChat.getOccupant(MultiUserChat.java:1680)
at org.jivesoftware.smackx.omemo.OmemoService.getSender(OmemoService.java:1184)
at org.jivesoftware.smackx.omemo.OmemoService.access$000(OmemoService.java:106)
at org.jivesoftware.smackx.omemo.OmemoService$OmemoStanzaListener.processStanza(Om emoService.java:1229)
at org.jivesoftware.smack.AbstractXMPPConnection$4.run(AbstractXMPPConnection.java :1198)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
========= Smack log when receiving Omemo encrypted message during muc from conversations ============
06-24 08:12:40.741 D/SMACK: RECV (0): MwgrEiEFjOpAL8Rk1LGO9siB1h+nnL/qIbJ2pfy7SecSZPgxKV0aIQUUV5ApOiQnN cECsTvKWCH8wDMrQe4XtFTcxf88Tg61YSJiMwohBZRYbdpGHqgLARP8MvtRaWYet/KjoaYELN5qMpDK1 moNECoYACIw0hcyS2bFtdHinZKpAnubByCXeq2nzkcykWh68JWo5AzaJS6yGtFNZ1ooAnYiTxFIbVMyc d/1v20omZyyhQMwAQ==MwohBYdKaVS16Aof/OpK87Cpogp5UszF6qSYaLGvpptx7HRzEAEYACIwpZU6/Z dSKGR7H9oAzftTl+zVs00WSQR+JpaQO/u9NrXrb5NKrg5H1Aysq54tD5GNLXfaJ6EFz44=MwohBVPts29CYR1rBpL4w45rrqTrfCXEllki6D363gF3t8VbEAMYACIwx0vd+H YZk3kzRBKwtxnKe9oZNvBAi8OEjFYmYCw60whbl4f7WRIdN9Z6+IUFj3UqqUiEvpaIIi8=MwgfEiEFGQFL/66piWEridyeU0KsMS34/B/B+vOykndiRvVV4SYaIQUUV5ApOiQnN cECsTvKWCH8wDMrQe4XtFTcxf88Tg61YSJiMwohBe/VhE2upLjyhpHX4sc9s60s98CXdy12HdSFvI46W x5VECsYACIw+MLmq47BHFKIi/j2UAqzTWGpafOT6YfUJgED5m2F2m5NKrYlMPKMQkgPIqQaGhpwnK2hf 4Z2XWoomZyyhQMwAQ==MwgDEiEFOmOEA5w9J66CT8nG7LWl5x/Uyy8quduZS2EBzF8HolQaIQUUV5ApOiQnN cECsTvKWCH8wDMrQe4XtFTcxf88Tg61YSJiMwohBYakBsGB75jRG03R9fMYINhqZe4FSaoQG0xG0tFX3 xkJECsYACIwNlZdeJNP25nS7towrDIsDBlPcEWF2swJaOKMA74feroChSgsTfX15Jn4u35ei0WCAEJ7G BhO+hMomZyyhQMwAQ==MwhfEiEFfce91m91LPiK4a13nvGNPU/9EhNqXl6oiWS8TyN3zTgaIQUUV5ApOiQnN cECsTvKWCH8wDMrQe4XtFTcxf88Tg61YSJiMwohBXBVQIN5oLgT1OoYy1/7RfFRDoZVY7hoc35r/TKiL rVhECoYACIwIpwH38/F0uS/0uTj/EJbqufLKmXV/CHn1/2Fwnfm21FHCD+Q9olbVunQMMUvf3tWYIAvM sVs7CUomZyyhQMwAQ==hU6QBVDCIlQNg0yXLdIlVg==9JeJ FnC+yaEBGFnMwDJjIhI=I sent you an OMEMO encrypted message but your client doesnât seem to support that. Find more information on https://conversations.im/omemo
06-24 08:12:40.941 D/SMACK: RECV (0):
06-24 08:12:40.951 D/SMACK: SENT (0):
06-24 08:12:41.011 E/αTalk: [33] org.jivesoftware.smack.AbstractXMPPConnection.run() Exception in async packet listener
java.lang.NullPointerException: Attempt to invoke virtual method âint java.lang.Object.hashCode()â on a null object reference
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:746)
at org.jivesoftware.smackx.muc.MultiUserChat.getOccupantPresence(MultiUserChat.jav a:1667)
at org.jivesoftware.smackx.muc.MultiUserChat.getOccupant(MultiUserChat.java:1680)
at org.jivesoftware.smackx.omemo.OmemoService.getSender(OmemoService.java:1184)
at org.jivesoftware.smackx.omemo.OmemoService.access$000(OmemoService.java:106)
at org.jivesoftware.smackx.omemo.OmemoService$OmemoStanzaListener.processStanza(Om emoService.java:1229)
at org.jivesoftware.smack.AbstractXMPPConnection$4.run(AbstractXMPPConnection.java :1198)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
============ Conversations log message during startup ==============
D/conversations: ### SMACK SENT:
D/conversations: hawk@atalk.org: retrieved own device list: [1796289951, 793357486]
I/conversations: AxolotlService (hawk@atalk.org): Building new session for hawk@atalk.org:793357486
D/conversations: AxolotlService (hawk@atalk.org): Retrieving bundle:
D/conversations: ### SMACK SENT:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: AxolotlService (hawk@atalk.org): Received PEP device list ([1691254927, 1077854796, 887665691]) update from leopard@atalk.org, processingâŠ
D/conversations: ### SMACK RECV:
D/conversations: AxolotlService (hawk@atalk.org): Received PEP device list ([793357486]) update from abc123@atalk.org, processingâŠ
D/conversations: ### SMACK RECV:
D/conversations: AxolotlService (hawk@atalk.org): Received PEP device list ([37379719, 816614937, 2087839431]) update from swan@atalk.org, processingâŠ
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: AxolotlService (hawk@atalk.org): Received PEP device list ([1796289951, 793357486]) update from hawk@atalk.org, processingâŠ
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: hawk@atalk.org: finished mam after 0(0) messages. messages left=true
D/conversations: ### SMACK RECV:
D/conversations: hawk@atalk.org: joining conversation chatroom@conference.atalk.org/hawk
D/conversations: ### SMACK SENT: iQG4BAEBCgAiGxxjbWVuZyA8Y21lbmcuZ21AZ21haWwuY29tPgUCWMc G8AAKCRAnJWERuLqvl9O1C/wJqTV4Dnj5OAAF8LRF9x5PoXX3AXqexutZXY5GY7T1HDNwhzm2mDsRFjA 30JyjFXIApDKh3ywgh3oBanwMXqPEt/5S78fABnz8fQdXg4xf51r512rGkM0tJJeVhBe1Ss904ZOg8C6 U+i2wt3UJMaU7rlVo2ElvVxI7raQgtGORO9+RmE+4tDPR4QkBTFzcDyLBh5OTEvsk5RykjsPXX4fAkXd kmv1fjrmge3/1y7YDawmvJc1X8IWo/nME5Hp9SnfwtuAeYK8qZR+zeC5YxgSEibQz9FjoEXecLwlul8K KCu/DPRono8FpgBrT8I21Ll2a51OyGAW19vZZvluPEwdEB+JfprXoy3hTnz1yyTHkPKatxX8QjtRVUIK TdG780XglifH35fswZIMuIpzfvqL0vMYNGu0W8QDLY5Qs7YJYFnJPLV4WyaV4Ja903EcB/NrTZlhoccf yUYt3sUvCbeXfybaoqxDyYqyT+uYe9jQSl9XY3yMGcz5B3pLFBgZoZAE==MkF9
D/conversations: hawk@atalk.org: running mam query to=chatroom@conference.atalk.org, start=2017-06-24T00:43:30.960Z, end=2017-06-24T02:29:46.564Z, order=NORMAL, catchup=true
D/conversations: ### SMACK SENT: urn:xmpp:mam:02017-06-24T00:43:30.960Z2017-06-24T02:29:46.564Z50
D/conversations: ### SMACK SENT:
D/conversations: ### SMACK SENT:
D/conversations: ### SMACK SENT:
D/conversations: hawk@atalk.org: fetching members for Group Chat
D/conversations: hawk@atalk.org: fetched muc configuration for chatroom@conference.atalk.org - [vcard-temp, http://jabber.org/protocol/muc, muc_hidden, muc_persistent, muc_membersonly, muc_nonanonymous, muc_moderated, muc_unsecured, urn:xmpp:mam:tmp, urn:xmpp:mam:0, urn:xmpp:mam:1]
D/conversations: ### SMACK RECV:
D/conversations: AxolotlService (hawk@atalk.org): Received preKey IQ packet, processingâŠ
E/conversations: AxolotlService (hawk@atalk.org): Error building session for hawk@atalk.org:793357486: org.whispersystems.libaxolotl.InvalidKeyException, Invalid signature on device key!
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: hawk@atalk.org: finished mam after 0(0) messages. messages left=true
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: ### SMACK RECV:
D/conversations: hawk@atalk.org: retrieved members for chatroom@conference.atalk.org: [leopard@atalk.org, swan@atalk.org]
D/conversations: ### SMACK RECV:
W/art: Suspending all threads took: 9.797ms
D/conversations: ### SMACK SENT:
D/conversations: ### SMACK RECV:
D/conversations: deleted file /storage/emulated/0/WhatsApp/.Shared/H5uM7RD3qo6NN+f5MEVvNam88Pt8VjNXoPgIsOmvJ4 k=.enc.tmp
D/conversations: ### SMACK SENT:
D/conversations: ### SMACK RECV:
W/art: Suspending all threads took: 14.015ms
D/conversations: ### SMACK SENT:
D/conversations: ### SMACK RECV: