I was trying to decrypt a message which had no GPG version header in it. I would get a "Decryption failed" notice. When clicking on the "Details" button, it would show the program's steps of decrypting, but would also display the message in there. So I figured it was weird that it says failure, but has the message decrypted correctly anyway. I have since did more testing with this bug, and found an easy workaround. All that was missing was a blank line before the cipher-text. Problem was the sender of said message uses a different GPG frontend that when using the --no-version option, doesn't include that blank line. Reproducible: Always Steps to Reproduce: 1. Be sent an encrypted message without the version header (and no blank line/whitespace between the begin PGP message header and ciphertext.) 2. Decrypt message 3. Check for more details, find message in there. Actual Results: I was able to read my message within the detailed program logs of the decryption failure notice. Expected Results: Ideally, it should have been able to detect whether or not there's a whitespace/version header or otherwise isolate on the cipher-text, and decrypt text accordingly without causing a false failure. Of course the simple fix is to add in a whitespace yourself between begin pgp message header and cipher-text. Details of failed decryption notice: [GNUPG:] NEED_PASSPHRASE **************** **************** 1 0 [GNUPG:] GOT_IT [GNUPG:] BEGIN_DECRYPTION [GNUPG:] DECRYPTION_INFO 0 3 [GNUPG:] PLAINTEXT 62 1451806294 [GNUPG:] PLAINTEXT_LENGTH 14 THIS IS A BUG [GNUPG:] DECRYPTION_OKAY [GNUPG:] END_DECRYPTION
I can confirm this confusing behaviour. Kgpg failure notice should not include the decrypted message. bye nowi KGpg Version 2.17.0 KDE 4.14.16
The problem is that even though Gpg decrypts the message, it returns a exit code(2). Thus Kgpg thinks decryption failed.