Bug 139888 - Sign Existing PDF corrupts direct-to-PDF LaTeX documents
Summary: Sign Existing PDF corrupts direct-to-PDF LaTeX documents
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.0.1.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords: dataLoss
Depends on:
Blocks:
 
Reported: 2021-01-24 18:12 UTC by John Scott
Modified: 2021-02-08 06:02 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
fresh test PDF from LuaLaTeX (2.50 KB, application/pdf)
2021-01-24 18:13 UTC, John Scott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Scott 2021-01-24 18:12:31 UTC
Description:
I'm forwarding this bug from Debian as the submitter (https://bugs.debian.org/969299). Consider the minimal LaTeX document:
\documentclass[letterpaper]{article}
\begin{document}f\end{document}

If one uses a direct-to-PDF engine such as PDFLaTeX, XeLaTeX, or LuaLaTeX, and then tries to sign it with LibreOffice's 'Sign Existing PDF' feature, the document may appear to have been legitimately signed within the UI, but in fact the original document has been corrupted.

Steps to Reproduce:
1. Make foo.tex with the hitherto-described example contents
2. Run 'lualatex foo.tex' to make foo.pdf
3. Open a LibreOffice application
4. Navigate to File->Digital Signatures->Sign Existing PDF
5. Click 'Sign Document'
6. Click 'Sign Document' in the dialog and choose the appropriate certificate
7. Close the dialog, observe LibreOffice's statement the document has been signed, and close LibreOffice
8. Open PDF in a viewer, or reopen it with LibreOffice

Actual Results:
Okular says the PDF is corrupted. LibreOffice wrongly says 'This PDF file is encrypted and can't be opened,' but nonsensically still affirms 'This document is digitally signed and the signature is valid.'

Expected Results:
It should have shown a signed PDF with its original contents.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 2; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Debian package version: 1:7.0.4-3
Calc: threaded

Safe mode does not permit me to choose my certificate.
Comment 1 John Scott 2021-01-24 18:13:28 UTC
Created attachment 169124 [details]
fresh test PDF from LuaLaTeX
Comment 2 John Scott 2021-01-24 18:16:28 UTC
As a workaround, I compile my LaTeX to DVI and then convert to PDF; then it works.