summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)AuthorFilesLines
2020-06-16sd signature line: access the pdf shape from the appearance writerMiklos Vajna1-0/+4
PDFDocument::WriteAppearanceObject() is where we can turn the pdf data (containing a single shape only) into a form XObject, later. Change-Id: Id042c95af4a867d3997d6f7742a18659b8925c12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96455 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-06-16sd signature line: export shape with signature to PDFMiklos Vajna2-2/+76
So that later this can be used when writing the appearance object of the pdf signature. Change-Id: I98517b88723de8ffdc982d4eaae7225289603f1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96451 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-06-05have just one way to set expander imageCaolán McNamara3-2/+5
Change-Id: Ic07709a864620c6146616c8e0a1417343c0937de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95590 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-05Upcoming loplugin:elidestringvar: xmlsecurityStephan Bergmann1-6/+3
Change-Id: Ifaf5027ca12254ced57a3bbd59e660886133fd50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95607 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-19oox, svx, sw, xmlsecurity: clang-format these filesMiklos Vajna2-75/+126
I added these files more or less recently and they have long lines. Use clang-format to break at a sane column limit. Change-Id: Id4ef832e4843fc81f4a497385e49ccb835a7197f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94503 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-05-18officecfg,unotools,cui: add ODF 1.2 Extended / ODF 1.3 versionsMichael Stahl2-6/+6
... to configuration and UI. The new default is ODF 1.3 Extended, which is now ODFVER_LATEST and stored as value "3" in configuration. Adapt a few places related to DocumentDigitalSignatures etc. to new default. Change-Id: I420da4f7787cc864c6bd88470d61b146b9399aa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93177 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-18xmlsecurity: actually validate in testODFEncryptedGPGMichael Stahl1-0/+1
Follow-up to 5eda583443cd0ec323e925395ea734c20fdbcf13 Change-Id: Icde98be0a8dccc58ca7c7c260e387bafb7f05b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94412 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-15replace hard-coded "1.2" ODF version stringsMichael Stahl1-2/+2
Most of these are calls to DocumentDigitalSignatures::createWithVersion(), where it doesn't make a difference if "1.2" or "1.3" is passed in but maybe it will be different with "1.4". There is another ctor createDefault() which looks appropriate for non-ODF contexts and can also be used when no actual signing or verifying is done. In cases where there's an actual document its Storage has the version. Change-Id: Id636bbf965d9f96c7ed5f50774c509032525b2b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93091 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-15package: OFFICE-3940 ODF 1.3 export of OpenPGP encryptionMichael Stahl1-0/+17
Import was implemented with a7bf6488ebb544e1efaed0a1e53073df9cc2064d but it doesn't correspond to the schema so see previous commit. Change-Id: Ic19db07da20e88d6533509217a70983938e61beb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93088 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-15package: OFFICE-3940 ODF 1.3 import of OpenPGP encryptionMichael Stahl1-0/+0
This was supposed to be implemented by commit a7bf6488ebb544e1efaed0a1e53073df9cc2064d "ODF1.3: import new OpenPGP encryption markup" but it turns out that the ODF 1.3 cs01 schema differs from the implementation: in ODF 1.3 cs01 we have <manifest:encrypted-key> <manifest:encryption-method .../> <manifest:keyinfo> <manifest:PGPData> </manifest:PGPData> </manifest:keyinfo> <manifest:CipherData> </manifest:CipherData> </manifest:encrypted-key> whereas the implementation expects <manifest:keyinfo> <manifest:encrypted-key> <manifest:encryption-method .../> <manifest:PGPData> </manifest:PGPData> <manifest:CipherData> </manifest:CipherData> </manifest:encrypted-key> </manifest:keyinfo> Ideally the inner manifest:keyinfo should be manifest:KeyInfo but not sure if that really matters. Change-Id: I407321c857e7b3ed9f4d04568ca2ea116764b3da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94309 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-13expand out some namespace aliasesNoel Grandin14-283/+232
Change-Id: I5fdb554a1b116824843f35645bc1cea3ca91e0f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94093 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10compact namespace in xmlhelp..xmlsecurityNoel Grandin7-42/+24
Change-Id: I54f0a47a4b7a1f85481fd1e643ac55459d0383ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10new loplugin:simplifypointertoboolNoel Grandin1-1/+1
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07fix memory leak of xmlDoc objectsNoel Grandin1-2/+2
in unit tests Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-01improve loplugin:makesharedNoel Grandin1-2/+2
to find places where we are converting stuff to unique_ptr instead of using std::make_shared. As a bonus, this tends to find places where we are using shared_ptr where we can instead be using unique_ptr avoiding the locking overhead. Change-Id: I1b57bbc4a6c766b48bba8e25a55161800e149f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-29Remove unnecessary if blockSamuel Mehrbrodt1-64/+66
And format code inside Change-Id: Ied0d98935134bf6f7bc8c929645ad5faac9affa3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93116 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-04-29tdf#131733 Show only CN part of X.509 subject infoGabor Kelemen4-9/+9
The problem was that the whole Subject info was returned from X.509 certs if they did not start with one of "CN", "OU", "O", "E" Instead of extending this list with random keys, pass the type of cert and only return the whole Subject info if it's an OpenGPG one, and process the info unconditionally if it's X.509 like before the OpenGPG integration Change-Id: I1aa5d7285e48b0f4a769a073cdfb7732e482792c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92675 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-04-27Missing includes on Windows with --disable-pchMike Kaganski1-0/+1
... since b512ce255f46d90e682634e4dd17e146af7f9080. Yes, MSVC also produces an error if the completeness requirements are not met. Change-Id: I0ad573ef1d14a383eed3a8f83aa932657c22ae20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92963 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-27Make upcasting css::uno::Reference ctor require complete typesStephan Bergmann2-0/+2
The main reason for the "home-grown" UpCast introduced with 904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for css::uno::Reference" in 2013 was probably that we could not yet rely on C++11 std::is_base_of back then. A (welcome) side effect was that the derived class could be incomplete. However, specializations of UpCast relying on whether or not T2 is incomplete are obviously an ODR violation if the type is incomplete in some TUs and complete (and derived from T1) in others. And even if UpCast had internal linkage, it would still be brittle that its behavior depends on the completeness of T2 at the point of the template's instantiation, and not necessarily at the point of use. That means we should better base that ctor on std::is_base_of (which we can do now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on Clang and GCC if the completeness requirements are not met. This change fixes all the cases where types need to be complete now, plus any resulting loplugin:referencecasting warnings ("the source reference is already a subtype of the destination reference"). Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-26update pchesCaolán McNamara2-6/+3
Change-Id: I83a61da7dda6c72552eecd377f1c3744c92a797e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92909 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-22uiobject.hxx only needs forward declaresCaolán McNamara2-2/+4
and update pches accordingly Change-Id: I411712532fd85961bffe6678416fcdc1d9c7f53d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92617 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-07new loplugin:unusedvariableplusNoel Grandin1-1/+0
a particularly aggressive checker, which is why it is off by default Change-Id: Id5a0faa50b3ecc75e01f4aedc6579c5209e585da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91643 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-03loplugin:finalclasses in xmlsecurity..UnoControlsNoel Grandin3-3/+3
Change-Id: I8e942bf37c9173a01bef6e1403ca21f579e7f608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91612 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-02xmlsec-wrapper.h must be included before any xmlsec headerMike Kaganski9-12/+19
This fixes structs size mismatch between xmlsec and its users because of XMLSEC_NO_SIZE_T not yet defined at the time of their definition. See https://lists.freedesktop.org/archives/libreoffice/2020-April/084800.html Change-Id: I8de9a012f849d9a5a84f5ce580484b66192d1e06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91531 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-01Add missing dependencyMike Kaganski1-0/+7
Do for xmlsecurity_pdfsigning what 5b66a038701241e0b9fa3a339acbd74f9ca4cf92 did for xmlsecurity_signing Change-Id: I6a12c2c68db8dc1b9cdcaee0d3bf6372556ebd65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91533 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-01Drop useless initialization immediately before reassignmentMike Kaganski1-3/+1
Change-Id: Id3d05de26ac9078a316de49ea2a5f6af26876107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91507 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-01Add missing dependencyMike Kaganski1-0/+7
Without this, running `make CppunitTest_xmlsecurity_signing` after `make clean` will stop at "GpgME not installed correctly" dialogs, because DocumentSignatureManager::init will try to initialize GPG security context, which requires gpgme-w32spawn.exe to be present in workdir/LinkTarget/Executable. See also commit 0de0b8c9d80d68619b6f3c0e8d9429d8b08553fb. Change-Id: I5d98e2e92a091e108f23d31fe0c8c8cf03faadcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91488 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-25Remove unused using declarations in oox...xmlsecurityGabor Kelemen2-3/+0
Found by: run-clang-tidy-10 -checks=-*,misc-unused-using-decls Change-Id: I3e95791e223ef01e140a6217e29a9efae428a784 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90876 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-25Remove some unused includesMiklos Vajna1-1/+0
Change-Id: I4897a6f2622e3e219f8b7b93d818d2edca03b117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91008 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-13tdf#42316 always evaluate macro signatures on loadJan-Marek Glogowski1-24/+6
As already stated in the comments of the signing unit tests, disabling macro security will not only ignore the signatures, but actually drop the macro signature, as these are never evaluated and as a result can't be restored for the new document. Change-Id: Ie41a9e72d3367c2eed58a52387bb67d8c41abff3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90435 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-03-03remove some dead codeNoel Grandin1-46/+0
GpgComponentFactory is unused since: commit 06d7dbb3568889aa50f46d6307a39fa53a17313b Date: Sun May 21 14:28:57 2017 +0200 gpg4libre: share static xmlsec lib between nss and gpg tableautoformatfield.cxx should have been removed in: commit 5990beed9aba690ea9487e2c4a64615b7504a0a1 Date: Fri Aug 29 16:37:43 2014 +0200 Dead code xmlRow is unused since initial import Change-Id: Ief186e9ef46238cc8cdb49f4adde52a45a98cbc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89830 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-01cid#1459028 various checked_return warningsCaolán McNamara1-1/+1
and cid#1459027, cid#1459026, cid#1459025, cid#1459024, cid#1459021, cid#1459018 Change-Id: If92e7665fcf947c5daf3094b9003e85c5c51f48f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89763 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-12clang-analyzer-deadcode.DeadStoresNoel Grandin1-3/+1
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-09Fix typoAndrea Gelmini1-1/+1
Change-Id: I01253631be946fa4d113bb09e0ccb1945ef2ac18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88328 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-02-07test: move component context from subclasses to BootstrapFixtureMiklos Vajna2-6/+0
To avoid duplication. Change-Id: I0ee7c26d5d55bd868ead04c77e7f4ef2582f90e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88138 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-07Remove erroneous whitespace in update_pchMuhammet Kara1-3/+3
This was causing generation of code in violation of clang-format conformance in these files: * xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx * connectivity/inc/pch/precompiled_ado.hxx Also remove these 2 files from the clang-format blacklist. Change-Id: I882028c0553a3ff7fb356611f498d50dea984a7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88143 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-02-03tdf:#54938Adapt supportsService implementations to cppu::supportsServiceiakarsu1-7/+3
Change-Id: I9e2dbdfb8bbf5be4a74b1b581e742b3193b3756b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87496 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-03tdf#54938: Adapt supportsService implementations to cppu::supportsServiceHakan Bakacak1-7/+2
Change-Id: I4f6defffc7489ae95af3e2758327a26374795969 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87501 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák1-1/+3
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-01tdf#54938: Adapt supportsService implementations to cppu::supportsServiceCanberk TURAN2-11/+4
Change-Id: I82fa5528c879f288822fe9795d7d7da19f0abbee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87485 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin1-5/+2
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctorFaruk Demirbaş1-2/+1
Change-Id: I0e792603435b7a1d9fcacf67a694ee8c4cc24a7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87516 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-28remove some unused local varsNoel Grandin1-3/+1
found by my new loplugin:unusedvariableplus Change-Id: Ic3f55f492d43a53d8850a97d44059ff127fd69a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87573 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28remove some unused local varsNoel Grandin1-1/+1
found by my new aggressive unused var plugin. these are unused return values from function calls Change-Id: I3359c583f535828f192cb833762dfedc008d82f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87439 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21Make TempFile destructor remove temp directory recursivelySamuel Mehrbrodt1-60/+0
Change-Id: Idcfa93ffe86112477ad81bcbf74b8e5b858423f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87080 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-01-13tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorMesut Çifci2-6/+3
Change-Id: I7342275928e0231062f378942c567fe993b2a271 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86544 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-08[API CHANGE] extend css.security.XDocumentDigitalSignaturesbrinzing1-2/+45
Add support for macro and package signing with a provided certificate which is already possible for document signing since LO 6.2: boolean signScriptingContentWithCertificate( [in] ::com::sun::star::security::XCertificate xCertificate, [in] ::com::sun::star::embed::XStorage xStorage, [in] ::com::sun::star::io::XStream xStream); boolean signPackageWithCertificate( [in] ::com::sun::star::security::XCertificate xCertificate, [in] ::com::sun::star::embed::XStorage xStorage, [in] ::com::sun::star::io::XStream xStream); Change-Id: I9783cd317a7202691913be186eca95964b1e0ff7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86141 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-01-06tdf#54938 Adapt supportsService implementations to cppu::supportsServiceYusuf Keten1-2/+2
Change-Id: I061db162c44a7196c58f4ae6dae2f37c7ac9213a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86057 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-25sal_Char->char in xmloff..xmlsecurityNoel Grandin2-2/+2
Change-Id: I292d699ce1de10ca9341525161f5da2592102ff7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85778 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-22loplugin:finalclasses in xmlsecurityNoel Grandin10-10/+10
Change-Id: I1c2d0c418d2aa2198c82e89ce048851f30d07a7d Reviewed-on: https://gerrit.libreoffice.org/85698 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>