[poppler] [RFC] Add option to strip encryption

Albert Astals Cid aacid at kde.org
Tue Sep 1 14:48:29 PDT 2015


El Dimarts, 1 de setembre de 2015, a les 23:34:10, Adam Reichold va escriure:
> Hello again,
> 
> Am 01.09.2015 um 00:16 schrieb Albert Astals Cid:
> > El Dissabte, 25 de juliol de 2015, a les 14:26:48, Adam Reichold va 
escriure:
> >> Hello,
> >> 
> >> the attached patch adds an option to strip the encryption from a
> >> document by doing a complete rewrite but ignoring the original
> >> encryption parameters and removing the encryption entry form the trailer
> >> dictionary. It also exposes this via the two Qt frontends.
> >> 
> >> This might be useful for a separate command-line utility but for now my
> >> primary use case is submitting a rewritten but unencrypted document to
> >> CUPS for printing instead of converting to PostScript.
> > 
> > Pushed.
> 
> I am very sorry, but during further testing, I noticed that the raw
> stream copying done in "PDFDoc::writeObject" breaks documents generated
> using this flag. It seems this yields the encrypted data being written
> instead of the decrypted data.
> 
> The attached patch tries to solve this by passing the "stripEncryption"
> flag to the "writeObject" method to suppress the raw stream copying,
> which however yields a horribly large patch for what is effectively a
> single-line change due to the recursive calls to "writeObject" from
> various places.
> 
> While this changes does yield correctly decrypted files which CUPS
> prints properly, it also "strips" various other stream filters like
> "Flate" yielding much larger documents. I think the better solution
> would be to reliably detect this situation within "writeObject" to
> suppress the raw stream copying on a case-by-case basis, but I have not
> yet managed to implement this. I would be grateful for any advice on how
> to do this.

I've reverted the change altogether until we find a way to solve this.

Cheers,
  Albert

> 
> Best regards, Adam.



More information about the poppler mailing list