Omemo pubsub scribption

aTalk v5.2.1 is using smack 4.5.0-rc1. Below are few areas need some clarifications for omemo operation. Appreciate if someone can help.

Per XEP-0060: Publish-Subscribe requirement, an entity is required to subsribe to the publish note i.e. urn:xmpp:omemo:2:devicesvia PEP, in order to be notified for any update to the contact’s omemo deviceList via:

However on review smack omemo library source, or via aTalk testing, I am unable to find smack is making an attemp to subscribe the required omemo node.

  1. During testing, I found that pubsub#event stanzas are sent when user first sign in to the network. but only for for some deivces.
  2. How is smack being notified if there is any contact omemoDevices updates.
  3. I see that there is a function OmemoManager#requestDeviceListUpdateFor(), is smack recommending using this function instead, to get the intented recipient deviceList before any omemo messages are being sent.

13:58:38.720 W [337] org.jivesoftware.smackx.omemo.OmemoService.onOmemoMessageStanzaReceived() No raw session found for contact peacock@atalk.sytes.net:540219911.
org.jivesoftware.smackx.omemo.exceptions.NoRawSessionException: org.whispersystems.libsignal.InvalidMessageException: No valid sessions.
at org.jivesoftware.smackx.omemo.signal.SignalOmemoRatchet.doubleRatchetDecrypt(SignalOmemoRatchet.java:128)
at org.jivesoftware.smackx.omemo.OmemoRatchet.retrieveMessageKeyAndAuthTag(OmemoRatchet.java:110)
at org.jivesoftware.smackx.omemo.OmemoService.decryptMessage(OmemoService.java:471)
at org.jivesoftware.smackx.omemo.OmemoService.onOmemoMessageStanzaReceived(OmemoService.java:1260)
at org.jivesoftware.smackx.omemo.OmemoManager$3.run(OmemoManager.java:1122)
at java.lang.Thread.run(Thread.java:1012)
Caused by: org.whispersystems.libsignal.InvalidMessageException: No valid sessions.
at org.whispersystems.libsignal.SessionCipher.decrypt(SessionCipher.java:290)
at org.whispersystems.libsignal.SessionCipher.decrypt(SessionCipher.java:243)
at org.whispersystems.libsignal.SessionCipher.decrypt(SessionCipher.java:211)
at org.jivesoftware.smackx.omemo.signal.SignalOmemoRatchet.doubleRatchetDecrypt(SignalOmemoRatchet.java:122)
at org.jivesoftware.smackx.omemo.OmemoRatchet.retrieveMessageKeyAndAuthTag(OmemoRatchet.java:110)
at org.jivesoftware.smackx.omemo.OmemoService.decryptMessage(OmemoService.java:471)
at org.jivesoftware.smackx.omemo.OmemoService.onOmemoMessageStanzaReceived(OmemoService.java:1260)
at org.jivesoftware.smackx.omemo.OmemoManager$3.run(OmemoManager.java:1122)
at java.lang.Thread.run(Thread.java:1012)
Caused by: org.whispersystems.libsignal.InvalidMessageException: Bad Mac!
at org.whispersystems.libsignal.protocol.SignalMessage.verifyMac(SignalMessage.java:119)
at org.whispersystems.libsignal.SessionCipher.decrypt(SessionCipher.java:313)
at org.whispersystems.libsignal.SessionCipher.decrypt(SessionCipher.java:268)
at org.whispersystems.libsignal.SessionCipher.decrypt(SessionCipher.java:243)
at org.whispersystems.libsignal.SessionCipher.decrypt(SessionCipher.java:211)
at org.jivesoftware.smackx.omemo.signal.SignalOmemoRatchet.doubleRatchetDecrypt(SignalOmemoRatchet.java:122)
at org.jivesoftware.smackx.omemo.OmemoRatchet.retrieveMessageKeyAndAuthTag(OmemoRatchet.java:110)
at org.jivesoftware.smackx.omemo.OmemoService.decryptMessage(OmemoService.java:471)
at org.jivesoftware.smackx.omemo.OmemoService.onOmemoMessageStanzaReceived(OmemoService.java:1260)
at org.jivesoftware.smackx.omemo.OmemoManager$3.run(OmemoManager.java:1122)
at java.lang.Thread.run(Thread.java:1012)
13:58:38.720 W [337] org.jivesoftware.smackx.omemo.OmemoService.repairBrokenSessionWithPreKeyMessage() Attempt to repair the session by sending a fresh preKey message to peacock@atalk.sytes.net:540219911

  1. No valid sessions.: I see that there is a session record, and identity entry in database for peacock@atalk.sytes.net:540219911, but seem not valid. How to find out the reason why this is the case.

  2. Attempt to repair the…: I can see that smack has made access to peacock@atalk.sytes.net:540219911 bundles etc However the same errors persist for all subsequent omemo message received. Any explanation.

From the link below: 3.3 Subscribers Receive Metadata Notification.

I assume this is equally applied to the case of the omemoDeviceList event sending, then it explains why smack-omemo does not need to subscribe to the OmemoDeviceList to receive the event i.e.

I have traced the process for

Attempt to repair the session…

Confirmed that smack did perform update to the omemdoDevice identities and the raw Session records in the database. But still all subsequent received Omemo Messages still throw the same exception.

Any comments?