Mnkai / PGPClipper

PGPClipper for Android repository
Apache License 2.0
35 stars 12 forks source link

Crash on 0.2 when tapping the decrypted data result field #8

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello,

I finally could test version 0.2.

After processing successfully some data from the clipboard, the application crashes every time you tap the decrypted data result field.

https://gist.github.com/anonymous/a5342d08035326ff1e86

Mnkai commented 8 years ago

Hello,

To reproduce this bug, I need some more information. It looks like it's crashing while trying to parse reply email address (which references replying PGP key).

  1. Is decryption successful?
  2. Is the message signed?
  3. Did you enabled NFC token feature?

From my side, decrypting message with or without signature succeeded (NFC token feature enabled), and quick reply was working correctly. I was not able to reproduce this bug in this condition. (Nexus 5, Android 6 Stock)

ghost commented 8 years ago

Here you have:

  1. Yes, the decryption was successful (and the crash happens once the decrypted text is displayed and you tap on it)
  2. The message is signed.
  3. NFC authentication is disabled.

More information: the test was done in a Nexus 4, with the Android 5.1.1 stock version and the encrypted data was copied from Gmail application.

Mnkai commented 8 years ago

I've disabled NFC auth, but was still not able to reproduce bug.

Have you tried updating OpenKeychain? Also, does signature label have email address closed with <>? (Had to ask about this first...) screenshot_20151112-223919

I'll be installing some emulators to emulate Nexus 4 w/ 5.1.1 stock. This crashing is not expected.

ghost commented 8 years ago

That's how it looks the signature:

Signature status:0 (Facebook, Inc.)

Actually the bug must be due to the absence of an e-mail address in the signature.

The decrypted data is actually an email notification from Facebook which appears to use a PGP key without an associated email.

Mnkai commented 8 years ago

I did not expect signature without e-mail address... I'll try to fix that issue by treating signature without mail address as non-signed message when quick replying.

Mnkai commented 8 years ago

Quick fix in commit 9cca9b114e9002f4e9ac79cc8d43afe611e30e2a, could please check if this issue has been fixed?

Expected behavior: No crash when try to quick reply, user will be able to select recipient manually.

ghost commented 8 years ago

Sorry, it still crashes

https://gist.github.com/anonymous/bd2d85bef5ef6c26f90a

Mnkai commented 8 years ago

Next fix try at commit bdc4378d951bf95101a667b1a1afcfc467a877ed, please try that. Hopefully, it will catch StringIndexOutOfBoundsException - which is not checked and not caught at runtime at previous commit.

Sorry for repeated fix attempts, it's pretty hard to debug bugs which I cannot test it's fixed.

ghost commented 8 years ago

Ok, it looks fine now, when tapping it shows the prompt where you can manually fill the recipient.

Mnkai commented 8 years ago

Good news! Glad to hear that it's working.