Bug 75955 - FILEOPEN: Can't open a .docx file if password length is >= 18 characters
Summary: FILEOPEN: Can't open a .docx file if password length is >= 18 characters
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other other
: medium normal
Assignee: Tomaz Vajngerl
URL:
Whiteboard: BSA target:4.3.0 target:4.2.4
Keywords:
: 75956 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-09 18:58 UTC by Alain GUIRAUTON
Modified: 2017-05-19 08:42 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
an example of file (38.50 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-03-10 12:38 UTC, Alain GUIRAUTON
Details
Message appearing with FR lang pack (43.23 KB, image/png)
2014-03-10 17:39 UTC, sophie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alain GUIRAUTON 2014-03-09 18:58:30 UTC
Problem description: 
The file could not be opened in LireOffice
Steps to reproduce:
1. Open libreoffice writer ....
2. select a docx file....
3. a message is displayed :
   Erreur de lecture
La méthode de chiffrement de ce document n'est pas prise en charge

Il s'agit de tous les docx protégés qui me sont transmis par mes clients !

Bilan il faut disposer d'un PC pour ouvrir les docs, supprimer la protection en fournissant le mot de passe,
réenregistrer ...

En fait impossible d'utiliser LibreOffice dans ces cas (et le PC sous linux)

PC sous Linux Mageia3

Merci.
              
Operating System: other
Version: 4.1.5.3 release
Comment 1 Jorendc 2014-03-09 20:12:20 UTC
*** Bug 75956 has been marked as a duplicate of this bug. ***
Comment 2 Julien Nabet 2014-03-09 21:36:24 UTC
Alain: could you please attach an example file so we can try to reproduce the problem? (please think about removing any confidential/private part since every attachments are public).

(PS : please use English only to describe the problem since bugzilla is a tracker in English)
Comment 3 sophie 2014-03-10 09:14:13 UTC
Translation :
3. a message is displayed :
 Reading error:
Encryption method of this document is not supported.
It is about all the protected docx that are provided by my customers!
it requires a PC to open the docs, remove protection by providing the password, 
register again...
It is impossible to use LibreOffice in these cases (and the PC under Linux).
Set as needinfo until we have the document to reproduce. Sophie
Comment 4 Alain GUIRAUTON 2014-03-10 12:38:13 UTC
Created attachment 95503 [details]
an example of file

Example of file
Comment 5 sophie 2014-03-10 13:27:06 UTC
Hi Alain, could you provide the password to open the file, thanks. Sophie
Comment 6 Alain GUIRAUTON 2014-03-10 15:06:42 UTC
Hi !
The password is mentionned in comment !

So it is as follow:

projetalainbugzilla

BR
Alain.
Le 10/03/2014 14:27, bugzilla-daemon@freedesktop.org a écrit :
>
> *Comment # 5 <https://bugs.freedesktop.org/show_bug.cgi?id=75955#c5> 
> on bug 75955 <https://bugs.freedesktop.org/show_bug.cgi?id=75955> from 
> sophie <mailto:gautier.sophie@gmail.com> *
> Hi Alain, could you provide the password to open the file, thanks. Sophie
> ------------------------------------------------------------------------
> You are receiving this mail because:
>
>   * You are on the CC list for the bug.
>   * You reported the bug.
>
Comment 7 sophie 2014-03-10 15:11:51 UTC
So I cannot reproduce the error message. I got the password dialog, enter 'projetalainbugzilla' and it says that the password is incorrect. Set back as Unconfirmed - Sophie
Comment 8 sophie 2014-03-10 15:17:21 UTC
Sorry, I forgot to mention that my previous comment was with version 4.2.2.1 under Ubuntu. Testing now with 4.1.5.3 under Debian, I got the message: Version incompatibility - Incorrect file version - Sophie
Comment 9 sophie 2014-03-10 17:39:33 UTC
Created attachment 95524 [details]
Message appearing with FR lang pack

The message is not the same whether the UI is French (error says that the encryption method is not supported. Only encryption password supported by Microsoft Office 97/2000 is supported) in English (version incompatibility, incorrect file version).
Comment 10 tommy27 2014-03-11 06:08:17 UTC
I can't open test file with 4.1.5.3 italian GUI under Win7x64.

I receive this error message (translated from italian to english): 
"version incompatibility, incorrect file version".

I set status to NEW.
Comment 11 Tomaz Vajngerl 2014-03-22 10:35:55 UTC
Don't bother to use LO 4.1 for password protected ooxml files as it supports only those created with MSO 2007 but not those with MSO 2010/2013 (and also probably 2007 with SP, but I didn't check this). Support for those was added (by me) in LO 4.2.

As for this file: it opens in Word 2013 and doesn't in LO 4.2 but it should so it is a bug and I will take a look at this.
Comment 12 Tomaz Vajngerl 2014-03-22 11:41:45 UTC
I identified the problem. Decryption doesn't work if password length is >= 18 characters.
Comment 13 Commit Notification 2014-03-23 13:22:41 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=66ebce7bb49432ab02b5c74ed4e787282b1ba474

fdo#75955 use SHA1 from openssl/nss instead of rtl_digest_sha1



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 14 Commit Notification 2014-03-23 18:37:21 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=7cf5d562e6e86b0f571edc95a150b8dce8f3ddef&h=libreoffice-4-2

fdo#75955 use SHA1 from openssl/nss instead of rtl_digest_sha1


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 15 Jorendc 2014-05-17 20:42:00 UTC
Looks fixed to me, tested using Windows 8.1 with LibreOffice Version: 4.3.0.0.alpha1+
Build ID: 48eccfb812284f43ba24c3be3903537ce954944d
TinderBox: Win-x86@39, Branch:master, Time: 2014-05-16_00:35:19

I can successfully open the attached document.

Marking as RESOLVED FIXED. Thanks Tomaz!

Kind regards,
Joren