summaryrefslogtreecommitdiff
path: root/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
AgeCommit message (Collapse)Author
2018-04-03gpg4libre: fix failing gpg test due to over-long filenamesRene Engelhard
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> (cherry picked from commit 74d438f716d9cef165c78f950d4c53a46c37503c)
2018-02-21gpgmepp,xmlsecurity: fix testODFEncryptedGPG() failure caused...Michael Stahl
...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 Bergmann
...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>
2017-04-21gbuild: Remove MSVC 2013 legacy codeDavid Ostrovsky
Uwinapi is discontinued. Change-Id: I063b4d0d8fab2d60de168e960a63b8181158ac01 Reviewed-on: https://gerrit.libreoffice.org/23198 Reviewed-by: David Ostrovsky <david@ostrovsky.org> Tested-by: David Ostrovsky <david@ostrovsky.org>
2016-11-25CppunitTest_xmlsecurity_signing: add XAdES testcaseMiklos Vajna
Assert the two user-visible changes: SHA-256 hashes and the digest of the signing certificate. Change-Id: I0f931ef06f9bfc4be4eaa02a7530d57a414430c1 Reviewed-on: https://gerrit.libreoffice.org/31172 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-10-14Missing dependencyStephan Bergmann
Change-Id: Ic8a97ec13613758f24996aa8a3ef8c0380cc2fae
2016-02-04CppunitTest_xmlsecurity_signing: add valid OOXML testcaseMiklos Vajna
In reality we can't detect that it's partially signed, as the unit test doesn't have a mozilla profile -> certificate validation fails -> we only know that the signature is valid. Change-Id: Ib6aaccb4cb471e543d368d0318b90c67e9876619
2016-01-12CppunitTest_xmlsecurity_signing: fix and enable on WindowsMiklos Vajna
Change-Id: Ie107afbb6b2499f445670b50bf214cb91d6b1cac
2016-01-11xmlsecurity: missing boost dependencyMiklos Vajna
Change-Id: Ida3a34fb74e4f956f865c8a52bdcf63811e290cc
2016-01-11xmlsecurity: initial CppunitTest_xmlsecurity_signingMiklos Vajna
Fails with either commit 88cbfe58c4a36c20bdb2445f43043f0a5a006ee3's last hunk to xsecctl.cxx (export) or commit a968893e6afd3b79c6c048962373859cea75a77b's last hunk to xsecparser.cxx (import) reverted. Change-Id: I0f303c8489f451ebf175ed836d3679b6a13aca42