Bug 346983 - KGpg editor accepts rich text (but it should not!)
Summary: KGpg editor accepts rich text (but it should not!)
Status: RESOLVED FIXED
Alias: None
Product: kgpg
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: Rolf Eike Beer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-30 21:32 UTC by Denis Pesotsky
Modified: 2015-05-14 17:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 15.04.2
Sentry Crash Report:


Attachments
Patch to disable rich text in KgpgTextEdit (685 bytes, patch)
2015-04-30 22:20 UTC, Denis Pesotsky
Details
Patch to disable rich text in KgpgTextEdit (1.00 KB, patch)
2015-04-30 22:33 UTC, Denis Pesotsky
Details
Rich text in editor (note line spacing) (111.57 KB, image/png)
2015-04-30 23:16 UTC, Denis Pesotsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Pesotsky 2015-04-30 21:32:35 UTC
When copy-pasting encrypted message from some web page to KGpg editor, it saves rich text insertions. Decryption fails with error message that contains decrypted message.

Reproducible: Always

Steps to Reproduce:
1. copy-paste encrypted message with rich text insertions to editor
2. try to decrypt it

Actual Results:  
Editor shows encrypted message

Expected Results:  
Decryption fails with error message that contains decrypted message

Decryption fails because gpg process fails with code 2, however [i guess] KGpgTextOrFileTransaction::decryptedText() still can output result.

Problem is fixed after adding "setAcceptRichText(false);" line to KgpgTextEdit constructor in editor/kgpgeditor.cpp. Of course it should not accept rich text!!!
Comment 1 Rolf Eike Beer 2015-04-30 21:37:04 UTC
Would you mind attaching a git patch?
Comment 2 Denis Pesotsky 2015-04-30 22:20:18 UTC
Created attachment 92348 [details]
Patch to disable rich text in KgpgTextEdit

Sure! But I thought that one-line changes are easier to apply by hand...
Comment 3 Denis Pesotsky 2015-04-30 22:33:44 UTC
Created attachment 92349 [details]
Patch to disable rich text in KgpgTextEdit

Oops, previous patch did not contain updated copyright years.
Comment 4 Denis Pesotsky 2015-04-30 23:16:03 UTC
Created attachment 92350 [details]
Rich text in editor (note line spacing)

Here is screenshot demonstrating current version with text from web (with rich text). It will not decrypt well.
Comment 5 Rolf Eike Beer 2015-05-01 07:27:41 UTC
This may also be the cause of bug 343063.
Comment 6 Rolf Eike Beer 2015-05-14 17:30:41 UTC
Git commit 5230123ab58170aad85e7e3b142aea681ce24dfe by Rolf Eike Beer, on behalf of Denis Pesotsky.
Committed on 14/05/2015 at 10:26.
Pushed by dakon into branch 'Applications/15.04'.

disable rich text in editor

When copy-pasting an encrypted message from some web page to KGpg editor, it
saves rich text insertions. This breaks the PGP message format, so decryption
fails.
FIXED-IN:15.04.2

M  +1    -0    editor/kgpgtextedit.cpp

http://commits.kde.org/kgpg/5230123ab58170aad85e7e3b142aea681ce24dfe