vcl: anchor the object-stream test on /Type/ObjStm

testEncryptedTaggedUsesObjectStreams searched the whole exported file
for /ObjStm, which binary data can hold, and every later search starts
from that match. The writer emits /Type/ObjStm, with /Length and the
stream data after it in the same dictionary.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: Ibb1417ee9bd399ea183883d2849f02a4e3d945c4
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13491
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 8171259354f2e36fddcdb815d393d7d60c303e01)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211702
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Mike Kaganski
2026-10-02 11:05:31 +02:00
committed by Xisco Fauli
parent 8674bad247
commit 4f8889f928
@@ -123,7 +123,8 @@ CPPUNIT_TEST_FIXTURE(PDFEncryptionTest, testEncryptedTaggedUsesObjectStreams)
const std::string_view aFile(static_cast<const char*>(maMemory.GetData()), maMemory.GetSize());
// an unencrypted export has object streams anyway, so the rest tests nothing without this
CPPUNIT_ASSERT(aFile.find("/Encrypt") != std::string_view::npos);
const size_t nObjStm = aFile.find("/ObjStm");
// the dictionary entry, not a chance match in binary data
const size_t nObjStm = aFile.find("/Type/ObjStm");
CPPUNIT_ASSERT(nObjStm != std::string_view::npos);
// /Length has to count what the cipher adds, or a reader that trusts it stops mid-block.