Bug 116351 - Encryption with two or more keys causes General input/output error
Summary: Encryption with two or more keys causes General input/output error
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: himajin100000
URL:
Whiteboard: target:6.1.0 target:6.0.3
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-11 19:47 UTC by himajin100000
Modified: 2018-03-15 15:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description himajin100000 2018-03-11 19:47:53 UTC
Description:
see steps to reproduce

Steps to Reproduce:
1. Create two sets of OpenPGP key pairs ,both for encryption. ( I call them as e1@example.com and e2@example.com)
2. Run Writer
3. File->Save As
4. Check "Encrypt with GPG keys"
5. Save As "Untitled 1.odt"
6. A dialog with "Select Certificate" as its title appears.
7. Hold Ctrl Key and Select e1@example.com and e2@example.com
8. Click Encrypt

Actual Results:  
A dialog appers. The message there is

Error saving the document Untitled 1:
General Error.
General input/output error.

here you cannot save this file even without GPG keys

Expected Results:
No Error


Reproducible: Always


User Profile Reset: No



Additional Info:
https://opengrok.libreoffice.org/xref/core/package/source/manifest/ManifestExport.cxx?r=ddd43218#235
xNewAttrList declared here is not cleared anywhere.

so if you have two or more keys,
https://opengrok.libreoffice.org/xref/core/package/source/manifest/ManifestExport.cxx?r=ddd43218#272
https://opengrok.libreoffice.org/xref/core/package/source/manifest/ManifestImport.cxx?r=ddd43218#69
https://opengrok.libreoffice.org/xref/core/package/source/manifest/ManifestDefines.hxx?r=3f775118#46

it would mean there would be two loext:PGPAlgorithm for the same element. Of course this is wrong.

if you have enabled dbgutil when you configure before you make your own build,
you can be more sure of that, as you will see an assertion error.
https://opengrok.libreoffice.org/xref/core/sax/source/expatwrap/saxwriter.cxx?r=0a1d5af2#626

there seems no clear() method thing-y for xml::sax::XAttributeList, I will just remove these declarations and declare them in for-loop that begins at

https://opengrok.libreoffice.org/xref/core/package/source/manifest/ManifestExport.cxx?r=ddd43218#249

in the patch I will submit.


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Comment 1 himajin100000 2018-03-11 19:56:54 UTC
submission done.
https://gerrit.libreoffice.org/#/c/51087/
Comment 2 himajin100000 2018-03-11 20:13:56 UTC
oops, I was linking to the wrong area.
instead of ManifestImport.cxx?r=ddd43218#69, 

https://opengrok.libreoffice.org/xref/core/package/source/manifest/ManifestExport.cxx?r=ddd43218#78

was the correct one.
Comment 3 Commit Notification 2018-03-13 23:20:32 UTC
himajin100000 committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=32f42d093d4408666151d03f04823e2bb39e46cd

tdf#116351: fix re-use of AttributeList on PGP manifest

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2018-03-15 15:47:05 UTC
himajin100000 committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ce5d2cd0d9fe0c04fde50ba54fb4ca154f2bdf12&h=libreoffice-6-0

tdf#116351: fix re-use of AttributeList on PGP manifest

It will be available in 6.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 himajin100000 2018-03-15 15:57:05 UTC
Closing this report as RESOLVED FIXED