Bug 357462 - Decryption failure when message has no version header
Summary: Decryption failure when message has no version header
Status: CONFIRMED
Alias: None
Product: kgpg
Classification: Applications
Component: general (show other bugs)
Version: 2.14.0
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: Rolf Eike Beer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-03 07:58 UTC by Richard B
Modified: 2018-05-12 18:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 18.04.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard B 2016-01-03 07:58:18 UTC
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
Comment 1 nowi 2016-06-01 06:59:01 UTC
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
Comment 2 Kavinda 2018-05-08 22:43:55 UTC
The problem is that even though Gpg decrypts the message, it returns a exit code(2). Thus Kgpg thinks decryption failed.