summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)Author
2018-10-15add SvStream::TellEndNoel Grandin
and simplify callsites to use it instead of the current "seek to end, find pos, seek back to original pos" pattern Change-Id: Ib5828868f73c341891efc759af8bd4695ae2f33c Reviewed-on: https://gerrit.libreoffice.org/61738 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-08tdf#42949 Fix IWYU warnings in include/comphelper/[m-z]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I04c5ba277d5b3398c07de6ae66713d977636088d Reviewed-on: https://gerrit.libreoffice.org/61347 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-04xmlsecurity nss: avoid deleting the dsig context manuallyMiklos Vajna
Change-Id: I0198c1b0d6ba6c27072376943895718d536a284c Reviewed-on: https://gerrit.libreoffice.org/61323 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-02make all notebooks scrollable and enable_popupCaolán McNamara
Change-Id: I16a6d556ca4c6b3f876dc0c8380d01fe3022209e Reviewed-on: https://gerrit.libreoffice.org/61195 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-01tdf#116085 make sure Certificate Manager is found with GPG4win v3Cor Nouws
Change-Id: I3a7ab7ec046a6bbff4b4a020e76356ffd454bab8 Reviewed-on: https://gerrit.libreoffice.org/61061 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-09-27xmlsecurity nss: avoid deleting the keys manager manuallyMiklos Vajna
Change-Id: I53a88116148db9e1ceac4024781516173c3d4666 Reviewed-on: https://gerrit.libreoffice.org/61021 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-09-24loplugin:external (clang-cl)Stephan Bergmann
Including: * expanding STDAPI to its definition (as per <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-20loplugin:useuniqueptr in xmlsecurity::BufferNodeNoel Grandin
Change-Id: Ifaea9f2f0ef5b84372b2ba51deacdb4149bb66e1 Reviewed-on: https://gerrit.libreoffice.org/60616 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-19tdf#118567 Signature Line: Fix ooxml signingSamuel Mehrbrodt
Change-Id: Ie2467db7ab209f10e92b6db1f5680e7a9be614ab Reviewed-on: https://gerrit.libreoffice.org/60676 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-09-19SignatureType should be "2" for ooxml signaturesSamuel Mehrbrodt
This is what recent MS Office writes and means XmlDsig Change-Id: I053f4a3261d7925142666c7d1e2e7dbb51eaff57 Reviewed-on: https://gerrit.libreoffice.org/60675 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-09-18loplugin:unusedfields improve search for unused collection fieldsNoel Grandin
look for collection-like fields that are never added to, and are therefore effectively unused Change-Id: Id52c5500ea5e3d2436fb5915aebb86278bf2d925 Reviewed-on: https://gerrit.libreoffice.org/60661 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17loplugin:simplifyconstruct (clang-cl)Stephan Bergmann
Change-Id: I7cae6b3f31b10efc72884bce4bda7bf6b380cbc2 Reviewed-on: https://gerrit.libreoffice.org/60597 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17tdf#118569 Signature Line: When signing ooxml, only show X.509 certificatesSamuel Mehrbrodt
Also fixes a bug where signing was aborted after saving as docx. Change-Id: Ic42b7de2400be0bc55da03b017a545ceaedef9f9 Reviewed-on: https://gerrit.libreoffice.org/60480 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-15Simplify containers iterations in xmlhelp, xmlreader, xmlscript, xmlsecurityArkadiy Illarionov
Use range-based loop or replace with functions from std algorithm. Change-Id: I5b1859da37c2a6c6e5e70602287bfc2ada951893 Reviewed-on: https://gerrit.libreoffice.org/60463 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13loplugin:simplifyconstruct in writerfilter..xmlsecurityNoel Grandin
Change-Id: Ic2d901ca0dbc2d6fa96611d260c1572da8a783c0 Reviewed-on: https://gerrit.libreoffice.org/60398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-12Simplify containers iterations in xmlsecurityArkadiy Illarionov
Use range-based loop or replace with functions from std algorithm. Change-Id: I0146186b7c42405076dfce7de7805be4228cc6d3 Reviewed-on: https://gerrit.libreoffice.org/60360 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-10tdf#42949 Fix IWYU warnings in include/cppuhelper/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45 Reviewed-on: https://gerrit.libreoffice.org/59297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-06xmlsecurity: just two bools are fine, no need for bitfield complexityMiklos Vajna
Change-Id: I3e28ef5646ff39b0e3e8ed8962bfacf5b79176a7 Reviewed-on: https://gerrit.libreoffice.org/60069 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-09-05Fix typo in codeAndrea Gelmini
It passed "make check" on Linux Change-Id: I1cb32c359d761410cf8e657f8e4e15694836947e Reviewed-on: https://gerrit.libreoffice.org/59985 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-09-05clang-tidy performance-inefficient-vector-operationNoel Grandin
Change-Id: Iebcaea7b08c5284946d83b6b6b9ed26b218025d4 Reviewed-on: https://gerrit.libreoffice.org/59992 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-30xmlsecurity: use comphelper::containerToSequence()Miklos Vajna
Allows not iterating the certificate chain twice. Change-Id: I3993f8af24b28bef505d0e8c24bce8065580c2cf Reviewed-on: https://gerrit.libreoffice.org/59780 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-29Replace find_if with proper quantifier algorithmsArkadiy Illarionov
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29new loplugin:oustringbufferNoel Grandin
look for places where we are appending the temporary result of adding strings together, to an OUStringBuffer, where we could rather call append repeatedly and avoid the temporary creation Change-Id: I481435124291ac7fb54b91a78344a9fe5b379a82 Reviewed-on: https://gerrit.libreoffice.org/59708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-27tdf#119309 xmlsecurity xades: missing XML attribute on idSignedProperties refMiklos Vajna
The AdES validator at <https://ec.europa.eu/cefdigital/DSS/webapp-demo/validation> recently learned to deal with ODF files, this improves its output, so that "Qualification Signature" section is no longer just a red "N/A" but an orange "Indeterminate QESig". Change-Id: I5f47b935f1dbfa4e2eee4654db31403479cb571d Reviewed-on: https://gerrit.libreoffice.org/59633 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-20Simplify containers iterations, tdf#96099 follow-upArkadiy Illarionov
Use range-based loop or replace with std::any_of, std::find and std::find_if where applicable. Change-Id: I2f80788c49d56094c29b102eb96a7a7c079567c6 Reviewed-on: https://gerrit.libreoffice.org/59143 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14xmlsecurity: nsscrypto_initialize: try to avoid profile migrationMichael Stahl
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.35_release_notes NSS 3.35 and later will automatically migrate migrate profiles from the old "dbm:" BDB format to the new "sql:" SQLite format. The new format can be read by NSS 3.12 and later, which is old enough that it can be assumed to be available. However LibreOffice still shouldn't migrate the profile on its own: LO typically uses a Mozilla Firefox or Thunderbird profile, and if it is a system Firefox with system NSS libraries, then it's probably a bad idea for LO to migrate the profile under Firefox's nose, particularly considering the "partial migration" scenario if the profile is password-protected. Try to avoid this by checking if the profile is the old format and explicitly using the "dbm:" prefix to prevent the migration. Change-Id: I06480522f830ce74e2fb7bf79fee84ad80979b82 Reviewed-on: https://gerrit.libreoffice.org/58756 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-09svl windows: remove last traces of pre-CNG signingMiklos Vajna
Mostly only the certificate selector was left + the global runtime switch. Change-Id: I11e8e0920806eb61848512df6dea48c594febfe4 Reviewed-on: https://gerrit.libreoffice.org/58751 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-01forcepoint#57 sanity check stream signature sizeCaolán McNamara
Change-Id: I5ae459e159a64f32c62278a87e37deb08ab9d6ac Reviewed-on: https://gerrit.libreoffice.org/58389 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-01flatten conditionalsCaolán McNamara
Change-Id: I3b3e45a20c41e538849b7b0b4cdf112d8fac8fe7 Reviewed-on: https://gerrit.libreoffice.org/58388 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-30loplugin:stringloop in svgio..xmlsecurityNoel Grandin
Change-Id: I1b2fe5674c8350690efc3d3219b9273cc61d5b0c Reviewed-on: https://gerrit.libreoffice.org/58332 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-23Fix typosAndrea Gelmini
Change-Id: Iebc31a53404da41f35eed7338662365d7efbd7a2 Reviewed-on: https://gerrit.libreoffice.org/57810 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-07-23loplugin:unusedfields,can-be-const in xmlsecurityNoel Grandin
Change-Id: I271b1d69d5231ab76cb49fb0101c09d7c0ef6b79 Reviewed-on: https://gerrit.libreoffice.org/57779 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20writerfilter, xmlsecurity: various small cleanupsMiklos Vajna
That call in the RTFSprms copy ctor to the parent non-copy ctor was a bit odd. Change-Id: Ic219ec22c0b63472766a668406585dbbeebae2f7 Reviewed-on: https://gerrit.libreoffice.org/57763 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-07-19xmlsecurity: stop linking to libxmlsec's mscrypto backendMiklos Vajna
This was only useful when the mscrypto to mscng porting was in progress. Change-Id: I5a062cae744489e5ad311ab6b531d00ea21f4e0a Reviewed-on: https://gerrit.libreoffice.org/57699 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-19loplugin:unusedmethodsNoel Grandin
Change-Id: I2b7a055a44c63bfc072b82580811898e177fbb8e Reviewed-on: https://gerrit.libreoffice.org/57628 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-12Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories w* x* Change-Id: I27bff44da3d34d24262031c7489e755311599bc5 Reviewed-on: https://gerrit.libreoffice.org/57307 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-11xmlsecurity UI: restore lost AdES default for PDF signingMiklos Vajna
Regression from 13596e704e4b48e8b0892867b3f3fc351a2729f9 (Don't pass ODF version, just retrieve it directly, 2018-05-17). Change-Id: Ia031e597c610000db2820920c3dc1b58430dcc12 Reviewed-on: https://gerrit.libreoffice.org/57246 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-10pass SvStream around by std::unique_ptrNoel Grandin
and give utl::OStreamWrapper a new constructor so that it knows it is taking ownership of the SvStream, which appears to fix several leaks Change-Id: Idcbcca9b81a4f0345fd8b8c8a2f4e84213686a6b Reviewed-on: https://gerrit.libreoffice.org/57187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-06xmlsecurity: convert last non-uno-consturctor based serviceMiklos Vajna
Change-Id: Ib8a16c69aa2a05118e329a6552682b7a21d4536a Reviewed-on: https://gerrit.libreoffice.org/57023 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-05tdf#117901 Write signature line images as emf to ooxmlSamuel Mehrbrodt
Change-Id: Idbf60be3cef2d9dde454da0279d2810488b1e157 Reviewed-on: https://gerrit.libreoffice.org/56871 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-06-29ODF1.3: import new OpenPGP encryption markupThorsten Behrens
With OFFICE-3940 the loext markup got accepted for ODF1.3 (and the redundant KeyInfo element removed). Make sure manifest parser can import new markup. Change-Id: Id3c88654e8e6e0e256cd68fbb43f1ef670849cf7 Reviewed-on: https://gerrit.libreoffice.org/56597 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-06-29xmlsecurity: fix -Werror,-Wunused-parameter (!HAVE_FEATURE_GPGME case)Miklos Vajna
Change-Id: I3c10b9eca3efb90a8f0e4c35bd71512f321a05fd
2018-06-29tdf#118425 xmlsecurity UI: fix OOXML signingMiklos Vajna
Regression from 13596e704e4b48e8b0892867b3f3fc351a2729f9 (Don't pass ODF version, just retrieve it directly, 2018-05-17), just checking the file format explicitly like the PDF signing does fixes the problem. Change-Id: I1ba7cf9096e01c6c5a2d3875b08fa3a66acae829 Reviewed-on: https://gerrit.libreoffice.org/56635 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-26tdf#96099 Remove some trivial container iterator typedefsArkadiy Illarionov
Change-Id: Ifec98748d55ff6aca64c425c50c2cf2650f61591 Reviewed-on: https://gerrit.libreoffice.org/56422 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-25xmlsecurity windows: implement ODF sign/verify with ECDSA keysMiklos Vajna
By making it possible to use libxmlsec's mscng backend instead of the old mscrypto one which lacks ECDSA support. make -sr CppunitTest_xmlsecurity_signing SVL_CRYPTO_CNG=1 CPPUNIT_TEST_NAME="SigningTest::testECDSA" passes with these changes, while it failed in the SVL_CRYPTO_CNG=1 case previously. Change-Id: Ic23e5af11d271ed84175abe3d5ad008c7cc9e071 Reviewed-on: https://gerrit.libreoffice.org/56370 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-06-20xmlsec: update to 1.2.26Miklos Vajna
Allows dropping the xmlsec1-ecdsa-assert.patch.1 backport. Also fix the generated test certs + generator script to avoid expired certs for a while (.db files generated with Firefox 57.0). Change-Id: I8cba9a01633a3952c845e15e23b18d44544cdb59 Reviewed-on: https://gerrit.libreoffice.org/56123 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-15tdf#96099 Remove some trivial std::vector iterator typedefsArkadiy Illarionov
Change-Id: Iced10ed59c475dff4d33ff06151b2015a27a860b Reviewed-on: https://gerrit.libreoffice.org/55715 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-06-11loplugin:unusedmethodsNoel Grandin
Change-Id: I26a0da1ec9cda9030371977596053a45303756a0 Reviewed-on: https://gerrit.libreoffice.org/55609 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08xmlsecurity: check for the libxmlsec version runtime, not build-timeMiklos Vajna
For the general benefit of --with-system-xmlsec usage scenarios (where LO may be built against an old version of xmlsec and run against a new one). Change-Id: I4ae582771dbc8eec149a706cfa5ccc0ec0859704 Reviewed-on: https://gerrit.libreoffice.org/55446 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>