https://bugs.documentfoundation.org/show_bug.cgi?id=149621

--- Comment #4 from Julien Nabet <serval2...@yahoo.fr> ---
In checkEncryption, we go into "if( o_rIsEncrypted )" block
(see
https://opengrok.libreoffice.org/xref/core/sdext/source/pdfimport/wrapper/wrapper.cxx?r=f71606c9#921).

That's because after line 918
o_rIsEncrypted = pPDFFile->isEncrypted()
"o_rIsEncrypted" is true.

After searching a bit why isEncrypted() return true.
This method is defined with:
1058  bool PDFFile::isEncrypted() const
1059  {
1060      return impl_getData()->m_bIsEncrypted;
1061  }

see
https://opengrok.libreoffice.org/xref/core/sdext/source/pdfimport/pdfparse/pdfentries.cxx?r=776a1b9b&mo=33301&fi=1058#1058

Then searching what put "m_bIsEncrypted" to true, I found it was there:
PDFFile::impl_getData()
(see
https://opengrok.libreoffice.org/xref/core/sdext/source/pdfimport/pdfparse/pdfentries.cxx?r=776a1b9b#1280).
1337 : m_pData->m_bIsEncrypted = true;

To come to this point, LO passed these:
1311              PDFDict::Map::iterator enc =
1312                  pTrailer->m_pDict->m_aMap.find( "Encrypt" );
1313              if( enc != pTrailer->m_pDict->m_aMap.end() )
=> there's indeed an "Encrypt" string in the pdf.

1328  PDFDict::Map::iterator filter = pDict->m_aMap.find( "Filter" );
...
1335                      if( filter != pDict->m_aMap.end() )
=> there's indeed a "Filter" string in the pdf.

Just opening the file with Vim at line 85:
trailer^M<</Size 11313/Prev 7344600/XRefStm 4936/Root 11232 0 R/Encrypt 11231 0
R/Info 1123 0
R/ID[<2DADBFE19AE011E2866A0016CB391DB2><C1BCA3469B3B11E2BB700016CB391DB2>]>>^Mstartxref^M0^M%%EOF^M
                                   ^M11312 0 obj<</Length 2800/C 4232/E
4200/Filter/FlateDecode/I 4259/L 4216/O 4184/S 3803/T 4017>>stream^M

Now I don't know why other apps (eg: Gimp) don't ask anything and the
encryption part in pdf specs isn't easy to understand (at least for me).

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to