[Libreoffice-commits] core.git: xmlsecurity/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Oct 19 14:46:48 UTC 2016


 xmlsecurity/source/pdfio/pdfdocument.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e9834a3eaf35a2c7b61cf45c2d64e9f3bbe89982
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Oct 19 12:36:37 2016 +0200

    xmlsecurity: fix the PDF incremental update's cross-references table
    
    The VCL pdf export writes a space after the in-use entry, and turns out
    Adobe Acrobat starts to "repair" the file if there is no such space.
    Which means the signature is validated against the repaired document,
    resulting in a "The signature byte range is invalid" error message,
    hiding the root cause.
    
    Not that ISO-32000 7.5.4 "Cross-References Table" would mention the need
    for such whitespace at the end of the lines.
    
    Change-Id: I165b57809550f184f374c00f28426a3cd813c63f

diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx
index 6e807a4..ad488cf 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -462,9 +462,9 @@ bool PDFDocument::Sign(const uno::Reference<security::XCertificate>& xCertificat
         while (aBuffer.getLength() < 10)
             aBuffer.insert(0, "0");
         if (nObject == 0)
-            aBuffer.append(" 65535 f\n");
+            aBuffer.append(" 65535 f \n");
         else
-            aBuffer.append(" 00000 n\n");
+            aBuffer.append(" 00000 n \n");
         m_aEditBuffer.WriteOString(aBuffer.toString());
     }
 


More information about the Libreoffice-commits mailing list