summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)AuthorFilesLines
2018-03-26gpg4libre: fix failing gpg test due to over-long filenamesRene Engelhard2-1/+21
This squashes the following commits: From f68929ac611fdda19c1ee413effc59d33aa5ef97 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens <Thorsten.Behrens@CIB.de> Date: Fri, 9 Mar 2018 01:38:26 +0100 Subject: gpg4libre: fix failing gpg test due to over-long filenames With long workdir path, gpg sometimes fails with 'gpg: can't connect to the agent: File name too long' error. WK recommends to create preferred socket dir under /run/user, needs prepping though via gpgconf. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84720 From d7ecf4a4e37a9eeffa2b40f9fe5a2e6a8f90c876 Mon Sep 17 00:00:00 2001 From: Rene Engelhard <rene@debian.org> Date: Sun, 18 Mar 2018 11:25:41 +0100 Subject: properly check for gpgconf (and --create-socketdir) working From d6ed1d415d36809d784af780231258ea0ee1024f Mon Sep 17 00:00:00 2001 From: Rene Engelhard <rene@debian.org> Date: Sun, 18 Mar 2018 19:06:58 +0100 Subject: actually add GPGCONF to config_host.mk.in From 7a95ee8d0badb2cbbd137a6e18af1bada35ae933 Mon Sep 17 00:00:00 2001 From: Rene Engelhard <rene@debian.org> Date: Sun, 18 Mar 2018 19:26:45 +0100 Subject: actually add HAVE_GPGCONF_SOCKETDIR to config_host.mk.in... From 5204a5145d8232ea0650144fb4756c38303ef06e Mon Sep 17 00:00:00 2001 From: Rene Engelhard <rene@debian.org> Date: Sun, 18 Mar 2018 19:28:55 +0100 Subject: revert accidentially comitted local changes :( From bc358d39ac985914160e8aaa23b29469470c032b Mon Sep 17 00:00:00 2001 From: Rene Engelhard <rene@debian.org> Date: Sun, 18 Mar 2018 20:36:45 +0100 Subject: this is sh, not make... Change-Id: I7880fd7eee57cedc19b72348b45f0c1389409fe6 Reviewed-on: https://gerrit.libreoffice.org/51521 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-02forcepoint #16: fix heap-use-after-freeMiklos Vajna2-0/+2
PDFDocument::Tokenize() in the aKeyword == "obj" case allocates a PDFObjectElement, stores it as an owning pointer inside rElements, and also stores two non-owning references to it in m_aOffsetObjects and m_aIDObjects. So make sure those 2 other containers are also cleared then elements go away. LO_TRACE="valgrind" bin/run pdfverify <sample> doesn't report errors anymore after the fix. Change-Id: Ie103de3e24a1080257a79e53b994e8536a9597bc Reviewed-on: https://gerrit.libreoffice.org/50631 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2018-02-23tdf#115374: add GPG SEInitializer service for WindowsThorsten Behrens1-0/+3
Amends commit 1c58b047d117bb087abc571b74c06cdf7499b1a0, seems we need that now on Windows, too Change-Id: Ia0c5e1e577a4f8dfe02b4d8eda0d220fa5e5f2a1 Reviewed-on: https://gerrit.libreoffice.org/50235 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit e2d8e2e0e2248de980f59af15e8b3472c8f56f70) Reviewed-on: https://gerrit.libreoffice.org/50255 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-02-21gpgmepp,xmlsecurity: fix testODFEncryptedGPG() failure caused...Michael Stahl1-2/+1
...by CppunitTest setting LD_LIBRARY_PATH to include instdir/program. This causes the spawned gpg-agent to load instdir/program/libassuan.so.0 instead of /usr/... and fail with: writev(2, [{iov_base="gpg-agent", iov_len=9}, {iov_base=": ", iov_len=2}, {iov_base="relocation error", iov_len=16}, {iov_base=": ", iov_len=2}, {iov_base="gpg-agent", iov_len=9}, {iov_base=": ", iov_len=2}, {iov_base="symbol assuan_sock_set_system_ho"..., iov_len=118}, {iov_base="", iov_len=0}, {iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 10) = 159 The failure happens in the libreoffice-6-0 branch on Fedora 27, whereas the master branch doesn't fail because it has a newer version of libassuan that happens to provide the required symbol. Fix this by applying the patch that was added for ASAN in d15f042abd5a1093984a0c8380837145f38c4efc to clear LD_LIBRARY_PATH always on Linux. Change-Id: I6a5c7fdfdd32234f39a182581b03d79739880c11 Reviewed-on: https://gerrit.libreoffice.org/50056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 81e4be9cd39f1ae794a96471bf48637312a0f781) Reviewed-on: https://gerrit.libreoffice.org/50059 Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-21CppunitTest_xmlsecurity_signing failed in sanitizer buildsStephan Bergmann1-0/+8
...because external/gpgmepp spawns /usr/bin/gpgconf (and later on /usr/bin/ggp2, /usr/bin/gpgsm) which all depend on libgpg-error.so.0, so due to CppunitTest's LD_LIBRARY_PATH will pick up instdir/program/libgpg-error.so.0, which fails due to > /usr/bin/gpgconf: symbol lookup error: /data/sbergman/lo-san/core/instdir/program/libgpg-error.so.0: undefined symbol: __asan_option_detect_stack_use_after_return The easiest fix appears to be, when running sanitizers on Linux, to hack gpgmepp's _gpgme_io_spawn to set LD_LIBRARY_PATH back to its original state. (When it was originally unset, it will now be set but null, but that should not make a difference.) This requires EXTRA_ENV_VARS to be set earlier in CppunitTest.mk, so setting LIBO_LD_PATH doesn't use the LD_LIBRARY_PATH value set in gb_CppunitTest_CPPTESTPRECOMMAND. The backtrace of the first, originally failing call to _gpgme_io_spawn during CppunitTest_xmlsecurity_signing: > #0 0x00007fffe1f354dc in _gpgme_io_spawn (path=0x1 <error: Cannot access memory at address 0x1>, argv=0x7ffff2fbd4e0, flags=0, fd_list=0x9, atfork=0x4e, atforkvalue=0x7ffff2fbd4e0, r_pid=0x7ffff2fbd4e0) at posix-io.c:433 > #1 0x00007fffe1f41971 in read_gpgconf_dirs (pgmname=0x6110002f8e00 "/usr/bin/gpgconf", components=0) at dirinfo.c:206 > #2 0x00007fffe1f3fa29 in get_gpgconf_item (what=12) at dirinfo.c:284 > #3 0x00007fffe1f4073e in _gpgme_get_default_gpg_name () at dirinfo.c:370 > #4 0x00007fffe1e87093 in engine_get_file_name (proto=GPGME_PROTOCOL_OpenPGP) at engine.c:79 > #5 0x00007fffe1e84e89 in gpgme_get_engine_info (info=0x7ffff2a06160) at engine.c:230 > #6 0x00007fffe1e845ef in gpgme_engine_check_version (proto=GPGME_PROTOCOL_OpenPGP) at engine.c:144 > #7 0x00007fffe634e7d9 in GpgME::checkEngine(GpgME::Protocol) (proto=GpgME::OpenPGP) at context.cpp:1610 > #8 0x00007fff8df3fd49 in SecurityEnvironmentGpg::SecurityEnvironmentGpg() (this=0x6060005825c0) at xmlsecurity/source/gpg/SecurityEnvironment.cxx:30 > #9 0x00007fff8df5755e in SEInitializerGpg::createSecurityContext(rtl::OUString const&) (this=0x606000582560) at xmlsecurity/source/gpg/SEInitializer.cxx:45 > #10 0x00007fff8df57bb3 in non-virtual thunk to SEInitializerGpg::createSecurityContext(rtl::OUString const&) () at include/rtl/stringutils.hxx:170 > #11 0x00007fffab66de90 in DocumentSignatureManager::init() (this=0x7ffff2fbb020) at xmlsecurity/source/helper/documentsignaturemanager.cxx:78 > #12 0x00007fffab498504 in DocumentDigitalSignatures::ImplVerifySignatures(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, DocumentSignatureMode) (this=0x6080001aaf20, rxStorage=uno::Reference to (OStorage *) 0x60d0003a4c48, xSignStream=empty uno::Reference, eMode=DocumentSignatureMode::Content) at xmlsecurity/source/component/documentdigitalsignatures.cxx:264 > #13 0x00007fffab497f8b in DocumentDigitalSignatures::verifyDocumentContentSignatures(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&) (this=0x6080001aaf20, rxStorage=uno::Reference to (OStorage *) 0x60d0003a4c48, xSignInStream=empty uno::Reference) at xmlsecurity/source/component/documentdigitalsignatures.cxx:127 > #14 0x00007fffab49c35b in non-virtual thunk to DocumentDigitalSignatures::verifyDocumentContentSignatures(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&) () at include/cppu/unotype.hxx:136 > #15 0x00007fffafc062a3 in SfxObjectShell::ImplAnalyzeSignature(bool, com::sun::star::uno::Reference<com::sun::star::security::XDocumentDigitalSignatures> const&) (this=0x61100021c7c0, bScriptingContent=false, xSigner=empty uno::Reference) at sfx2/source/doc/objserv.cxx:1293 > #16 0x00007fffafc074b1 in SfxObjectShell::ImplGetSignatureState(bool) (this=0x61100021c7c0, bScriptingContent=false) at sfx2/source/doc/objserv.cxx:1322 > #17 0x00007fffafc0383d in SfxObjectShell::GetDocumentSignatureState() (this=0x61100021c7c0) at sfx2/source/doc/objserv.cxx:1485 > #18 0x00007fffafbb323c in SfxObjectShell::CheckForBrokenDocSignatures_Impl() (this=0x61100021c7c0) at sfx2/source/doc/objmisc.cxx:981 > #19 0x00007fffafbb2da4 in SfxObjectShell::CheckSecurityOnLoading_Impl() (this=0x61100021c7c0) at sfx2/source/doc/objmisc.cxx:931 > #20 0x00007fffafbb95cf in SfxObjectShell::FinishedLoading(SfxLoadedFlags) (this=0x61100021c7c0, nFlags=SfxLoadedFlags::ALL) at sfx2/source/doc/objmisc.cxx:1079 > #21 0x00007fff716a9185 in SwDocShell::LoadingFinished() (this=0x61100021c7c0) at sw/source/uibase/app/docsh.cxx:1153 > #22 0x00007fff71759ada in SwDocShell::Load(SfxMedium&) (this=0x61100021c7c0, rMedium=...) at sw/source/uibase/app/docshini.cxx:581 > #23 0x00007fffafc2bd9a in SfxObjectShell::LoadOwnFormat(SfxMedium&) (this=0x61100021c7c0, rMedium=...) at sfx2/source/doc/objstor.cxx:2971 > #24 0x00007fffafc3128c in SfxObjectShell::DoLoad(SfxMedium*) (this=0x61100021c7c0, pMed=0x60300083dac0) at sfx2/source/doc/objstor.cxx:714 > #25 0x00007fffafdd88d8 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x6190000fb0b0, seqArguments=uno::Sequence of length 13 = {...}) at sfx2/source/doc/sfxbasemodel.cxx:1788 > #26 0x00007fffb049a98a in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (this=0x6060004aaec0, rArgs=uno::Sequence of length 11 = {...}, _rTargetFrame=uno::Reference to ((anonymous namespace)::Frame *) 0x6160000c63f0) at sfx2/source/view/frmload.cxx:693 > #27 0x00007fff82d6a7ee in framework::LoadEnv::impl_loadContent() (this=0x7ffff2fe3040) at framework/source/loadenv/loadenv.cxx:1105 > #28 0x00007fff82d5aa6b in framework::LoadEnv::startLoading() (this=0x7ffff2fe3040) at framework/source/loadenv/loadenv.cxx:374 > #29 0x00007fff82d56633 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 (framework::Desktop *) 0x6160000153f8, xContext=uno::Reference to (cppu::ComponentContext *) 0x611000002b10, sURL="file:///xmlsecurity/qa/unit/signing/data/goodGPG.odt", sTarget="_default", nFlags=0, lArgs=uno::Sequence of length 2 = {...}) at framework/source/loadenv/loadenv.cxx:160 > #30 0x00007fff82ec93f0 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x616000015380, sURL="file:///xmlsecurity/qa/unit/signing/data/goodGPG.odt", sTargetFrameName="_default", nSearchFlags=0, lArguments=uno::Sequence of length 2 = {...}) at framework/source/services/desktop.cxx:618 > #31 0x00007fff82ec95eb 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 include/rtl/stringutils.hxx:170 > #32 0x00007fffabe3097d in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x60c000035e48, rURL="file:///xmlsecurity/qa/unit/signing/data/goodGPG.odt", rDocService="com.sun.star.text.TextDocument", rExtraArgs=empty uno::Sequence) at unotest/source/cpp/macros_test.cxx:50 > #33 0x00007fffb2ba9d2a in SigningTest::createDoc(rtl::OUString const&) (this=0x60c000035e00, rURL="file:///xmlsecurity/qa/unit/signing/data/goodGPG.odt") at xmlsecurity/qa/unit/signing/signing.cxx:204 > #34 0x00007fffb2bd1532 in SigningTest::testODFGoodGPG() (this=0x60c000035e00) at xmlsecurity/qa/unit/signing/signing.cxx:690 > #35 0x00007fffb2c304fd in std::__invoke_impl<void, void (SigningTest::*&)(), SigningTest*&>(std::__invoke_memfun_deref, void (SigningTest::*&)(), SigningTest*&) (__f=@0x6030001f0480: (void (SigningTest::*)(SigningTest * const)) 0x7fffb2bd0d80 <SigningTest::testODFGoodGPG()>, __t=@0x6030001f0490: 0x60c000035e00) at /usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/invoke.h:73 > #36 0x00007fffb2c300e0 in std::__invoke<void (SigningTest::*&)(), SigningTest*&>(void (SigningTest::*&)(), SigningTest*&) (__fn=@0x6030001f0480: (void (SigningTest::*)(SigningTest * const)) 0x7fffb2bd0d80 <SigningTest::testODFGoodGPG()>, __args=@0x6030001f0490: 0x60c000035e00) at /usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/invoke.h:95 > #37 0x00007fffb2c2ff2f in std::_Bind<void (SigningTest::*(SigningTest*))()>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) (this=0x6030001f0480, __args=...) at /usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/functional:467 > #38 0x00007fffb2c2fb23 in std::_Bind<void (SigningTest::*(SigningTest*))()>::operator()<, void>() (this=0x6030001f0480) at /usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/functional:549 > #39 0x00007fffb2c2e8d1 in std::_Function_handler<void (), std::_Bind<void (SigningTest::*(SigningTest*))()> >::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/std_function.h:316 > #40 0x00007fffb2c30b1c in std::function<void ()>::operator()() const (this=0x608000083660) at /usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/std_function.h:706 > #41 0x00007fffb2c2db41 in CppUnit::TestCaller<SigningTest>::runTest() (this=0x608000083620) at workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:175 > #42 0x00007ffff78fc159 in CppUnit::TestCaseMethodFunctor::operator()() const (this=0x7ffff2e9c0d0) at TestCase.cpp:32 > #43 0x00007fffdc3cc8e3 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (this=0x602000019910, functor=...) at test/source/vclbootstrapprotector.cxx:48 > #44 0x00007ffff78ccf96 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const (this=0x6030002189e0) at ProtectorChain.cpp:20 > #45 0x00007fffe8938ab3 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (this=0x6020000003f0, functor=...) at unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89 > #46 0x00007ffff78ccf96 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const (this=0x603000218a10) at ProtectorChain.cpp:20 > #47 0x00007fffebc1e492 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (this=0x602000000250, functor=..., context=...) at unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63 > #48 0x00007ffff78ccf96 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const (this=0x603000218a40) at ProtectorChain.cpp:20 > #49 0x00007ffff7863084 in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (this=0x602000000150, functor=..., context=...) at DefaultProtector.cpp:15 > #50 0x00007ffff78ccf96 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const (this=0x603000218a70) at ProtectorChain.cpp:20 > #51 0x00007ffff78c68f5 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (this=0x60b000000510, functor=..., context=...) at ProtectorChain.cpp:86 > #52 0x00007ffff795e259 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x7ffff2f000a0, functor=..., test=0x608000083620, shortDescription="") at TestResult.cpp:182 > #53 0x00007ffff78fa785 in CppUnit::TestCase::run(CppUnit::TestResult*) (this=0x608000083620, result=0x7ffff2f000a0) at TestCase.cpp:91 > #54 0x00007ffff798c2fe in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) (this=0x608000081820, result=0x7ffff2f000a0) at TestRunner.cpp:47 > #55 0x00007ffff795ccdf in CppUnit::TestResult::runTest(CppUnit::Test*) (this=0x7ffff2f000a0, test=0x608000081820) at TestResult.cpp:149 > #56 0x00007ffff798d23f in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x7ffff2f4db00, controller=..., testPath="") at TestRunner.cpp:96 > #57 0x000000000052e3a9 in (anonymous namespace)::ProtectedFixtureFunctor::run() const (this=0x7ffff2f00350) at sal/cppunittester/cppunittester.cxx:319 > #58 0x000000000052ae38 in sal_main() () at sal/cppunittester/cppunittester.cxx:469 > #59 0x0000000000529e2c in main(int, char**) (argc=23, argv=0x7fffffff2798) at sal/cppunittester/cppunittester.cxx:376 Reviewed-on: https://gerrit.libreoffice.org/46249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit d15f042abd5a1093984a0c8380837145f38c4efc) Make --disable-runtime-optimizations not fail when LIBO_LD_PATH is unset ...outside of CppunitTest_xmlsecurity_signing (cherry picked from commit 1553cc326c5eb98b658e2202630ba0f0217c0ae4) Change-Id: I386a3b316c78344c2449568894c0f03ba39b1bf0 Reviewed-on: https://gerrit.libreoffice.org/50058 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-23tdf#114460 vcl: handle nested parentheses in PDF roundtripMiklos Vajna2-0/+2
The roundtrip of the pdf image failed due to this. (cherry picked from commit f58a16d5987c8e8c16580c514ce0c7b0895b4105) Change-Id: I88a9657e242dd2659f9bf06233e5fcbfeb43ceb5 Reviewed-on: https://gerrit.libreoffice.org/48378 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-16tdf#115011 don't crash on non-existent gpg supportThorsten Behrens1-3/+3
Change-Id: I90679472898648ccf0811c67c17f7bad41d4e347 Reviewed-on: https://gerrit.libreoffice.org/47984 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 03afd4b72431a0dc197891d41fb7bf2419858380) Reviewed-on: https://gerrit.libreoffice.org/47994 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Reviewed-by: Regina Henschel <rb.henschel@t-online.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-13tdf#114550: load back PGP encrypted filesThorsten Behrens5-0/+13
This squashes the following commits from master: gpg4libre: import PGP encryption manifest Change-Id: Iadd7f8f1194299cb50907d8594114c89c668ebd0 gpg4libre: open encrypted files also via gpg Change-Id: I1f626143e6c8443b4ad0c4fc5bdbd5ab8d56a451 tdf#114550 use 32 bit random session key for gpg encryption Change-Id: I7303be71fd855aa454d07fcae04d7f42e3c9cd9c tdf#114550 recognize sym key & init vec as valid f/ decrypt Change-Id: Ie366f086a3c14d6b54b91b4edee8cfef1a42c44b tdf#114550 don't use PBKDF2 in package for gpg encryption Change-Id: Ic96b2193f8541bbd109795fb9c0212a0a10c7344 gpg4libre: add initial unit test for encryption Change-Id: Id782dd865878ae7b8a60c7c80821b1370f6ac7e7 Change-Id: Id77b67a275bf91614ab62b65fdc69e4872247ffc Reviewed-on: https://gerrit.libreoffice.org/47784 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-12-19Do things with preferred GPG keysKatarina Behrens2-2/+29
For signing, preselect the key in the list of available keys. For encryption, when 'encrypt to self' bit is set, add user's key to the list of keys to encryption. Change-Id: I5bbfd0e2cc97b76c1304a2a345a51cf83bc5949e Reviewed-on: https://gerrit.libreoffice.org/46694 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit ee40674b4c9343db5e69cd5118bdbcf8e6edad6d) Reviewed-on: https://gerrit.libreoffice.org/46759 Tested-by: Jenkins <ci@libreoffice.org>
2017-12-14xmlsecurity: move GNUPGHOME to $workdir for unit testThorsten Behrens1-13/+14
Since some GnuPG versions tend to litter the source tree with random files otherwise. Change-Id: I0302f73b216f2de4dafcb6adca81097ec9d87e8c Reviewed-on: https://gerrit.libreoffice.org/46447 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 2816ac4ad01874203efdbf9961ca2c22cbd94a3c) Reviewed-on: https://gerrit.libreoffice.org/46468
2017-12-11gpg4libre: check if we can really verify OpenPGP signaturesThorsten Behrens1-13/+7
And disable unit tests otherwise Change-Id: I32e1d8d2f8b0013d9cb43b78a55d23a1a29a8e8d Reviewed-on: https://gerrit.libreoffice.org/46057 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 7886de305809e265cd2126d39912147131d3a004) Reviewed-on: https://gerrit.libreoffice.org/46191 Reviewed-by: Rene Engelhard <rene@debian.org>
2017-12-10gpg4libre: rename GPGME_HAVE_GPGME to HAVE_FEATURE_GPGMEThorsten Behrens5-13/+13
Change-Id: I6f085b67c3477f427bd1efd96db93cbb89e20647 Reviewed-on: https://gerrit.libreoffice.org/46050 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 1e71870034c9e180f856f51dc2c183d2a6ba9ccd) Reviewed-on: https://gerrit.libreoffice.org/46069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-08gpg4libre: multi-select encryption certs, hide desc entryThorsten Behrens3-2/+8
Change-Id: I50ea6e82f18f296ea24f6e0d0e0e2eb381a5e54b Reviewed-on: https://gerrit.libreoffice.org/46052 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 6283cd07d44d9aeacffbedb99d23e4ee760c6eb6) Reviewed-on: https://gerrit.libreoffice.org/46083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-12-07gpg4libre: handle unavailable gpg crypto tools more gracefullyThorsten Behrens1-1/+1
Change-Id: I58af9d38ea8d202d2bda64cdf45204646ac9fd29 (cherry picked from commit ed50a0a2ce51584fa3a8fba0094220a4bf25c650)
2017-12-07gpg4libre: return key fingerprint / hashes including null characterfeature/gpg4libre-6-0Thorsten Behrens1-3/+3
Change-Id: I6b32444bab6848e2b5ddec02fd949c71114a66b2
2017-12-07gpg4libre: permit multi-select encrypt certThorsten Behrens5-26/+50
And pass down all necessary parameters everywhere Change-Id: I152b9d84c0e35be9e5193a9a6f67de9fb86133b0
2017-12-07gpg4libre: find keymanager executable on WindowsThorsten Behrens1-2/+10
Change-Id: If93c06ad90d708b0fbaf476bda6fdb902bd77b1e
2017-12-07gpg4libre: add unit tests for ODF signing featureThorsten Behrens9-1/+92
Since this requires a working gpg setup, limit to linux for the moment. If you need to add signatures or redo them, run LibreOffice from a shell with env var GNUPGHOME=<core>/xmlsecurity/qa/unit/signing/data/ set. For editing keys, gpg2 also accepts a --homedir=<core>/xmlsecurity/qa/unit/signing/data/ option Change-Id: I59e5b563098b19d05c8c2db32537241bc835fc80 Reviewed-on: https://gerrit.libreoffice.org/45950 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 6da58b0e842b81669e5076c2c00dddf67a5616e1)
2017-12-07Restore GPG SEInitializer serviceKatarina Behrens4-2/+69
user config now needs it to collect user's private GPG keys Change-Id: Ia4ad4133b621160cf37281750cafa9f3c5c3c231 Reviewed-on: https://gerrit.libreoffice.org/45562 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 1c58b047d117bb087abc571b74c06cdf7499b1a0)
2017-12-05gpg4libre: add gpgme config header where gpgme.h is includedThorsten Behrens3-0/+6
Also pull in config_lgpl.h in that case. Squashed in is this fix, too: android: fix gpgme build No need to include config_lgpl.h when gpgme is disabled. Change-Id: Iae4e56ee8023066581c562c66305875a0fe15f37 Reviewed-on: https://gerrit.libreoffice.org/45809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 5daa364922ba75442e2aa834095e9bef16d141d9) Reviewed-on: https://gerrit.libreoffice.org/45836 Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-11-30move conditional stuff to RepositoryExternal.mkDavid Tardon1-5/+1
Change-Id: I33e299277c53e8e2b8ab7e4cdf52d2487f90b51b Reviewed-on: https://gerrit.libreoffice.org/45211 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com> (cherry picked from commit 7c77ff5dd2d0573a56f8b59dc9113c23e0ea29c9) Signed-off-by: David Tardon <dtardon@redhat.com>
2017-11-24fix build with system gpgmeppDavid Tardon1-2/+2
Change-Id: If0c81f5095b61d41b90db2e596bf5905b15ab506 Reviewed-on: https://gerrit.libreoffice.org/45210 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
2017-11-24EPUB export: implement character properties of links from named stylesMiklos Vajna1-1/+1
ODF allows text properties on hyperlinks directly, librevenge wants an inner span instead. Change-Id: I903045a688bf318e7ac7f8cac83bb4d537259969 Reviewed-on: https://gerrit.libreoffice.org/45161 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-23gpg4libre: conditional-compile gpgme codeThorsten Behrens4-7/+12
Change-Id: I1d139a7b6df271d61bedd107c6b3a0535d233606 Reviewed-on: https://gerrit.libreoffice.org/45124 Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-22fix buildThorsten Behrens1-2/+2
Change-Id: Ibb83ef0bb6a304f2e78a669502a1bdd1f6dcc4bd
2017-11-22gpg4libre: enable gpgme support for Windows and OSXThorsten Behrens1-2/+2
Change-Id: Ifa266e1c18a8a09cd5c815adc70d0236e00f72b5 Reviewed-on: https://gerrit.libreoffice.org/45092 Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-22gpg4libre: fix warningsThorsten Behrens4-4/+5
This code was not previously built on Windows Change-Id: I9394907f143d862f40c95672f4e3398b65b7bd2c Reviewed-on: https://gerrit.libreoffice.org/45091 Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-22xmlsecurity mscrypt: use SAL_N_ELEMENTS()Miklos Vajna1-1/+3
Change-Id: I39ddffc48c169ca5c95b4cc6b4799530c5d1984e Reviewed-on: https://gerrit.libreoffice.org/45069 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-07tdf#113550 RTF import: fix incorrect text indentMiklos Vajna1-3/+3
Left indent was set to non-zero in the style, but direct formatting set it back to zero. Teach deduplication to remove the NS_ooxml::LN_CT_PPrBase_ind SPRM itself in case the last attribute was removed. Change-Id: I01b202f0241b02816b2b392326737b1150caffc2 Reviewed-on: https://gerrit.libreoffice.org/44385 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-06tdf#65393 Test for signature line imagesSamuel Mehrbrodt2-0/+28
Change-Id: I6f37919da5fef0a90fad314019db19e4a5604169 Reviewed-on: https://gerrit.libreoffice.org/44220 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-11-06loplugin:constparams in various(2)Noel Grandin1-1/+1
Change-Id: I533a7eb724b15e168a28dc92cd5962a39bc96e7c Reviewed-on: https://gerrit.libreoffice.org/44313 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-03Missing initialization of m_bInSignatureLineIdSamuel Mehrbrodt1-0/+1
Change-Id: I563f7324129828d13c4549d330d58d6ab972472c Reviewed-on: https://gerrit.libreoffice.org/44268 Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de>
2017-11-03[API CHANGE] tdf#65393 Import signature line images from ooxmlSamuel Mehrbrodt5-2/+128
showing whether the signature behind the signature line is valid or not. Change-Id: Ia6cca62812019f26d55d234cac767a9b4b7c8175 Reviewed-on: https://gerrit.libreoffice.org/40980 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-11-03xmlsecurity: can hold UriBindingHelper by rtl::ReferenceMiklos Vajna6-16/+13
... in XMLSignatureHelper and XSecController Change-Id: Ie3817684c9ed9ed8a222e3ba56c8fbc389a68071 Reviewed-on: https://gerrit.libreoffice.org/44193 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-27loplugin:includeform: xmlsecurity (Windows)Stephan Bergmann10-20/+20
Change-Id: Ib996672d7acd7d0dbf446eb8a4f8812680795e35
2017-10-26vcl: make MapMode constructor explicitMichael Stahl3-3/+3
Insert constructor everywhere, except a couple places that apparently want to compare GetMapUnit(). Change-Id: I1910deb60562e5e949203435e827057f70a3f988
2017-10-25xmlsecurity: remove unused chainOn() argumentMiklos Vajna4-12/+8
Change-Id: Id4d4ae41eb6d667a96ce5d294dd5bf3fcf4cb686 Reviewed-on: https://gerrit.libreoffice.org/43801 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-23loplugin:includeform: xmlsecurityStephan Bergmann56-129/+129
Change-Id: I9c3eca51fec52a255fcf280fe4e5ecc2ebbee5f3
2017-10-19fix build with system gpgmeDavid Tardon1-2/+7
Change-Id: I00e6d6ce476adbd22bcfb4eb55d4db4194f4bc92
2017-10-18gpg4libre fix tdf#113190 don't show expired/invalid keysgpg4libre-review-5.4.99Thorsten Behrens1-1/+1
Change-Id: I30485bc97d3d287bd867b50398927eabe018914b Reviewed-on: https://gerrit.libreoffice.org/43502 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-10-18gpg4libre - tdf#113188 add option for minimal PGPKeyPacketThorsten Behrens1-1/+5
Change-Id: I660e68074616f6953e6527e40ec22276ce8ef2fb Reviewed-on: https://gerrit.libreoffice.org/43492 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-10-18xmlsecurity: remove unused m_xElementStackKeeperMiklos Vajna3-90/+1
Change-Id: Ibd7d39e288a4121428e83408ce67205eab3340c6 Reviewed-on: https://gerrit.libreoffice.org/43479 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-17turn implicit container explicit in buildable notebooksCaolán McNamara2-7/+46
as in interim measure for SfxTabDialogs we throw away the TabPage if its not suitable for reuse Change-Id: Ic5776ca3d2a8cb6bf41f33df01b211f81c62a842 Reviewed-on: https://gerrit.libreoffice.org/43134 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-16Make include files found through -Ixmlsecurity/incStephan Bergmann2-3/+3
...instead of implicitly next to the including file, in preparation of loplugin:includeform Change-Id: I81e3cd2dee707168064ff729f47e525b29bea43b
2017-10-13xmlsecurity: remove unused XSecController::m_xNextNodeOnSAXChainMiklos Vajna2-11/+3
Change-Id: Ic5fd625afe2ef53968b87d1382b257e3d44ce08b Reviewed-on: https://gerrit.libreoffice.org/43354 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-06xmlsecurity: last 2 params of setSAXChainConnector() is always nullptrMiklos Vajna3-17/+6
So remove them. Change-Id: Iec2430af6634608bdc8c4beff6078ccceb7a2391 Reviewed-on: https://gerrit.libreoffice.org/43182 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski4-9/+13
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-05TSCP: include certificate usage in paragraph signaturesAshod Nakashian4-6/+41
Change-Id: I6f4b891a016c67051efd9033329065d7e3c8a06b Reviewed-on: https://gerrit.libreoffice.org/43022 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-10-04add << operator for css::uno::ExceptionNoel Grandin5-8/+6
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-03loplugin:finalclasses in xmloffNoel Grandin1-1/+0
Change-Id: I10ffefd29b858548472a459314c7d5632324bca2 Reviewed-on: https://gerrit.libreoffice.org/43069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>