Bug 76222 - Password protected XLSX
Summary: Password protected XLSX
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.2.1 release
Hardware: Other macOS (All)
: medium normal
Assignee: Tomaz Vajngerl
URL:
Whiteboard: target:4.3.0 target:4.2.4
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-16 03:05 UTC by andy1g9p53
Modified: 2014-04-01 00:27 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Excel 2007 XLSX (12.50 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2014-03-17 17:53 UTC, andy1g9p53
Details
console logs (3.75 KB, text/plain)
2014-03-17 20:11 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andy1g9p53 2014-03-16 03:05:52 UTC
I have a MS Spreadsheet with a file type of XLSX and it is password protected.

The file is handled correctly with "LibreOffice 4.1.5 for Mac OS X (Intel)".

The file is not handled correctly with versions 4.2.2 or 4.2.3.  With these 2 versions the file is not challenged for the password and appears to open the file showing various characters but not the correct contents.
Comment 1 Julien Nabet 2014-03-16 21:39:20 UTC
Could you attach the file so we can try to reproduce?
(keep in mind that attachments are public so remove any confidential/private part before attaching it).
Comment 2 andy1g9p53 2014-03-17 17:53:51 UTC
Created attachment 95959 [details]
Excel 2007 XLSX
Comment 3 andy1g9p53 2014-03-17 18:11:20 UTC
The attached file I created just now because the original file contains sensitive data.  The test file opens fine with version 4.1.5 after a password challenge.  With version 4.2.2 the file opens showing garbled characters and doesn't ask for a password.

Test file created on Windows 7 - Office excel 2007

Password = password
Comment 4 Julien Nabet 2014-03-17 20:11:25 UTC
Created attachment 95967 [details]
console logs

On pc Debian x86-64 with master sources updated yesterday, I could reproduce the problem.
Comment 5 Julien Nabet 2014-03-17 20:21:18 UTC
Normally xlsx is a zip file with a specific structure.
I renamed the extension of your file into zip but I failed to open it.
  zip -T test.zip 
	zip warning: missing end signature--probably not a zip file (did you
	zip warning: remember to use binary mode when you transferred it?)
	zip warning: (if you are trying to read a damaged archive try -F)

zip error: Zip file structure invalid (test.zip)
Trying to fix it (with -F or -FF option) gives an empty zip.

Perhaps the encryption changes this.
Comment 6 Tomaz Vajngerl 2014-03-24 17:04:56 UTC
Julien: encrypted ooxml files are not zip files. They are OLE storage (the stuff used in MS binary format) which contains a encrypted document (which is a zip file). 

This looks like the file was not detected as an (encrpyted) document so it was opened as a text document.

I'm taking this bug..
Comment 7 Commit Notification 2014-03-24 17:23:24 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=15b3e29808da85b1c304c571f52f12cc2e67884d

fdo#76222 oox: add support for MSO 2007 SP2 encrypted documents



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 8 Tomaz Vajngerl 2014-03-24 17:39:29 UTC
Solved...

Added change to master, pending for LO 4.2.

Have fun.
Comment 9 Commit Notification 2014-03-25 20:21:00 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=19f74aed27868105bc67c642dff0c3e1cb7594c2&h=libreoffice-4-2

fdo#76222 oox: add support for MSO 2007 SP2 encrypted documents


It will be available in LibreOffice 4.2.4.

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 10 andy1g9p53 2014-04-01 00:27:20 UTC
I installed the latest daily build and all my password protected XLSX files are handled correctly.  

Thanks for your prompt responses and fix.