office-gobmx/sw/CppunitTest_sw_odfexport.mk
Michael Stahl 398275ba9f tdf#115483 svl xmloff sc sw: verify all ODF 1.2 protection-key hashes
ODF 1.2 has added some mandatory requirements for protection-key hashes
which did not exist in ODF 1.1.

This affects sections and indexes in ODT documents, as well as
spreadsheets and sheets in ODS documents.

1. Accept the following hashed passwords:
    * UTF16 LE/BE encoded StarOffice-SHA1, OOo legacy and allowed by ODF 1.1
    * UTF8 encoded proper SHA1, as required by ODF 1.2
    * UTF8 encoded SHA256, as required by ODF 1.2
        - specified either with the wrong URL used in the ODF 1.2 spec
          or the correct URL from the W3C spec, see OFFICE-3702
    * Excel+SHA1 double-hash, only in Calc, see OFFICE-2112

2. Round-trip any of the above as-is
    * for SHA256 only write the URL from the ODF 1.2 spec

3. Generate only UTF16 LE encoded SHA1 for now, so that older LO
   releases can still verify the password
    * some time in the future, switch to generating some valid ODF 1.2 hash

More changes are necessary in Calc, which can actually preserve
different hashes for the same passwords in its runtime data model,
whereas Writer just has a single buffer without even any metadata.

For the Calc unit tests we need one document per hash because the
protection-key attribute can be set on the entire spreadsheet, which
is an unique element in the document.

There are further uses of SvlPasswordHelper for change-tracking passwords,
but apparently those are stored in settings.xml, so ODF has no
requirements for them, so let's leave that as it is.

Change-Id: Icb720b14ae9c0d9c04d2e082769ae2b74e3af8aa
Reviewed-on: https://gerrit.libreoffice.org/49352
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-07 18:03:09 +01:00

63 lines
1.6 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#*************************************************************************
$(eval $(call gb_CppunitTest_CppunitTest,sw_odfexport))
$(eval $(call gb_CppunitTest_add_exception_objects,sw_odfexport, \
sw/qa/extras/odfexport/odfexport \
))
$(eval $(call gb_CppunitTest_use_libraries,sw_odfexport, \
comphelper \
cppu \
cppuhelper \
sal \
sfx \
svl \
sw \
test \
tl \
unotest \
utl \
vcl \
))
$(eval $(call gb_CppunitTest_use_externals,sw_odfexport,\
boost_headers \
libxml2 \
))
$(eval $(call gb_CppunitTest_set_include,sw_odfexport,\
-I$(SRCDIR)/sw/inc \
-I$(SRCDIR)/sw/source/core/inc \
-I$(SRCDIR)/sw/qa/extras/inc \
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_sdk_api,sw_odfexport))
$(eval $(call gb_CppunitTest_use_ure,sw_odfexport))
$(eval $(call gb_CppunitTest_use_vcl,sw_odfexport))
$(eval $(call gb_CppunitTest_use_rdb,sw_odfexport,services))
$(eval $(call gb_CppunitTest_use_custom_headers,sw_odfexport,\
officecfg/registry \
))
$(eval $(call gb_CppunitTest_use_configuration,sw_odfexport))
ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
$(call gb_CppunitTest_get_target,sw_odfexport): \
$(call gb_ExternalPackage_get_target,fonts_liberation)
endif
# vim: set noet sw=4 ts=4: