summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)Author
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>
2018-06-08look for unnecessary calls to Reference::is() after an UNO_QUERY_THROWNoel Grandin
Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-07Fix CppunitTest_xmlsecurity_signing with system-xmlsec 1.2.26Miklos Vajna
Swap the order of the default and custom callback registration, since the order of lookup is now reversed since <https://github.com/lsh123/xmlsec/commit/968646fb9b8428174a112fce2f08b1ec89d0ed97>. Thanks Tomas Chvatal for reporting this. Change-Id: I60a347454701a679db4ccd8924a723a236d5edff Reviewed-on: https://gerrit.libreoffice.org/55404 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Tomáš Chvátal <tchvatal@suse.cz>
2018-06-07Fix IWYU warningsMiklos Vajna
Change-Id: I0442d201a5175a9929d3ea79d79f80db7930b565 Reviewed-on: https://gerrit.libreoffice.org/55394 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke
and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-05libxmlsec: drop not needed xmlsec1-customkeymanage.patch.1Miklos Vajna
This was added in commit ebd1b95bb5f9235d1dba1b840fd746c9b53320d2 (INTEGRATION: CWS xmlsec08 (1.1.2); FILE ADDED; 2005-03-10) without any real commit message to explain why this is necessary. system-xmlsec (not containing this patch) works fine for our XML signing purposes with software certificates, and just recently I learned that even hardware-based certificates work fine without this patch, so it can go away. I assume this was a refactor to allow some new feature as a next step, but that feature was never implemented. Change-Id: I31639230483cd34b14b35fd41b4fcd8284476138 Reviewed-on: https://gerrit.libreoffice.org/55296 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-01xmlsecurity: add ecdsa option to certificate generator scriptMiklos Vajna
Change-Id: I8bb48c46aaea9ef4ce4bc4ab58ea8b88fe0e48a2 Reviewed-on: https://gerrit.libreoffice.org/55159 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-06-01loplugin: look for CPPUNIT_ASSERT_EQUALS with params swappedNoel Grandin
idea originally from either tml or moggi, can't remember which Change-Id: Id78d75035036d3aa1666e33469c6eeb38f9e624d Reviewed-on: https://gerrit.libreoffice.org/55126 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-01Move signature line to signed propertiesSamuel Mehrbrodt
So that a modification will result in an invalid signature. Change-Id: Ib40e0b941d56e29c134993e1d41f496aa183bd7f Reviewed-on: https://gerrit.libreoffice.org/55079 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-30Fix commentsSamuel Mehrbrodt
Signature lines is no longer ooxml specific Change-Id: I092dbc31b30d30bf68b4cb733cb7cb8520c99738 Reviewed-on: https://gerrit.libreoffice.org/55058 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-30xmlsecurity windows: let cert picker and PDF sign find ECDSA keysMiklos Vajna
Need to incrementally migrate the remaining places (ODF, OOXML signing) to CNG, then flip the default. SVL_CRYPTO_CNG=1 is needed till then. (The testcase passes with and without the fix when SVL_CRYPTO_CNG is not specified; it fails without the fix when SVL_CRYPTO_CNG is specified.) Change-Id: Ide9d3b109bbd955a9cb83b18bba6aa72269f4d34 Reviewed-on: https://gerrit.libreoffice.org/55030 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-25xmlsecurity nss: fix OOXML signing with ECDSA keyMiklos Vajna
Change-Id: Id2b59887fcd69e294a6d9db17ec0446615054ecc Reviewed-on: https://gerrit.libreoffice.org/54779 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-24xmlsecurity: Ask current datetime only onceTakeshi Abe
... and pass it as the sole argument to XMLSignatureHelper::SetDateTime(). Change-Id: I7f3e8dc90bb34ca347a1ad5a79717a338af3bed9 Reviewed-on: https://gerrit.libreoffice.org/54706 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-23Remove leftover "#undef DEBUG"Stephan Bergmann
...which might have had a purpose in the past, but look unused today. (DEBUG is defined in solenv/gbuild/gbuild.mk iff dbglevel >= 2, and `make Library_xsec_xmlsec dbglevel=2` doesn't run into any problems for me with the undefs removed.) Change-Id: I7f941e8c2d454f4206fb17bc791247606ffe6309 Reviewed-on: https://gerrit.libreoffice.org/54718 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-22Related tdf#83877 Select certificate ok button label doesn't matchSamuel Mehrbrodt
Change the button to "Select" instead of sign when we only want to select a certificate. Change-Id: Ifa896e502c8680497d71912ddd1058ab0b71542b Reviewed-on: https://gerrit.libreoffice.org/52823 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-22tdf#83877 Use Signer comments as signature descriptionSamuel Mehrbrodt
Change-Id: Ia9f18addeee9cf86989c873419113ddbd07c219f Reviewed-on: https://gerrit.libreoffice.org/54551 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-22tdf#83877 Add valid/invalid images to signaturesSamuel Mehrbrodt
Change-Id: I958c1bad2f32383ebaaeb7d42c761f0d1dfefc35 Reviewed-on: https://gerrit.libreoffice.org/54513 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-18tdf#83877 Write SignatureLineId to ODF & OOXML signaturesSamuel Mehrbrodt
Change-Id: I483a3b7895cdcb10ef9d6dacf167ed0f8db7e723 Reviewed-on: https://gerrit.libreoffice.org/54432 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-18tdf#109180 xmlsecurity nss: fix signing with ECDSA keyMiklos Vajna
Using an ECDSA key but writing RSA URIs would fail later in libxmlsec. Also fix up CppunitTest_xmlsecurity_signing (env vars were set too late), so that the new testcase actually fails without the fix. Change-Id: I9e584844d5cd046952b2f19130aeaa5a765bfc0a Reviewed-on: https://gerrit.libreoffice.org/54400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-18Fix some IWYU warningsMiklos Vajna
Change-Id: I11d874caad9174fb1a70121f1772e117753ee519 Reviewed-on: https://gerrit.libreoffice.org/54503 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-15Sign Signature LineSamuel Mehrbrodt
This adds a new context menu entry "Sign Signature Line" to signature lines. You can directly sign the document from there. Still missing is the updating of the graphic to reflect the valid/invalid signature state. Change-Id: Ib8bc8c57f9d5370a10e379f86f9e41e57c715e3f Reviewed-on: https://gerrit.libreoffice.org/53778 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-05Fix typosAndrea Gelmini
Change-Id: I92078fdece135754744d85424956dbb071f3899e Reviewed-on: https://gerrit.libreoffice.org/53638 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-05-04xmlsecurity windows: stop using the "xmlSec" prefix for own codeMiklos Vajna
xmlSec is the prefix for symbols from libxmlsec, it's confusing if our own code uses that as well. Change-Id: I3b003d2de067ba85e9f092c3c6aeac00dd4b1784 Reviewed-on: https://gerrit.libreoffice.org/53820 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-27xmlsecurity: remove duplicated Windows-specific component fileMiklos Vajna
Change-Id: Iefc96ded8e53004a22041ee4299200a3d02a7eb5 Reviewed-on: https://gerrit.libreoffice.org/53545 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-26xmlsecurity mscrypto: create SEInitializer instances with a constructorMiklos Vajna
Allows getting rid of the xsec_mscrypt / xsec_nss factory constructs. Change-Id: Idcc3351f7cc3b37a65e6f78018f062439e48bc3d Reviewed-on: https://gerrit.libreoffice.org/53463 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-25SvTabListBox::SetTabs, pass count explicitNoel Grandin
passing count as first element in array, dodgy. Change-Id: I49905b554b3b4d6cc3fa419a36389cd2e5ded463