2017-10-19 02:04:33 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Configuration for gpgme++.
|
|
|
|
*/
|
|
|
|
|
2017-12-04 09:17:18 -06:00
|
|
|
#ifndef CONFIG_GPGME_H
|
|
|
|
#define CONFIG_GPGME_H
|
|
|
|
|
2017-11-22 12:06:26 -06:00
|
|
|
// Defined if gpgme support is available
|
2017-12-07 15:40:47 -06:00
|
|
|
#define HAVE_FEATURE_GPGME 0
|
|
|
|
|
2017-12-07 17:10:42 -06:00
|
|
|
// Defined if gpg and gpgme signature verification is available
|
|
|
|
#define HAVE_FEATURE_GPGVERIFY 0
|
|
|
|
|
2018-03-18 05:25:41 -05:00
|
|
|
// Defined if gpgconf --create-socketdir works
|
|
|
|
#define HAVE_GPGCONF_SOCKETDIR 0
|
|
|
|
|
2017-12-07 15:40:47 -06:00
|
|
|
#if HAVE_FEATURE_GPGME
|
|
|
|
# include "config_lgpl.h"
|
2017-12-05 02:24:38 -06:00
|
|
|
#endif
|
2017-11-22 12:06:26 -06:00
|
|
|
|
2017-10-19 02:04:33 -05:00
|
|
|
// Defined if gpgme supports exporting minimal key.
|
|
|
|
#define GPGME_CAN_EXPORT_MINIMAL_KEY 0
|
|
|
|
|
Fix creation/removal of GPG socketdir
<https://gerrit.libreoffice.org/#/c/50978/> "gpg4libre: fix failing gpg test due
to over-long filenames" had introduced the gb_CppunitTest_run_gpgconf target in
xmlsecurity/CppunitTest_xmlsecurity_signing.mk, calling `gpgconf
--craete-socketdir`. A 2018-03-18 comment there notes that "Stephan's last
comment: (and `gpgconf --remove-sockedir` be called after the test?) is not
addressed yet, will do in follow-up commit".
Follow-up d7ecf4a4e37a9eeffa2b40f9fe5a2e6a8f90c876 "properly check for gpgconf
(and --create-socketdir) working" makes gb_CppunitTest_run_gpgconf conditional.
However, in configure.ac,
HAVE_GPGCONF_SOCKETDIR=TRUE
is missing, so even after follow-up 7a95ee8d0badb2cbbd137a6e18af1bada35ae933
"actually add HAVE_GPGCONF_SOCKETDIR to config_host.mk.in...", config_host.mk
will always contain
export HAVE_GPGCONF_SOCKETDIR=
so gb_CppunitTest_run_gpgconf will never be executed (and `pgconf
--crate-socketdir` will never called).
But even if it were executed, it would not create the socket dir that the test
code in xmlsecurity/qa/unit/signing/signing.cxx is actually using, as
gb_CppunitTest_run_gpgconf sets
GNUPGHOME=.../workdir/CppunitTest/xmlsecurity_signing.test.user
while xmlsecurity/qa/unit/signing/signing.cxx's SigningTest::setUp sets
GNUPGHOME=.../workdir//CppunitTest/xmlsecurity_signing.test.user/
and the GPG software is apparently picky about extra slashes when computing the
socket dir name from the GNUPGHOME env var.
(That `gpgconf --create-socketdir` was never executed with the current setup
shows that calling it explicitly is probably not really needed, as the GPG
software apparently creates it automatically on demand.)
However, what is still missing is to remove the socket dir again (see the
comment quoted above), and, probably more importantly, to exit any gpg-agent
daemon operating on that socket dir that has (indirectly) been started by the
tests in xmlsecurity/qa/unit/signing/signing.cxx. At least with Fedora 29
gpgconf from gnupg2-2.2.9-1.fc29.x86_64, that daemon is successfully terminated
by calling `gpgconf --remove-socket`.
So move the call to `gpgconf --create-socketdir` from the makefile to the test
setup code (which makes it easier to guarantee that a single GNUPGHOME value,
and thus a single socket dir, is used), and add a corresponding `gpgconf
--remove-socketdir` call to the test shutdown code. (As argued above, the
`gpgconf --create-socketdir` call shouldn't be stricktly necessary, but it looks
cleaner to do it explicitly anyway.)
Change-Id: I2ec8f08943ed63ec27f8507461588ee7cdadf372
Reviewed-on: https://gerrit.libreoffice.org/63181
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-09 05:11:46 -06:00
|
|
|
#undef GPGME_GPGCONF
|
|
|
|
|
2017-12-04 09:17:18 -06:00
|
|
|
#endif
|
|
|
|
|
2017-10-19 02:04:33 -05:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|