summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)Author
2020-09-06fix non-pdfium buildNoel Grandin
Change-Id: I996164480d75ca3739942f6a1c06bbb4a1c400d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-04TabPage no longer needs to inherit from VclBuilderContainerCaolán McNamara
Change-Id: Iaab26ade1109daf732e58a2f3741cc43243e374c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102023 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-04xmlsecurity: pdf incremental updates that are non-commenting are invalidMiklos Vajna
I.e. it's OK to add incremental updates for annotation/commenting purposes and that doesn't invalite existing signatures. Everything else does. Change-Id: I4607c242b3c6f6b01517b02407e9e7a095e2e069 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102057 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-09-04Make many OUString functions take std::u16string_view parametersStephan Bergmann
...instead of having individual overloads for OUString, OUStringLiteral, and literal char16_t const[N]. (The variants taking OUString are still needed for !LIBO_INTERNAL_ONLY, though. The variants taking ASCII-only literal char const[N] are also left in place.) This nicely reduces the number of needed overloads. std::u16string_view allows to pass as arguments: * OUString * OUStringLiteral * OUStringChar (with the necessary conversion added now) * OUStringNumber * u"..." char16_t string literals * u"..."sv std::u16string_view literals * std::u16string, plain char16_t*, and more A notable exceptions is OUStringConcat, which now needs to be wrapped in OUString(...), see the handful of places that needed to be adapted. One caveat is the treatment of embedded NUL characters, as std::u16string_view(u"x\0y") constructs a view of size 1, while only u"x\0y"sv constructs a view of size 3 (which matches the old behavior of overloads for literal char16_t const[N] via the ConstCharArrayDetector<>::TypeUtf16 machinery). See the new checkEmbeddedNul in sal/qa/rtl/strings/test_oustring_stringliterals.cxx. The functions that have been changed are generally those that: * already take a string of determined length, so that using std::u16string_view, which is always constructed with a determined length, is no pessimization (e.g., there are operator == overloads taking plain pointers, which do not need to determine the string length upfront); * could not benefit from the fact that the passed-in argument is an OUString (e.g., the corresponding operator = overload can reuse the passed-in OUString's rtl_uString pData member); * do not run into overload resolution ambiguity issues, like the comparison operators would do. One inconsistency that showed up is that while the original replaceAll(OUString const &, OUString const &, sal_Int32 fromIndex = 0) overload takes an optional third fromIndex argument, the existing replaceAll overloads taking OUStringLiteral and literal char16_t const[N] arguments did not. Fixing that required a new (LIBO_INTERNAL_ONLY) rtl_uString_newReplaceAllFromIndexUtf16LUtf16L (with test code in sal/qa/rtl/strings/test_strings_replace.cxx). Another issue was posed by test code in sal/qa/rtl/strings/test_oustring_stringliterals.cxx that used the RTL_STRING_UNITTEST-only OUString(Except*CharArrayDetector) ctors to verify that certain function calls should not compile (and would compile under RTL_STRING_UNITTEST by taking those Except*CharArrayDetector converted to OUString as arguments). Those problematic "should fail to compile" tests have been converted into a new CompilerTest_sal_rtl_oustring. Change-Id: Id72e8c4cc338258cadad00ddc6ea5b9da2e1f780 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102020 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-02xmlsecurity: avoid saying OK when the signature is partialMiklos Vajna
That's reserved for valid signatures (digest match, certificate validates and the signature covers the whole document). Also avoid "invalid" in the dialog when the digest matches and the signature is just incomplete. This now uses wording which is closer to Acrobat and also uses the same wording on the infobar and in the dialog. Change-Id: I26e4781d555b65cf29aa8df2232e286917235dc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101926 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-09-02move Edit into toolkit only headersCaolán McNamara
Change-Id: If51bf7143116721e8f16272cf8aff797651d5ed1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101880 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-02Remove some unused includesMiklos Vajna
Change-Id: I90d4e3db3eefa41f8492cfe23c5088ea93134afc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101890 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-01Fix typoAndrea Gelmini
Change-Id: I03dc9ad3ad496524efbbb2f1a48f76fb95d1bfc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101781 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-31xmlsecurity: fix infobar vs signature dialog inconsistencyMiklos Vajna
The infobar mentioned if a signature is partial, but the dialog just has a bool UI for signatures. Then present "good, but partial" as "bad". Change-Id: I698190aa77702000b11d635bd038d9c9a91614ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101712 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-27remove some unused includes and update pchesCaolán McNamara
Change-Id: I786548bef39fa711aabcff32b592b3fdc4a6f9fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101486 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-24tdf#118148 Extended tips from HC2/shared/Olivier Hallot
These extended tips are extracted from <ahelp> in Help files Only for ui files, where dialogs/widget pair could be determined. Other forms of <ahelp hid=".."> such as .uno:.. and *HID* ... will be addressed elswhere. Change#1 Removed extended tips from GtkMenu of svx/.../acceptrejectchangesdialog.ui Change#2 Some empty ET's slipped in cui/macroselectdialog.ui Change-Id: Ic8dc62734143f621fcd3c4156fc004f585630277 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101186 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-21tdf#118148 All extended tips for shared/optionenOlivier Hallot
Extended tips extracted from <ahelp> in all remaining shared/optionen help pages Change-Id: Id35ce9d51ebf0f7fbe1b399ccabbf85a2c145f6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99825 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-08-19update pchesCaolán McNamara
Change-Id: I6a300169d33bdc36e4c7e720a7afc336a86eea68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100962 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-13Remove some unused includesMiklos Vajna
Change-Id: Iea6b931b1f2328886354f70ad81a3e07367db717 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100669 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-08-12SvTreeListBox can move into toolkit headers nowCaolán McNamara
Change-Id: I6b3b6ef1530a192f4b6bf87aa9688687063683ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100591 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-08Remove dead codeStephan Bergmann
mxComponent is known to be null at the start of a test function Change-Id: Ifb3b7dd33769ef71d980fb110eab2dceb03bc52c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100370 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-08Database document apparently needs to be closed before it is disposedStephan Bergmann
Otherwise, if a test like testPreserveMacroTemplateSignature10::TestBody from xmlsecurity/qa/unit/signing/signing.cxx happens to be executed after testPreserveMacroSignatureODB::TestBody from xmlsecurity/qa/unit/signing/signing2.cxx during CppunitTest_xmlsecurity_signing, it would SIGABRT with something like > warn:sfx.view:1935717:1935717:sfx2/source/view/frmload.cxx:489: DBG_UNHANDLED_EXCEPTION in static void (anonymous namespace)::SfxFrameLoader_Impl::impl_handleCaughtError_nothrow(const com::sun::star::uno::Any &, const ::comphelper::NamedValueCollection &) exception: com.sun.star.lang.DisposedException message: Frame disposed /home/sbergman/lo/core/framework/source/services/frame.cxx:362 > warn:legacy.osl:1935717:1935717:vcl/source/window/window.cxx:273: Window ( 19SfxFrameWindow_Impl()) with live children destroyed: 23SfxFrameViewWindow_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() > Window ( 19SfxFrameWindow_Impl()) with live children destroyed: 23SfxFrameViewWindow_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() at > #7 0x00007ff59b2599e9 in SalAbort(rtl::OUString const&, bool) (rErrorText="Window ( 19SfxFrameWindow_Impl()) with live children destroyed: 23SfxFrameViewWindow_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow("..., bDumpCore=true) at vcl/source/app/salplug.cxx:303 > #8 0x00007ff59b08c751 in Application::Abort(rtl::OUString const&) (rErrorText="Window ( 19SfxFrameWindow_Impl()) with live children destroyed: 23SfxFrameViewWindow_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow() 21SfxEmptySplitWin_Impl() 14SfxSplitWindow("...) at vcl/source/app/svapp.cxx:281 > #9 0x00007ff59a846f98 in vcl::Window::dispose() (this=0x4ea35d0) at vcl/source/window/window.cxx:274 > #10 0x00007ff5954ff853 in SfxFrameWindow_Impl::dispose() (this=0x4ea35d0) at sfx2/source/view/frame2.cxx:82 > #11 0x00007ff59aad5161 in VclReferenceBase::disposeOnce() (this=0x4ea3818) at vcl/source/outdev/vclreferencebase.cxx:38 > #12 0x00007ff591c3815b in VclPtr<OutputDevice>::disposeAndClear() (this=0x7ffd92f67810) at include/vcl/vclptr.hxx:206 > #13 0x00007ff591cbaeb8 in VCLXWindow::dispose() (this=0x52fb4c0) at toolkit/source/awt/vclxwindow.cxx:920 > #14 0x00007ff59300e147 in (anonymous namespace)::XFrameImpl::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) (this=0x4f02260, xComponentWindow=empty uno::Reference, xController=empty uno::Reference) at framework/source/services/frame.cxx:1514 > #15 0x00007ff5930104ee in (anonymous namespace)::XFrameImpl::close(unsigned char) (this=0x4f02260, bDeliverOwnership=1 '\001') at framework/source/services/frame.cxx:1692 > #16 0x00007ff593016633 in (anonymous namespace)::XFrameImpl::implts_checkSuicide() (this=0x4f02260) at framework/source/services/frame.cxx:3189 > #17 0x00007ff59300ffb4 in (anonymous namespace)::XFrameImpl::removeActionLock() (this=0x4f02260) at framework/source/services/frame.cxx:2683 > #18 0x00007ff592fa892f in framework::ActionLockGuard::freeResource() (this=0x7ffd92f68bd0) at framework/source/inc/loadenv/actionlockguard.hxx:123 > #19 0x00007ff592f9e2de in framework::LoadEnv::impl_reactForLoadingState() (this=0x7ffd92f68ac8) at framework/source/loadenv/loadenv.cxx:1637 > #20 0x00007ff592f9d9fc in framework::LoadEnv::impl_setResult(bool) (this=0x7ffd92f68ac8, bResult=false) at framework/source/loadenv/loadenv.cxx:515 > #21 0x00007ff592f9d851 in framework::LoadEnv::impl_loadContent() (this=0x7ffd92f68ac8) at framework/source/loadenv/loadenv.cxx:1160 > #22 0x00007ff592f9a502 in framework::LoadEnv::start() (this=0x7ffd92f68ac8) at framework/source/loadenv/loadenv.cxx:395 > #23 0x00007ff592f98261 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) (this=0x7ffd92f68ac8, sURL="file:///xmlsecurity/qa/unit/signing/data/tdf42316.ott", lMediaDescriptor=uno::Sequence of length 2 = {...}, xBaseFrame=uno::Reference to (class framework::Desktop *) 0x18b3c48, sTarget="_default", nSearchFlags=0, eFeature=LoadEnvFeatures::NONE) at framework/source/loadenv/loadenv.cxx:300 > #24 0x00007ff592f96bdc in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (xLoader=uno::Reference to (class framework::Desktop *) 0x18b3c58, xContext=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0xa6aeb0, sURL="file:///xmlsecurity/qa/unit/signing/data/tdf42316.ott", sTarget="_default", nSearchFlags=0, lArgs=uno::Sequence of length 2 = {...}) at framework/source/loadenv/loadenv.cxx:169 > #25 0x00007ff592ff8ce2 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x18b3be0, sURL="file:///xmlsecurity/qa/unit/signing/data/tdf42316.ott", sTargetFrameName="_default", nSearchFlags=0, lArguments=uno::Sequence of length 2 = {...}) at framework/source/services/desktop.cxx:593 > #26 0x00007ff592ff8da5 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () at workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/lang/XComponent.hpp:136 > #27 0x00007ff593d7bb28 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x18a6d80, rURL="file:///xmlsecurity/qa/unit/signing/data/tdf42316.ott", rDocService="", rExtraArgs=uno::Sequence of length 1 = {...}) at unotest/source/cpp/macros_test.cxx:61 > #28 0x00007ff5956b132d in testPreserveMacroTemplateSignature10::TestBody() (this=0x18a6d30) at xmlsecurity/qa/unit/signing/signing.cxx:1243 Change-Id: If2c45a8fc8d907b12f4d92c77f524d50d9e928cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100344 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-06Missing test dependencyStephan Bergmann
> warn:vcl.builder:1203254:1203254:vcl/source/window/builder.cxx:462: DBG_UNHANDLED_EXCEPTION in VclBuilder::VclBuilder(vcl::Window*, const rtl::OUString&, const rtl::OUString&, const rtl::OString&, const com::sun::star::uno::Reference<com::sun::star::frame::XFrame>&, bool, const NotebookBarAddonsItem*) > when: Unable to read .ui file exception: com.sun.star.container.NoSuchElementException message: file:///instdir/share/config/soffice.cfg/svt/ui/editcontrol.ui xmlreader/source/xmlreader.cxx:66 Change-Id: Id2a686a7da40df651e91b88fd92177251dca6742 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100238 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-06unotest: one Resetter is enoughMiklos Vajna
It seems all 3 places derive from unotest::MacrosTest, so extract the common code there. Change-Id: I71a2474a7d6b1623f50575f9e9c43580ba076330 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100185 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-08-03tdf#42949 Fix IWYU warnings in include/[t-x]*/*hxxGabor Kelemen
Recheck after 7-0 branchoff Also drop the now unused file include/vcl/field.hxx Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9e54c82f50d1e02a0f99858939cac999fc66f7de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99261 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-08-02loplugin:flatten in xmlsecurityNoel Grandin
Change-Id: Ic9e410c77a04edbd58485d4177da22e17efa8720 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99964 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-24xmlsecurity: detect unsigned incremental update between signaturesMiklos Vajna
Change-Id: I269ed858852ee7d1275adf340c8cc1565fc30693 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99361 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-07-20compact namespace declNoel Grandin
used git grep -lw namespace | xargs perl -i -p0e 's/(\w+)\s*.\{.\s*namespace\s*(\w+)/\1::\2/smg;' to do the initial replace, then compiled and fixed. Change-Id: If69904d75940c851aeffab0e78c4ba02cc968d44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-12update pchesCaolán McNamara
Change-Id: I75602277a5a26b012a12f2c4f4b7ff5bb663b0b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-10replace usage of blacklist with denylistThorsten Behrens
.. and a few cases of instead doing blacklist->excludelist where that made more sense. Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 [API CHANGE] officecfg::Office::Canvas::DeviceBlacklist -> DeviceDenylist [API CHANGE] officecfg::Office::Canvas::BlacklistCurrentDevice -> DenylistCurrentDevice [API CHANGE] officecfg::Office::Common::Misc::OpenCLBlackList -> OpenCLDenyList Change-Id: Ia35e25496bf0cc0692d5de4cb66bfc232d3a869e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98180 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-03[API CHANGE] Move NSS profile handling into NSS serviceJan-Marek Glogowski
While developing the patchset for tdf#127909, I broke the certificate path dialog, because I wasn't aware, that the NSSInitializer service has to use the same logic to auto- select the users profile, then the dialog. So currently you have to keep the complex service and dialog auto-select logic in sync. To prevent this error, this moves all the profile auto-selection and enumeration into the NSSInitializer service. What I also stumbled over is the particular lifecycle of the NSS library initialization in the NSS service. This is just done, when the first user calls some crypto function. As a result it's actually possible to change the path setting without restarting LibreOffice. But since the NSS deninitialization is run as an atexit handler, this setting can't be changed after the init. What is currently missing is any indication inside the dialog of the currently active NSS setting in comparison to any later user selection, if the user doesn't restart LibreOffice as requested. Change-Id: I886962777958c363abeb0ec91fc8a35cbd39eb98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97668 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-07-01Remove some unused includesMiklos Vajna
Change-Id: I44c9ad2511d484e3c7fb1c33f25fcb343eabd232 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97548 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-26Upcoming improved loplugin:elidestringvar: xmlsecurityStephan Bergmann
Change-Id: I1490e79489a98dd97ec31d6b52b4f05a1411de79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97212 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-25sd signature line: pass the model down to xmlsecurityMiklos Vajna
So it can avoid SfxObjectShell::Current(), which is only correct when a single document is open. Also add an sfx2::DigitalSignatures interface so this can be done without UNO API changes. Change-Id: Ie81996b8f1e8851975b27c43a53f9d23e316004e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97116 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-06-25sd signature line: place shape on the correct pageMiklos Vajna
PDFDocument::Sign() had this hardcoded to always place the signature widget on the first page, add a way so that xmlsecurity/ can tell the pdf signing code to put it on an other page. This way in case the user created the signature line shape on the Nth page, it'll end up on the Nth page of the PDF result as well, as expected. Change-Id: I63decba98774151e9634ea924c2fed0f7814cb28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97045 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-06-23tdf#97694 Add test for macro signature preservation in BaseSamuel Mehrbrodt
Change-Id: I35fb8d499eed66f9a5e208a4778a1f0f12637079 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93630 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-06-19Move data for signing tests to test/Miklos Vajna
This was duplicated under xmlsecurity and made it hard to have test code outside xmlsecurity, even if the core of the pdf signing is nowadays under svl/. Change-Id: If5ce8269bb72f503263727d8255fe856742dfa60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96745 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-06-19sd signature line: add testcaseMiklos Vajna
Fails with commit 9b7a890fd59744459692d7f66402c6bdd25acec4 (sd signature line: include shape in the appearance widget, 2020-06-19) reverted. Change-Id: Ib237774374553af5d37c9deaffdea6fae65a28f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96737 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-06-16sd signature line: access the pdf shape from the appearance writerMiklos Vajna
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 Vajna
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 McNamara
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 Bergmann
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 Vajna
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 Stahl
... 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 Stahl
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 Stahl
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 Stahl
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 Stahl
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 Grandin
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 Grandin
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 Grandin
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 Grandin
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 Grandin
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>