0 Replies Latest reply on Jul 24, 2017 7:42 AM by cmeng

    Smack 4.2.1-beta2-SNAPSHOT OmemoManager#regnerate does not update server DeviceList

    cmeng

      The test arecarried out with the following two devices. aTalk client has reflection implementation as mentioned in

      https://community.igniterealtime.org/message/265585#comment-265585

       

      Devices under test:

      a. N3 -  leopard@atalk.org(Note3-aTalk)

      b. S3 - swan@atalk.org(S3-aTalk)

       

      Initially N3 and S3 are setup to communicate in Omemo mode and olmMessages sending between them are working as expected.

      Then performed an omemoDevice regeneration on S3. Check S3 sqlite database, and confirm all tables are correctly updated with the appropriate data for the new deviceID. S3 also publishes its new bundle data onto the xmpp server. However it was found that the server DeviceList is left untouched and still contains the old deviceID's.

       

      When an olmMessage is sent from S3, its sid reflected the new generated deviceID. N3 detects the new deviceID is not in its database, and sends RatchetUpdateMessage.

      //---

      07-24 21:36:05.509 D/SMACK: RECV (0): <message xml:lang='en' to='leopard@atalk.org/atalk' from='swan@atalk.org/atalk' type='chat' id='2BdE4-149'><encrypted xmlns='eu.siacs.conversations.axolotl'><header sid='949870470'><key rid='1011347036'>MwohBTukbWgBtdyMtlcLZumk3RRupsb5u+/KyTzyycJtyYwtEAEYASIwqdbm5e CLOfNC4rv4c+V9WBh1BsQDMQZdQBCqohFi4OQZpNJhZUBGreN+LgyQQLa4vTKVfRx+FhI=</key><iv> Jp5P+T5GPo7Qr1UFkIE6Uw==</iv></header><payload>OX97sw==</payload></encrypted><st ore xmlns='urn:xmpp:hints'/><encryption xmlns='urn:xmpp:eme:0' namespace='eu.siacs.conversations.axolotl' name='OMEMO'/><body>I sent you an OMEMO encrypted message but your client doesn’t seem to support that. Find more information on https://conversations.im/omemo</body><thread>849f7ecd-1fd8-400f-8180-b20218f6de01</thread></message>

      07-24 21:36:05.589 W/αTalk: [28] org.jivesoftware.smackx.omemo.OmemoStore.getOmemoSessionOf() getOmemoSessionOf could not load identityKey of swan@atalk.org:949870470: Loaded OMEMO IdentityKey is null for: swan@atalk.org:949870470

      07-24 21:36:05.589 I/αTalk: [28] org.jivesoftware.smackx.omemo.OmemoStore.getOmemoSessionOf() getOmemoSessionOf couldn't find an identityKey for swan@atalk.org:949870470. Initiate session without.

      07-24 21:36:05.599 W/αTalk: [28] org.jivesoftware.smackx.omemo.OmemoStore.getOmemoSessionOf() Can't update IdentityKey of swan@atalk.org:949870470: Loaded OMEMO IdentityKey is null for: swan@atalk.org:949870470

      07-24 21:36:05.599 I/αTalk: [28] org.jivesoftware.smackx.omemo.OmemoService.processStanza() Received message with invalid session from swan@atalk.org:949870470. Send RatchetUpdateMessage.

      -------//

       

      The S3 new bundle preKeys are then fetched from server and updated to its N3 tables. N3 then re-established new session with S3 new the deviceID.

      //-------

      07-24 21:36:05.629 D/SMACK: SENT (0): <iq to='swan@atalk.org' id='VBbv7-152' type='get'><pubsub xmlns='http://jabber.org/protocol/pubsub'><items node='eu.siacs.conversations.axolotl.bundles:949870470'/></pubsub></iq>

      07-24 21:36:05.709 D/SMACK: RECV (0): <iq xml:lang='en' to='leopard@atalk.org/atalk' from='swan@atalk.org' type='result' id='VBbv7-152'><pubsub xmlns='http://jabber.org/protocol/pubsub'><set xmlns='http://jabber.org/protocol/rsm'><index>0</index><count>1</count><first index='0'>creation@001500:903258:096289</first><last>creation@001500:903258:096 289</last></set><items node='eu.siacs.conversations.axolotl.bundles:949870470'><item id='5DCDC85A7EA2'><bundle xmlns='eu.siacs.conversations.axolotl'><signedPreKeyPublic signedPreKeyId='1'>BXBo2hKtYkXTfncroIgIO5JillmvK4Mb75C1YavoHG0s</signedPreKeyPu blic><signedPreKeySignature>BOjGMufrfrIDby06cBbCoHdw0Le5LykV8aPFwboHff4yhtA5/qVA 3VQL+BnhByI1ODkzWdTFcgKxpJkb13tEDg==</signedPreKeySignature><identityKey>BXLVgGw HJEUdquvvtJKRVEXuJPXZHm+vAYNP/YCpDOw5</identityKey><prekeys><preKeyPublic preKeyId='1'>BYXM7QFTXUAyyH6VzJQTsDtKppdzKuLKF7cwRp7+2uMp</preKeyPublic><preKey Public

      ....

      preKeyId='70'>BQh+Ze9GZ1tlpOo0RGVfaT0pDCuE/6ATsO5PaG3Uhe0q</preKeyPublic><preKey Public preKeyId='71'>BZRIKffpOXLPbiG9SIY/J8GpacCBUgYkUQPgUiRrYgEh</preKeyPublic><p

      07-24 21:36:06.089 I/αTalk: [28] org.jivesoftware.smackx.omemo.OmemoService.processBundle() Session built with swan@atalk.org:949870470

      ----//

       

      Send omemo message from N3 will prompt user to authenticate the new deviceID fingerprint.

      //-----

      07-24 21:36:06.089 W/αTalk: [28] org.jivesoftware.smackx.omemo.OmemoService.processStanza() internal omemoMessageListener failed to establish a session for incoming OMEMO message: org.whispersystems.libsignal.NoSessionException: No session for: swan@atalk.org:949870470

      07-24 21:42:53.879 I/αTalk: [1] org.atalk.android.aTalkApp.setCurrentActivity().323 Current activity set to org.atalk.crypto.omemo.OmemoAuthenticateDialog@35d158f9

      ----------//

       

      In order for N3 to build the olmMessage for all the required recipients, it also proceeds to fetch the deviceList.

      //------------

      07-24 21:43:00.149 D/SMACK: SENT (0): <iq to='swan@atalk.org' id='VBbv7-157' type='get'><pubsub xmlns='http://jabber.org/protocol/pubsub'><items node='eu.siacs.conversations.axolotl.devicelist'/></pubsub></iq>

      07-24 21:43:00.169 D/SMACK: RECV (0): <iq xml:lang='en' to='leopard@atalk.org/atalk' from='swan@atalk.org' type='result' id='VBbv7-157'><pubsub xmlns='http://jabber.org/protocol/pubsub'><set xmlns='http://jabber.org/protocol/rsm'><index>1</index><count>1</count><first index='1'>creation@001500:891555:861306</first><last>creation@001500:891555:861 306</last></set><items node='eu.siacs.conversations.axolotl.devicelist'><item id='5DCD9AA3D1D09'><list xmlns='eu.siacs.conversations.axolotl'><device id='1143446743'/><device id='816614937'/></list></item></items></pubsub></iq>

      -------------//

       

      However since the DeviceList has not being updated by S3, all olmMessages created are without the new <key rid/>

      //-----

      07-24 21:46:27.249 D/SMACK: SENT (0): <message to='swan@atalk.org' id='VBbv7-162' type='chat'><body>I sent you an OMEMO encrypted message but your client doesn’t seem to support that. Find more information on https://conversations.im/omemo</body><thread>25081f9e-474a-4530-b543-9a0119f72513</thread><encrypted xmlns='eu.siacs.conversations.axolotl'><header sid='1011347036'><key rid='1143446743'>MwohBczmmmQL93WTEseJqtqmbx2WCL7Od+3buZiarfVJhgcMEAEYASIwyBMV+t7Li+UNqDViMtt0Az03 fdTWD+563pWE7QhE9bHpKu3Q8OQlGZ20h+4MIc74+BbnEopyH2s=</key><key rid='816614937'>MwohBQIJPQbsCh74AsZCpMg7dIjQNZi4QD8+p9DNip4yZhsqEB0YAyIw7katLPldTE169ETsVVnNSwUC 5Ou3XJimAyR/ao5fjLIKDQTVa7sgoqHBT3VaNBcxsAccsA6M59E=</key><iv>FlCdRUh7DUZzTiyHGf CJfA==</iv></header><payload>HJ94NQ==</payload></encrypted><store xmlns='urn:xmpp:hints'/><encryption xmlns='urn:xmpp:eme:0' namespace='eu.siacs.conversations.axolotl' name='OMEMO'/></message><r xmlns='urn:xmpp:sm:3'/>

      -----//

       

      Therefore N3 and S3 omemo session cannot proceed further. S3 must restarts in order to get subscribeToDeviceLists() to update the DeviceList on the server.

      Note: atalk must implement as per below link to get subscribeToDeviceLists() to work properly.

      https://community.igniterealtime.org/message/265585#comment-265585