vanitasvitae / Smack

A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs
https://igniterealtime.org/projects/smack/
Apache License 2.0
16 stars 3 forks source link

OmemoManager.getInstanceFor() returns different Object, when Manager was first created before connection login #29

Closed vanitasvitae closed 6 years ago

vanitasvitae commented 7 years ago

Reported here. This happens, when the OmemoManager was first created using OmemoManager.getIntanceFor(Connection) before the user logged in. In that case, there are two new jid folders in the OMEMO store: "user@server.tld" and "user".

When the client than tries to get an instance of the OmemoManager via getInstanceFor after the user logged in, it gets an instance, that has no key material, so processBundle will throw an exception.

I suggest to either only create the OmemoManager after login, or keep one instance of the OmemoManager around as a local variable. Nevertheless, this must be fixed.

vanitasvitae commented 6 years ago

fixed