powered by Jive Software

Omemo on Android 9 unusable!

omemo

#1

Hi,
I am using Omemo 4.4.0-alpha2-SNAPSHOT (also tried with alpha1) on an Android app that works from API 21+ and I just found out that on API 28+ (Android P (9.0)) you cannot encrypt messages using OmemoManager. The reason why, seems pretty clear by the explanation on the exception in throws.

E/XmppService: XmppServiceConnection - Error while sending pending messages
    org.jivesoftware.smackx.omemo.exceptions.CryptoFailedException: java.security.NoSuchAlgorithmException: The BC provider no longer provides an implementation for Cipher.AES/GCM/NoPadding.  Please see https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html for more details.
        at org.jivesoftware.smackx.omemo.OmemoService.encrypt(OmemoService.java:375)
        at org.jivesoftware.smackx.omemo.OmemoService.createOmemoMessage(OmemoService.java:537)
        at org.jivesoftware.smackx.omemo.OmemoManager.encrypt(OmemoManager.java:341)
        at org.jivesoftware.smackx.omemo.OmemoManager.encrypt(OmemoManager.java:314)
        at es.iecisa.xmppservice.XmppServiceConnection.lambda$sendMessage$0(XmppServiceConnection.java:516)
        at es.iecisa.xmppservice.-$$Lambda$XmppServiceConnection$aBU_80chagvypMTSd-aSm7pRQRY.run(Unknown Source:4)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.security.NoSuchAlgorithmException: The BC provider no longer provides an implementation for Cipher.AES/GCM/NoPadding.  Please see https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html for more details.
        at sun.security.jca.Providers.checkBouncyCastleDeprecation(Providers.java:563)
        at sun.security.jca.Providers.checkBouncyCastleDeprecation(Providers.java:346)
        at javax.crypto.Cipher.createCipher(Cipher.java:722)
        at javax.crypto.Cipher.getInstance(Cipher.java:717)
        at javax.crypto.Cipher.getInstance(Cipher.java:674)
        at org.jivesoftware.smackx.omemo.util.OmemoMessageBuilder.setMessage(OmemoMessageBuilder.java:169)
        at org.jivesoftware.smackx.omemo.util.OmemoMessageBuilder.<init>(OmemoMessageBuilder.java:116)
        at org.jivesoftware.smackx.omemo.OmemoService.encrypt(OmemoService.java:372)
        at org.jivesoftware.smackx.omemo.OmemoService.createOmemoMessage(OmemoService.java:537) 
        at org.jivesoftware.smackx.omemo.OmemoManager.encrypt(OmemoManager.java:341) 
        at org.jivesoftware.smackx.omemo.OmemoManager.encrypt(OmemoManager.java:314) 
        at es.iecisa.xmppservice.XmppServiceConnection.lambda$sendMessage$0(XmppServiceConnection.java:516) 
        at es.iecisa.xmppservice.-$$Lambda$XmppServiceConnection$aBU_80chagvypMTSd-aSm7pRQRY.run(Unknown Source:4) 
        at java.lang.Thread.run(Thread.java:764) 

Are you aware of this issue?
Is there anything I can do to sort it out or do I have to wait for a fix?

Thank you very much.


#2

I got aware of this issue a few days ago. Looks like I’ll have to fix smack-omemo to allow different crypto providers than BC.

I’m not sure if you can fix this locally on your own though, but I’ll prepare a fix.


#3

@Flow prepared a fix for this which might get merged pretty soon:


#4

Good morning Paul, we are implementing omemo in one of our Android apps. Do you know when this patch is going to be realised? Is there any planning to release smack 4.4.0 any soon?

Thanks in advance


#5

As part of my unpaid spare-time development I do not provide or guarantee any ETAs about a release. You can always use a nightly snapshot release.


#6

Thanks. I have included the fixes into aTalk v.1.8.2 and is working perfectly.