Issue 120385 - Fail to load and save document with password
Summary: Fail to load and save document with password
Alias: None
Product: Writer
Classification: Application
Component: save-export (show other issues)
Version: 3.4.0
Hardware: All All
: P1 (highest) Critical (vote)
Target Milestone: 4.0.0
Assignee: AOO issues mailing list
QA Contact: emiliano.lucetti
Keywords: regression
: 120423 122200 (view as issue list)
Depends on:
Reported: 2012-07-27 01:41 UTC by Yan Ji
Modified: 2016-11-03 07:32 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---
jsc: 3.4.1_release_blocker+

Error dialog while saving document with password (21.01 KB, image/png)
2012-07-27 01:41 UTC, Yan Ji
no flags Details
Error dialog while loading document with password (41.29 KB, image/png)
2012-07-27 01:42 UTC, Yan Ji
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Yan Ji 2012-07-27 01:41:37 UTC
Created attachment 78744 [details]
Error dialog while saving document with password

Build: AOO 3.4.1_r1365887
OS: All

1. Launch AOO and new Text Document
2. Input some content
3. Save the document with password

Defect: An error dialog popup said 
        Error saving the document Untitled 1:
        General Error.
        General input/output error.

Note if open a document with password a dialog said the document is corrupt. Please refer to the snapshot.

This problem doesn't exist in last 3.4.1 build rev 1364591
Comment 1 Yan Ji 2012-07-27 01:42:16 UTC
Created attachment 78745 [details]
Error dialog while loading document with password
Comment 2 Ariel Constenla-Haile 2012-07-27 03:25:59 UTC
Reproducible on Linux x86-64
Comment 3 SVN Robot 2012-07-27 11:57:23 UTC
"hdu" committed SVN revision 1366350 into trunk:
#i120385# balance stack in manifest parsing and fix a typoPatch-by: Jian Fang...
Comment 4 jsc 2012-07-27 11:58:12 UTC
set release blocker flag
Comment 5 SVN Robot 2012-07-27 12:07:01 UTC
"hdu" committed SVN revision 1366353 into branches/AOO34:
120385# balance stack in manifest parsing and fix a typo
Comment 6 2012-07-27 12:09:13 UTC
Fixed now, sorry about that. Thanks to Yan Ji for finding it and for Jian Fang Zhang and Andre Fischer for their suggestions.
Comment 7 2012-07-27 12:10:34 UTC
and for Ariel for confirming it, of course.
Comment 8 jsc 2012-07-27 13:09:51 UTC
set flag release blocker flag again
Comment 9 Ariel Constenla-Haile 2012-07-31 23:49:27 UTC
*** Issue 120423 has been marked as a duplicate of this issue. ***
Comment 10 Li Feng Wang 2012-08-02 05:19:17 UTC
Verified pass with AOO341 branch r1367911
Comment 11 Andre 2012-08-06 13:38:30 UTC
Reopening because of another regression in the same area.  How to reproduce:

1. Create a new text document.
2. Save with password.
3. Close document and load it again.

Password is not recognized.
Comment 12 SVN Robot 2012-08-06 13:42:15 UTC
"af" committed SVN revision 1369843 into branches/AOO34:
#i120385# Fixed reading of encryption specification on 64bit systems.
Comment 13 Andre 2012-08-06 13:51:52 UTC
Sorry, wrong status, should be "reopened".
Comment 14 Andre 2012-08-06 13:59:54 UTC
This is a 64bit-only bug.

A recent change in ManifestImport::startElement modified the reading of manifest properties for digest and encryption type in such a way, that they where internally stored as C++ long values (wrapped in uno Anys).  In the UNO API they are defined as IDL long values.  IDL long is defined to be always be a signed 32 bit value.  For 32bit compilers (at least the ones we use for OpenOffice) the two longs (C++ vs IDL) have the same length.  For 64bit compilers C++ long has 64bits.
This leads to a problem when the values are later converted back into C++ variables, this time of type sal_Int32.  The conversion fails silently and the default values (0 in this case) are used.  Zero is neither a valid encryption nor digest type.  Therefore validation of the password fails.

The fix is simple.  Use type sal_Int32 to store the encryption and digest type and everything works as before.
Comment 15 Li Feng Wang 2012-08-07 03:15:00 UTC
Reopened problem can reproduce on Redhat 64bit with AOO341 r1366353.
Comment 16 jolatt 2012-08-07 13:21:17 UTC
Bug described in comment 11 is not fixed in revision 1369843.
I installed en-US and the German langpack.

BS: Ubuntu12.04 64bit
Comment 17 jsc 2012-08-07 13:53:03 UTC
@jolatt: are you sure that you used the latest builds from Arie? I have just at the moment downloaded and tested that version and can't reproduce it.

I can create a new document, save with password, close and reopen it again. Everything works as expected.

Test env: Linux ubox-jsc 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:44:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Comment 18 jolatt 2012-08-07 15:29:56 UTC
Yes I'm sure, that I have installed the latest build.

Because of another reason, I had to restore the home directory of Ubuntu.
After this I tried it again and it now works.
Comment 19 Li Feng Wang 2012-08-09 02:34:39 UTC
Reopened problem in Comment 11 is verified on Redhat 64bit with Aoo341 r1369843.
Comment 20 Ariel Constenla-Haile 2013-05-03 13:37:15 UTC
The fix in Revision 1369843 wasn't applied to trunk
Comment 21 Ariel Constenla-Haile 2013-05-03 16:27:38 UTC
*** Issue 122200 has been marked as a duplicate of this issue. ***
Comment 22 SVN Robot 2013-05-03 17:35:41 UTC
"arielch" committed SVN revision 1478883 into trunk:
i120385 - apply patch from AOO34 branch
Comment 23 Ariel Constenla-Haile 2013-05-03 17:37:40 UTC
Fixed on trunk.
Adapt Target Milestone, now this has to be verified on 4.0.0.
Comment 24 emiliano.lucetti 2013-06-28 19:21:40 UTC
Save and reopen with password verified in AOO 4.0.0
Comment 25 mroe 2016-11-03 07:32:36 UTC
see comment 24