summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)Author
2022-07-29Verify signing certificate cryptographically before use in testsMike Kaganski
Documents signed using an invalid (e.g., not having a trusted root) certificate give signatures that obviously can't pass validity tests. Change-Id: Id4b097516e06c548ea42cad65d76bbd8a6853cc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137620 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-28clang-tidy modernize-pass-by-value in xml*Noel Grandin
Change-Id: I9bd5f6adfd138c391d76aebfe08ba01e6b3ab3bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137550 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-20tdf#127236 vcl: fix missing encryption of PDF images during exportMiklos Vajna
Regression from commit 78e25558e86188314b9b72048b8ddca18697cb86 (tdf#106059 PDF export: create a reference XObject for JPG images with PDF data, 2017-02-23), once a PDF image was inserted to a document, an encrypted PDF export lost those images. The reason for this is that we started to preserve PDF images as vector data with the above commit, but this means we copied over PDF objects from PDF images to the export result as-is, so encryption was not performed for them. Fix this by separating the write of the PDF object headers, stream content and object footer and then calling checkAndEnableStreamEncryption() / disableStreamEncryption() for each object, even if it's not something our PDF export created but comes from a PDF image. Note that when existing PDF files are signed, PDF objects are also copied into a vcl::filter::PDFDocument, but such PDF images are never encrypted, so it's fine to have stub implementations in vcl::filter::PDFDocument. Change-Id: I2f74b9f51cd35b4319221532ca890e197bab9cf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137242 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-07-19Replace old png writer in pdfverify.cxxofftkp
Change-Id: Iee38f9e86151717001ec4e4c083ec658603ad7c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137139 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-07elide some string copiesNoel Grandin
Change-Id: I3e0d9f7e5a446689e007b9d01fb1c6bf9bc068e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136880 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02Use more appropriate index variable typesStephan Bergmann
Change-Id: I8d82591c12642d66344f70997c5cf40e937569b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135322 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-24Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I20600d61a5d59d739bc1bee838c0038e4611aec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-19Simplify an "ImportGraphic" method by removing useless pExtHeader (WmfExternal)Julien Nabet
Change-Id: I2916610e08c3157e0438ec90592fb5b8f921cc24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134574 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Jenkins
2022-05-06remove unnecessary sequenceToContainerNoel Grandin
If we are not going to manipulate the resulting vector, then it is actually slower, since we have to allocate more storage for the vector Change-Id: I65677007d105f4783603df74113ebed6db0b551b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133963 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05loplugin:unusedvariableplusNoel Grandin
Change-Id: Id93086be1224b6f6bf0bdaa1d50b4f289099027e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133876 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05tdf#145312: xmlsecurity_pdfsigning: Add unittestXisco Fauli
Change-Id: I12d6af46d13daa06eab98cdf81c82c6f5f41b5c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133881 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-03Just use Any ctor instead of makeAny in xmlsecurityStephan Bergmann
Change-Id: Ic2e9189d116b03122d24a477d9396ca3d49a0a25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133698 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-01use more string_view in variousNoel Grandin
found by examining uses of OUString::copy() for likely places Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29xmlsecurity: fix testInsertCertificate_PEM_ODT with "dbm:" NSS DBMichael Stahl
CentOS 7 system NSS defaults to legacy "dbm:" DB. test_desktop_lib.cxx:2830:Assertion Test name: DesktopLOKTest::testInsertCertificate_PEM_ODT equality assertion failed - Expected: 1 - Actual : 2 The problem is that getPrivateKey() doesn't work: warn:xmlsecurity.xmlsec:624712:624712:xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx:824: Can't get the private key from the certificate. In this function, there is a check for trust flags, and the CERTDB_USER flag is not set, which causes the failure. The certificate was inserted here and the trust flags were set; this does write something to cert8.db and it's not clear why it doesn't work (if this call is omitted with the "sql:" backend, the test fails with NOTVALIDATED = 4 - as expected). Oddly enough, while PK11_FindPrivateKeyFromCert() fails, there's another function PK11_FindKeyByDERCert() that does appear to work, so call it as a fallback. Change-Id: I9821966a086574374f4f6df0ac5db2f7376fe742 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133576 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-04-29xmlsecurity: fix init of temp NSS DB when running with uid 0Michael Stahl
The problem is that in SecurityEnvironment_NssImpl::insertPrivateKey() the PK11_ImportDERPrivateKeyInfoAndReturnKey() fails because NSC_CreateObject() finds a slot->needLogin = 1. This value is set during the first NSS_InitReadWrite() in nsscrypto_initialize(), usually this fails, and the fallback path ends up calling PK11_InitPin(), which sets slot->needLogin = 0, whereas running with uid 0, the first call succeeds and PK11_InitPin() wasn't called. This causes test failures in CppunitTest_desktop_lib testInsertCertificate_PEM_ODT. Change-Id: I302ff17493f9b4d74ceae9da6831a5af87d7f622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133575 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-28Fix system-nss: add hasht.h header backThorsten Behrens
Revert part of 02e1be8883a08ab17f3e890a834ab88f13c5867d which broke with-system-nss builds - the hasht.h header was actually needed. Change-Id: Ida36bc6cd91f0a9b26a2029f1cab835f90f40dde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133571 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-04-20loplugin:passstuffbyrefNoel Grandin
Change-Id: I336fd329b577b6fa141265d8bc7ce67784bd7306 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133210 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-15use more string_view in xml*Noel Grandin
Change-Id: Ie219cb3feb98660463858d00f82f882881946ad0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133072 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13loplugin:stringviewparam whitelist some more functionsNoel Grandin
for which we have o3tl:: equivalents Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-04use internal SHA256Thumbprint apiCaolán McNamara
Change-Id: I6a51359af58dbb79b6a0399944030dbcbe97152b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130963 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-04compare authors using ThumbprintCaolán McNamara
Change-Id: I338f58eb07cbf0a3d13a7dafdaddac09252a8546 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130929 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-01Fix the test failing when invalid certificate is in cert storeMike Kaganski
testSigningMultipleTimes_ODT was failing for me locally because of an expired certificate present in my store. Change-Id: Ie3dfb9ee1a110259ba747a03fc28c205df2eea91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130743 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-25Add documentation for xmlsecurityHossein
* Add basic information * Add some references Change-Id: Id036c23f90f53c36052b155f62f68e0000e0266f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130289 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-02-21Cleanup x509certificate_nssimpl.cxxHossein
* Remove unused headers * Remove 'using namespace' * Use enum values in the condition Change-Id: I45c20412db48ed1a3a4471db20193c2d9cde2f94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130214 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-04add toId/fromId to tidy up some ugly castingCaolán McNamara
Change-Id: I70f34ac5e9b5d2f2d6c0375e823908eaa2e540b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129487 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-01-29gtk4: remove stray xalignCaolán McNamara
Change-Id: I6a54b1547dbf78ec285dee59893ed3a899285997 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129152 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-01-24Make Certificate not found dialog asyncSzymon Kłos
Change-Id: I8da2a2dc763cffd13659b61966a954a6e1ef06a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124269 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128841 Tested-by: Jenkins
2022-01-24Make View Certificate sub-dialog asyncSzymon Kłos
Change-Id: I0e1a6a59d856ab266511fc3d6be87fe04c5afdfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124143 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128840 Tested-by: Jenkins
2022-01-24Make View Certificate dialog asyncSzymon Kłos
Change-Id: Id93145ecf6be3cb558f0ce8d3cc340bbc67095e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124061 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128839 Tested-by: Jenkins
2022-01-24jsdialog: enable Digital Signatures dialogSzymon Kłos
In LOK case run it in the readonly mode. In readonly mode we can run it asynchronously. Change-Id: I721dd14fa23d4e30255dd976e0cc2a4f30470a3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124058 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128838 Tested-by: Jenkins
2022-01-12gbuild: build static LO / link static executablesJan-Marek Glogowski
This allows to build a complete static LibreOffice on Linux, except for linked externals. Since LO's static build implies disabled dynamic loading, one must select one VCL backend to be compiled in. See the (large) comment in solenv/gbuild/static.mk trying to explain, why this implementation was chosen (spoiler: seems there is no other way) and what is actually implemented. This will collect all libraries, statics and externals of executables. If the executable uses components, it will get linked to all static components. While it works with any Executable, it just makes sense for soffice.bin, because the static component map sucks every dependency in, bloating most other binaries. In theory on could generate the dependencies based on the list of used components (see gb_CppunitTest_use_components), then generate a specific static constructor map, directly include it in the exe's cxx code and then link the minimal dependencies. The static LO should build on Linux with: --enable-customtarget-components --disable-dynamic-loading Tested VCL plugin config is: --disable-gtk3 --disable-gen --enable-qt5 The partial build support is split into a 2nd patch. Change-Id: Iafc95752fae9e88095f54a21f1e30a4f080815e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126790 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-06tdf#146392 fix --enable-pch=full buildscito
x509.h includes cert.h. But that doesn't know of LO using xmlsecurity/source/xmlsec/nss/nssrenam.h, which has a "#define CERT_DecodeDERCertificate __CERT_DecodeDERCertificate". So the PCH doesn't know of this rename and the compiler fails. move the include line into the file that needs it and the --enable-pch=full build works ok Change-Id: I247bd219cf47964490ded439ad51bd8e8e120c48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127744 Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Jenkins
2022-01-05xmlsecurity nss: log what XML DOM node is given to libxmlsecMiklos Vajna
We have two environments where the signature and the stream bytes are the same, still in one case the signature verification succeeds and in the other case the hash doesn't match. Log the signature as parsed into a DOM node (recursively), just case something goes wrong during extracting a single signature from the signatures list XML. Change-Id: I54af71fdeb63d8ef44342f106746f938fa51f29a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127991 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-01-05Update gpgme to 1.16.0Thorsten Behrens
* remove GPGME_CAN_EXPORT_MINIMAL_KEY, upstream now has support for key export flags in c++ wrapper (gpgmepp >= 1.14) * therefore, external/gpgmepp/add-minimal-keyexport.patch now fully obsolete, tweaked xmlsecurity code to use upstream function * bits of external/gpgmepp/find-libgpg-error-libassuan.patch are upstream now (configure and makefile pieces, though we keep configure.ac changes for the while - to not pick up system versions too easily) * external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 was from upstream anyway, removed Change-Id: I991c20c0eeff0f9135e97c991afcb905be55a959 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127665 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-04xmlsecurity: log the signature we read from the ZIP packageMiklos Vajna
We can already see if a signature verification fails and what is the content of the ZIP streams we hash. Show what is the expected hash as well. Change-Id: Ibc67b7de0e8d03e06da1b86b6e8a7b2b2e613882 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127934 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-01-03Split xmlsecurity components based on the configJan-Marek Glogowski
One non-obvious hunk is the dependency of GPG based on NSS. While it doesn't need NSS per-se, the signature validation code uses NSS functions. This is mainly an improvement / has the same origin then commit 1c6382b2564fbf19f8ee99e11021dff2ce19ed6f ("xmlsec: handle missing EqualDistinguishedNames"). Change-Id: I12416139e1e391822d878c61b4ed06f3a409c334 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127913 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-03xmlsecurity: add some more loggingMiklos Vajna
We only get: warn:xmlsecurity.xmlsec:32272:32272:xmlsecurity/source/xmlsec/errorcallback.cxx:53: digests.c:226: xmlSecNssDigestVerify() 'sha1' '' 12 'data and digest do not match' when one of the XML streams have a bad hash. Add some logging to help figuring out (without a debugger) which stream is at fault. Change-Id: Ib5f39df87bcdaaac1a21eb560c8f775c42a4079f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127885 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-12-26Let comphelper::Base64::decode* take std::u16string_viewMike Kaganski
Change-Id: I5b04f7adf11c61f52b7bfb0f52c8c075f838f0f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127480 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-24osl::Mutex->std::mutex in OCipherContextNoel Grandin
Change-Id: I0a457dc8ddccc0fce42032956aff6d661d1ae80a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127403 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21only use X509DataCaolán McNamara
Change-Id: I52e6588f5fac04bb26d77c1f3af470db73e41f72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127193 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-30loplugin:stringliteraldefine in variousNoel Grandin
Change-Id: Ib482e3982128dc47d88a79478d80eef43745d1b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126086 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-24Rename o3tl::underlyingEnumValue to o3tl::to_underlying to match C++23Mike Kaganski
Change-Id: I1597a8e77199445bf377dbe54adc3134bb04fd51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125748 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-07forward decls go after #includeNoel Grandin
Change-Id: I54c33508639044092356eed5144720261b4f65db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124816 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-02xmlsec: fix OOXML signing with multiple certs, extend the testTomaž Vajngerl
Signing OOXML with 3 or more times didn't work as other ids ("idPackageObject", "idOfficeObject", ...) were not uniqe. This change makes those ids unique by appending the signature id. The signature ID is now generated for OOXML too, while previously it was a hardcoded string ("idPackageSignature"). The test for signing multiple OOXML was written before, but didn't catch the issues because it didn't assert the status of the document after loading it again. This is which is now fixed (and also added changed for the ODF test case). Change-Id: Ifa20ea17498b117a4c57f6eddf82f8e83bc640bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124571 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-11-01Fix more misuses of NULL across Windows-only codeStephan Bergmann
...that had inadvertently been missing from a5cea74034a8e029bfdf0f2b82ea8800bf5bd206 °Fix misuses of NULL across Windows-only code" Change-Id: I8f60cd6114ceb7c6413fb099778bfb06407bbb24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124431 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-01Prepare for removal of non-const operator[] from Sequence in xmlsecurityMike Kaganski
Change-Id: I7cfcf9f9ea307bd737292e6f4f37a29f453167c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124418 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-28loplugin:simplifybool (clang-cl)Stephan Bergmann
(not a typo according to the comment at <https://gerrit.libreoffice.org/c/core/+/124287/3#message-df56362ec7d674eaab3fe81bb0827be81ee5686d> "xmlsecurity: some Distinguished Names are less equal than others": "i was too lazy to look up which integer would be returned by the function and hoped this would convert it to bool anyway" Change-Id: I0f4f4d19e8d382f4430023aa6f9459c66a605b04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124321 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-28xmlsec: signing the document fails the 3rd time (invalid signature)Tomaž Vajngerl
Signing the document 3 or more times produces an invalid signature. The cause of this is that xmlsec is confused because we have 3 signatures, which all have the same SignedProperties with the ID "idSignedProperties", but it expect them to be unique. This issue is fixed by making the ID unique with adding the ID of the Signature to the SignedProperties ID, so this makes them unique inside the same Signature. Also UnsignedProperties have a unique ID usign the same approach, but they aren't referenced - luckily. Change-Id: I53c7249a82fc0623586548db9fa25bdc0e7c4101 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124278 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>