signalapp / Flock

Private contact and calendar sync for Android.
https://signal.org/blog/flock
358 stars 80 forks source link

Unknown cryptography error #72

Closed tildelowengrimm closed 9 years ago

tildelowengrimm commented 9 years ago

When I open the Flock app on my Android device, I tap Begin, select that I want to use Flock Sync, and hit Next. I'm asked whether I have a Flock account. I do, so I tap Yes, log me in and enter my username and (long) password then tap Next. A swirly status indicator appears in the top right corner of the Flock window, then an Android overlay appears, saying

Unknown cryptography error, please send debug logs.

I'm unable to log into my Flock account using the app on my device. What can I do to log in an try to troubleshoot this issue? Where can I find the debug logs from my client?

rhodey commented 9 years ago

We recently added support for submitting debug logs via Flock however I am now realizing that this feature is only accessible after having successfully setup Flock 0.o bad oversight, sorry!

I'll try to fix this tonight and publish a new update to Google Play, after that you can update and will be able to get a debug log for this error. In the meantime if you have the android developer tools installed on a computer you can use the "adb logcat" command to get debug logs from a connected device.

rhodey commented 9 years ago

Hello @flamsmark , just checking in to let you know that early this morning I published a new Flock update to Google Play which allows for use of the "Send debug log" feature from within the setup process.

If you could update Flock and provide a debug log I think we'd have a good chance of identifying the issue, thanks! :)

tildelowengrimm commented 9 years ago

Hi @rhodey. Thanks for making that change. My debug log is at https://gist.github.com/anonymous/e595976b5d6edd10173c.

rhodey commented 9 years ago

Sorry for dropping the ball on this!

The keys used to encrypt and decrypt all Flock data are stored on the WebDAV server (encrypted by a PBKDF2 of your passphrase), in order to bootstrap a new client these keys need to be pulled down and decrypted. This debug log hints to your key material being corrupted or missing entirely from the WebDAV server which is unfortunately one of the worst failure modes possible :|

About 1-2 months ago there was a mandatory migration process that all Flock clients had to go through in order to make way for a protocol change, it is possible that if Flock was uninstalled sometime during this process that your remote key material would be deleted and never replaced. Do you recall encountering any strange Flock behavior during the migration process? During migration there would have been a Flock notification in the notification drawer indicating progress and the main menu UI would show a blue cloud instead of orange or green.

Migration was a serious headache but thankfully shouldn't need to happen again. In preparation for this headache a created a backup of the Flock Sync database so as long as you remember your password it is theoretically possible to restore your contacts and calendars if you are without another copy or backup.

tildelowengrimm commented 9 years ago

I sure do. That Flock migration notice sat in my notification bar for a long time — weeks. That's what prompted me to uninstall and re-install Flock. Could it be that my passphrase tripped something up?

I don't really care about the data; I have all that elsewhere. I just want to recover control of my username & subscription. It'd be neat if there were a way for crazy users (like me) to backup their master key, just in case.

rhodey commented 9 years ago

Heh, wow, well then I certainly can't blame you for uninstalling. "Could it be that my passphrase tripped something up?", I can't think of a situation where this would be the case but might be missing some context, could you elaborate?

The master keys are saved in Android's SharedPreferences (the "shared" is misleading) which are handled by every back up process or app I'm aware of. There are some backup operations I would like Flock to support, though, so this feature could likely be supported in-app in the future.

I'll take care of removing your account from Flock Sync today, once that's done you will be able to re-register your username and after that I will be able to restore your subscription credits. Sorry for all the trouble! There were two bugs in the Flock migration process that I'm aware of, they were patched shortly after the first migration release but my intuition is that your app started migration early and was unfortunately affected by one of the two bugs.

tildelowengrimm commented 9 years ago

I meant that my passphrase is quite long, and I've seen other applications react poorly to long passphrases.

rhodey commented 9 years ago

Ahh, I see. I don't believe that is the case. SharedPreferences has no string length limitations as far as I'm aware and server-side we hash the auth_token (which is really a PBKDF2 of your passphrase) with SHA512 + salt so there is no trouble with it fitting in DB.

Migration required that all remote address books and calendars be replaced, one early bug would cause the migration service to loop endlessly if deleting any remote collections (address book or calendar) failed-- I noticed this happen to a friend and pushed out an update but I suspect your app may have suffered from this bug as well before the update :/

Your account has been unregistered and you should now be able to re-register if you wish, after re-registering let me know and I'll reapply the subscription credit.

tildelowengrimm commented 9 years ago

All re-created and ready to go!

rhodey commented 9 years ago

great! I added 1024 days credit to your subscription, if you're able to see this in the "Manage subscription" activity then we should be all set :)

tildelowengrimm commented 9 years ago

Looks good to me. Thanks!