Bug #5942

Zoe-Android <-> ChatSecure-iOS compatibility

Added by Anonymous over 2 years ago.

Status:NewStart date:10/07/2015
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Component:

Description

Zom-Android (head of master: 98e19bd55b2640fa9bab585b166b9bd25f039048) and ChatSecure-iOS (head of develop: ae94a2e34dc54c632b406d3780a25fe923cb9fd2) very often fail to establish an OTR Session.

The exception seen on Android:

E/Zom: error+decrypting+message
E/Zom: net.java.otr4j.crypto.OtrCryptoException: java.security.InvalidKeyException: DHKeyAgreement doPhase requires DHPublicKey
E/Zom:     at net.java.otr4j.crypto.OtrCryptoEngineImpl.generateSecret(OtrCryptoEngineImpl.java:229)
E/Zom:     at net.java.otr4j.session.AuthContextImpl.getS(AuthContextImpl.java:275)
E/Zom:     at net.java.otr4j.session.SessionImpl.setSessionStatus(SessionImpl.java:204)
E/Zom:     at net.java.otr4j.session.SessionImpl.transformReceiving(SessionImpl.java:358)
E/Zom:     at net.java.otr4j.OtrEngineImpl.transformReceiving(OtrEngineImpl.java:77)
E/Zom:     at org.awesomeapp.messenger.crypto.OtrChatManager.decryptMessage(OtrChatManager.java:283)
E/Zom:     at org.awesomeapp.messenger.crypto.OtrChatListener.onIncomingMessage(OtrChatListener.java:51)
E/Zom:     at org.awesomeapp.messenger.model.ChatSession.onReceiveMessage(ChatSession.java:237)
E/Zom:     at org.awesomeapp.messenger.plugin.xmpp.XmppConnection$3.processPacket(XmppConnection.java:1443)
E/Zom:     at org.jivesoftware.smack.AbstractXMPPConnection$3.run(AbstractXMPPConnection.java:1105)
E/Zom:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
E/Zom:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
E/Zom:     at java.lang.Thread.run(Thread.java:818)
E/Zom:  Caused by: java.security.InvalidKeyException: DHKeyAgreement doPhase requires DHPublicKey
E/Zom:     at com.android.org.bouncycastle.jcajce.provider.asymmetric.dh.KeyAgreementSpi.engineDoPhase(KeyAgreementSpi.java:95)
E/Zom:     at javax.crypto.KeyAgreement.doPhase(KeyAgreement.java:383)
E/Zom:     at net.java.otr4j.crypto.OtrCryptoEngineImpl.generateSecret(OtrCryptoEngineImpl.java:223)
E/Zom:     at net.java.otr4j.session.AuthContextImpl.getS(AuthContextImpl.java:275) 
E/Zom:     at net.java.otr4j.session.SessionImpl.setSessionStatus(SessionImpl.java:204) 
E/Zom:     at net.java.otr4j.session.SessionImpl.transformReceiving(SessionImpl.java:358) 
E/Zom:     at net.java.otr4j.OtrEngineImpl.transformReceiving(OtrEngineImpl.java:77) 
E/Zom:     at org.awesomeapp.messenger.crypto.OtrChatManager.decryptMessage(OtrChatManager.java:283) 
E/Zom:     at org.awesomeapp.messenger.crypto.OtrChatListener.onIncomingMessage(OtrChatListener.java:51) 
E/Zom:     at org.awesomeapp.messenger.model.ChatSession.onReceiveMessage(ChatSession.java:237) 
E/Zom:     at org.awesomeapp.messenger.plugin.xmpp.XmppConnection$3.processPacket(XmppConnection.java:1443) 
E/Zom:     at org.jivesoftware.smack.AbstractXMPPConnection$3.run(AbstractXMPPConnection.java:1105) 
E/Zom:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
E/Zom:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
E/Zom:     at java.lang.Thread.run(Thread.java:818) 

The error condition seen on iOS:

* thread #18: tid = 0x3c2bd, 0x0000000100d54998 OTRKit`-[OTRKit errorForGPGError:](self=0x0000000155553640, _cmd="errorForGPGError:", gpg_error=536870967) + 588 at OTRKit.m:931, queue = 'OTRKit Internal Queue', stop reason = breakpoint 15.1
    frame #0: 0x0000000100d54998 OTRKit`-[OTRKit errorForGPGError:](self=0x0000000155553640, _cmd="errorForGPGError:", gpg_error=536870967) + 588 at OTRKit.m:931
  * frame #1: 0x0000000100d5e108 OTRKit`handle_msg_event_cb(opdata=0x000000015554ff40, msg_event=OTRL_MSGEVENT_SETUP_ERROR, context=0x0000000155689b60, message=0x0000000000000000, err=536870967) + 600 at OTRKit.m:425
    frame #2: 0x0000000100e3f238 OTRKit`send_or_error_auth + 460
    frame #3: 0x0000000100e3d420 OTRKit`otrl_message_receiving + 3360
    frame #4: 0x0000000100d513fc OTRKit`__58-[OTRKit decodeMessage:username:accountName:protocol:tag:]_block_invoke(.block_descriptor=<unavailable>) + 684 at OTRKit.m:712
    frame #5: 0x0000000101e49d70 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #6: 0x0000000101e49d30 libdispatch.dylib`_dispatch_client_callout + 16
    frame #7: 0x0000000101e567f0 libdispatch.dylib`_dispatch_queue_drain + 1036
    frame #8: 0x0000000101e4da20 libdispatch.dylib`_dispatch_queue_invoke + 464
    frame #9: 0x0000000101e58908 libdispatch.dylib`_dispatch_root_queue_drain + 760
    frame #10: 0x0000000101e58600 libdispatch.dylib`_dispatch_worker_thread3 + 132
    frame #11: 0x00000001999e9478 libsystem_pthread.dylib`_pthread_wqthread + 1092

Also available in: Atom PDF