resolves tdf#149567: odfvalidator: do not validate password protected files

Running "java -jar odfvalidator-0.9.0-jar-with-dependencies.jar test.odt"
it fails with
ene 30, 2026 1:09:49 P. M. org.odftoolkit.odfdom.pkg.ZipHelper entriesToMap
INFORMACIÓN: ZIP ENTRY not found
/home/xisco/Descargas/test.odt:  Fatal: ZIP entry 'mimetype': only DEFLATED entries can have EXT descriptor
/home/xisco/Descargas/test.odt:  Fatal: The document is encrypted. Validation of encrypted documents is not supported.
/home/xisco/Descargas/test.odt/META-INF/manifest.xml[2,194]:  Error: unexpected attribute "manifest:version"
/home/xisco/Descargas/test.odt/META-INF/manifest.xml[6,136]:  Error: tag name "manifest:start-key-generation" is not allowed. Possible tag names are: <key-derivation>

Change-Id: I185e9cd5227a07cd7fd07379c8925b9a8296d0a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198426
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Xisco Fauli
2026-01-30 14:51:36 +01:00
parent b2cbeda648
commit 374e7cd1a4
4 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -263,7 +263,7 @@ void test::BootstrapFixture::validate(const OUString& rPath, std::u16string_view
}
else if( eFormat == test::ODF && !aContentOUString.isEmpty() )
{
if( aContentOUString.indexOf("Error") != -1 )
if( aContentOUString.indexOf("Error") != -1 || aContentOUString.indexOf("Fatal") != -1 )
{
SAL_WARN("test", aContentOUString);
CPPUNIT_FAIL(aContentString.getStr());
+3 -3
View File
@@ -173,10 +173,10 @@ void UnoApiTest::save(TestFilter eFilter, const char* pPassword)
{ u"OOXPassword"_ustr, uno::Any(sPassword) }
};
aMediaDescriptor[utl::MediaDescriptor::PROP_ENCRYPTIONDATA] <<= aEncryptionData;
// validation fails with "zip END header not found"
skipValidation();
}
// Password protected documents can't be validated
skipValidation();
}
saveWithParams(aMediaDescriptor.getAsConstPropertyValueList());