zom / Zom-iOS-XMPP

THIS PROJECT IS NOW CLOSED. WE HAVE MOVED TO A NEW ZOM 2.0 MATRIX CORE. FOLLOW THE LINK!
https://github.com/zom/zom-ios-matrix
Mozilla Public License 2.0
37 stars 23 forks source link

Account password not stored (iOS keychain issue) #191

Closed n8fr8 closed 7 years ago

n8fr8 commented 7 years ago

I think I have solved the disappearing account password issue. Both R and I were using devices that may have not had the keychain enabled (Is that possible?). She had a new device, and I had been messing around with settings, and was getting prompted to re-enable the iCloud keychain, or something along those lines.

Is it possible, that the app could work without the keychain (since you are starting with a default key/password for the database), but that the account password would be not stored if the keychain wasn't properly setup?

Can we either A) alert the user that they need to setup their keychain or B) not depend on the keychain for the account passwords?

Does this make sense?

chrisballinger commented 7 years ago

iCloud Keychain is not required for the regular keychain to work and requires no setup for the end user. The keychain API we use has been available since the original iPhone was released.

Since the database password is stored in the keychain, it means that the keychain itself is working properly, since I've never seen a database decryption error except when migrating a backup to a new device (this is intentional). We must have a bug in our code that wipes the account password(s). I think we should resolve this by moving the account passwords to inside the database, because it's already encrypted by a strong password in the keychain.

n8fr8 commented 7 years ago

FYI This happened to Kate as well, so seems like a blocker for this release. We need to fix this!

n8fr8 commented 7 years ago

Also, this doesn't seem to have happened before this latest testflight. No one had reported it before.

chrisballinger commented 7 years ago

I think the entitlement isn't enough to fix it, so I did a big refactor which hopefully fixes it. Although it's based off the omemo branch, we could probably easily cherry-pick it into the develop branch.

https://github.com/ChatSecure/ChatSecure-iOS/pull/595