diff options
-rw-r--r-- | xmlsecurity/qa/unit/pdfsigning/data/dict-bool.pdf | bin | 0 -> 145552 bytes | |||
-rw-r--r-- | xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/pdfio/pdfdocument.cxx | 12 |
3 files changed, 13 insertions, 1 deletions
diff --git a/xmlsecurity/qa/unit/pdfsigning/data/dict-bool.pdf b/xmlsecurity/qa/unit/pdfsigning/data/dict-bool.pdf Binary files differnew file mode 100644 index 000000000000..cd87f71ecf95 --- /dev/null +++ b/xmlsecurity/qa/unit/pdfsigning/data/dict-bool.pdf diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx index c10752b07ee2..1ecbb22ed3dc 100644 --- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx +++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx @@ -357,6 +357,8 @@ void PDFSigningTest::testGood() { // We failed to determine if this is good or bad. OUStringLiteral("good-non-detached.pdf"), + // Boolean value for dictionary key caused read error. + OUStringLiteral("dict-bool.pdf"), }; for (const auto& rName : aNames) 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<PDFNameElement*>(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: '"<<pSubFilter->GetValue()<<"'"); return false; } @@ -2976,6 +2976,16 @@ size_t PDFDictionaryElement::Parse(const std::vector< std::unique_ptr<PDFElement continue; } + auto pBoolean = dynamic_cast<PDFBooleanElement*>(rElements[i].get()); + if (pBoolean) + { + rDictionary[aName] = pBoolean; + if (pThisDictionary) + pThisDictionary->SetKeyOffset(aName, nNameOffset); + aName.clear(); + continue; + } + auto pHexString = dynamic_cast<PDFHexStringElement*>(rElements[i].get()); if (pHexString) { |