AnsweredAssumed Answered

Smack Omemo Identities Regenerate failed on slow android device due to reply timeout

Question asked by cmeng on Aug 21, 2017
Latest reply on Aug 26, 2017 by cmeng

Below is the captured log for Samsung S3 when for aTalk when user triggers the omemoDevice identities regenerate option. It looks like the regenerate of the 100 identity keys takes a long time for a slow device like S3. Smack Omemo throws reply timeout even before the prekeys are published to the server.

Because of the reply timeout exception, the device omemo database may be left in an inconsistent, not working state.

May be omemo should only check for reply after the preKeys bundle has been published to the server. This itself already taken more than 6 seconds.

 

By the way, I see there is not action taken by Omemo when an corrupted keyPairs is encountered. Is manually regenerate the omemoDevice identities by the user, the correct approach to rectify the problem? Any better alternative like keyPairs repairing or delete the corrupted keyPairs etc?

 

============ aTalk log for omemo identities regeneration process ===========

08-22 09:32:25.430 E/αTalk: [10] org.jivesoftware.smackx.omemo.OmemoManager.run() connectionListener.authenticated() failed to initialize OmemoManager: Invalid IdentityKeyPair for omemoDevice: swan@atalk.org:949870470; com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).

08-22 09:33:42.155 I/αTalk: [1] org.jivesoftware.smackx.omemo.OmemoStore.isAvailableDeviceId() Check if id 1048500688 is available...

08-22 09:33:42.625 I/αTalk: [1] org.jivesoftware.smackx.omemo.OmemoStore.regenerate() Regenerating with deviceId 1048500688...

08-22 09:33:42.805 I/αTalk: [1] org.atalk.crypto.omemo.SQLiteOmemoStore.storeOmemoIdentityKeyPair().490 Store omemo identityKeyPair for :swan@atalk.org:1048500688

08-22 09:34:10.140 W/System.err: org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). Waited for response using: IQReplyFilter: iqAndIdFilter (AndFilter: (OrFilter: (IQTypeFilter: type=error, IQTypeFilter: type=result), StanzaIdFilter: id=REV4j-122)), : fromFilter (OrFilter: (FromMatchesFilter (full): swan@atalk.org, FromMatchesFilter (full): null)).

08-22 09:34:10.150 W/System.err:     at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:2 53)

08-22 09:34:10.155 W/System.err:     at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:2 08)

08-22 09:34:10.160 W/System.err:     at org.jivesoftware.smackx.pubsub.LeafNode.send(LeafNode.java:350)

08-22 09:34:10.160 W/System.err:     at org.jivesoftware.smackx.pubsub.LeafNode.send(LeafNode.java:325)

08-22 09:34:10.165 W/System.err:     at org.jivesoftware.smackx.pubsub.PubSubManager.tryToPublishAndPossibleAutoCreate( PubSubManager.java:394)

08-22 09:34:10.170 W/System.err:     at org.jivesoftware.smackx.omemo.OmemoService.publishBundle(OmemoService.java:301)

08-22 09:34:10.170 W/System.err:     at org.jivesoftware.smackx.omemo.OmemoManager.regenerate(OmemoManager.java:408)

08-22 09:34:10.175 W/System.err:     at org.atalk.crypto.omemo.OmemoRegenerateDialog$2.onClick(OmemoRegenerateDialog.ja va:103)

08-22 09:34:10.175 W/System.err:     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertContr oller.java:167)

08-22 09:34:10.180 W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:99)

08-22 09:34:10.185 W/System.err:     at android.os.Looper.loop(Looper.java:137)

08-22 09:34:10.185 W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:4507)

08-22 09:34:10.190 W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)

08-22 09:34:10.190 W/System.err:     at java.lang.reflect.Method.invoke(Method.java:511)

08-22 09:34:10.195 W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)

08-22 09:34:10.195 W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)

08-22 09:34:10.200 W/System.err:     at dalvik.system.NativeStart.main(Native Method)

08-22 09:35:57.745 D/SMACK: SENT (0): <iq to='swan@atalk.org' id='REV4j-122' type='set'><pubsub xmlns='http://jabber.org/protocol/pubsub'><publish node='eu.siacs.conversations.axolotl.bundles:1048500688'><item><bundle xmlns='eu.siacs.conversations.axolotl'><signedPreKeyPublic signedPreKeyId='1'>BfPxdS23oVEfhhzpWX2+NUGOb/1eK5EFahSA1SBjWcQs</signedPreKeyPu blic><signedPreKeySignature>liXX/jyK4zuFebHqlzsQzf8GQM9HkFPMcpaxMp+JWUs3MQ5rq5Q1 lJYdg7o6JkDarOSUt4Es+HnudQzF0WbKDA==</signedPreKeySignature><identityKey>BRfiyZY 5m3R0CqkH3LGf/IBZIuqwkXoGMa4dT73jVMwk</identityKey><prekeys><preKeyPublic preKeyId='1'>BcNqCCZx1UYohPcRhd/LN5yN8v5xhJdyin9kXgptkiR6</preKeyPublic><preKey Public

....

preKeyId='37'>BZm8g4pvVOzsw/6uw512HOOxDszrSXRa0oQuQEtEjj5L</preKeyPublic><preKey Public preKeyId='42'>Bd3RHkVIvOfkHgrdBNXIBumqb87EuHwFlF7Wr/qR6I9l</preKeyPublic><preKe yPublic preKeyId='43'>BVw/7biP1O/oFtiAxjTPh

08-22 09:35:57.745 D/SMACK: SENT (0): </pubsub></iq>

08-22 09:36:02.990 D/SMACK: SENT (0): <iq to='atalk.org' id='REV4j-123' type='get'><query xmlns='http://jabber.org/protocol/disco#items'></query></iq>

08-22 09:36:03.905 D/SMACK: RECV (0): <iq xml:lang='en' to='swan@atalk.org/atalk' from='swan@atalk.org' type='result' id='REV4j-122'><pubsub xmlns='http://jabber.org/protocol/pubsub'><publish node='eu.siacs.conversations.axolotl.bundles:1048500688'><item id='5DF594BA215'/></publish></pubsub></iq>

Outcomes