From c623a9f846c713b19a0d58337af4f4354aeffa6e Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 1 Dec 2016 13:41:37 +0100 Subject: xmlsecurity PDF verify: handle boolean type as dictionary value This caused not finding the length of a stream -> could not actually verify signature. Change-Id: I696b6da49525eb53f7575c27f619d2116be51f1d Reviewed-on: https://gerrit.libreoffice.org/31490 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- xmlsecurity/source/pdfio/pdfdocument.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'xmlsecurity/source/pdfio/pdfdocument.cxx') diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx index 34a74747ff67..b19a043e9d05 100644 --- a/xmlsecurity/source/pdfio/pdfdocument.cxx +++ b/xmlsecurity/source/pdfio/pdfdocument.cxx @@ -2122,7 +2122,7 @@ bool PDFDocument::ValidateSignature(SvStream& rStream, PDFObjectElement* pSignat auto pSubFilter = dynamic_cast(pValue->Lookup("SubFilter")); if (!pSubFilter || (pSubFilter->GetValue() != "adbe.pkcs7.detached" && pSubFilter->GetValue() != "adbe.pkcs7.sha1" && pSubFilter->GetValue() != "ETSI.CAdES.detached")) { - SAL_WARN("xmlsecurity.pdfio", "PDFDocument::ValidateSignature: no or unsupported sub-filter"); + SAL_WARN("xmlsecurity.pdfio", "PDFDocument::ValidateSignature: unsupported sub-filter: '"<GetValue()<<"'"); return false; } @@ -2976,6 +2976,16 @@ size_t PDFDictionaryElement::Parse(const std::vector< std::unique_ptr(rElements[i].get()); + if (pBoolean) + { + rDictionary[aName] = pBoolean; + if (pThisDictionary) + pThisDictionary->SetKeyOffset(aName, nNameOffset); + aName.clear(); + continue; + } + auto pHexString = dynamic_cast(rElements[i].get()); if (pHexString) { -- cgit