[Libreoffice-commits] core.git: xmlsecurity/qa
Thorsten Behrens
Thorsten.Behrens at CIB.de
Thu Dec 14 15:54:23 UTC 2017
xmlsecurity/qa/unit/signing/signing.cxx | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
New commits:
commit 2816ac4ad01874203efdbf9961ca2c22cbd94a3c
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date: Thu Dec 14 13:50:14 2017 +0100
xmlsecurity: move GNUPGHOME to $workdir for unit test
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 at redhat.com>
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index 7e737f8f3bd4..18dd99644f35 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -163,26 +163,27 @@ void SigningTest::setUp()
mxSEInitializer = xml::crypto::SEInitializer::create(mxComponentContext);
mxSecurityContext = mxSEInitializer->createSecurityContext(OUString());
-#ifndef _WIN32
- // Set up cert8.db in workdir/CppunitTest/
OUString aSourceDir = m_directories.getURLFromSrc(DATA_DIRECTORY);
OUString aTargetDir = m_directories.getURLFromWorkdir(
"/CppunitTest/xmlsecurity_signing.test.user/");
+
+ // Set up cert8.db in workdir/CppunitTest/
osl::File::copy(aSourceDir + "cert8.db", aTargetDir + "cert8.db");
osl::File::copy(aSourceDir + "key3.db", aTargetDir + "key3.db");
+
+ // Make gpg use our own defined setup & keys
+ osl::File::copy(aSourceDir + "pubring.gpg", aTargetDir + "pubring.gpg");
+ osl::File::copy(aSourceDir + "random_seed", aTargetDir + "random_seed");
+ osl::File::copy(aSourceDir + "secring.gpg", aTargetDir + "secring.gpg");
+ osl::File::copy(aSourceDir + "trustdb.gpg", aTargetDir + "trustdb.gpg");
+
OUString aTargetPath;
osl::FileBase::getSystemPathFromFileURL(aTargetDir, aTargetPath);
- setenv("MOZILLA_CERTIFICATE_FOLDER", aTargetPath.toUtf8().getStr(), 1);
-#endif
-#if HAVE_FEATURE_GPGVERIFY
- // Make gpg use our own defined setup below data dir
- OUString aHomePath;
- osl::FileBase::getSystemPathFromFileURL(
- m_directories.getURLFromSrc(DATA_DIRECTORY),
- aHomePath);
- OUString envVar("GNUPGHOME");
- osl_setEnvironment(envVar.pData, aHomePath.pData);
-#endif
+
+ OUString mozCertVar("MOZILLA_CERTIFICATE_FOLDER");
+ osl_setEnvironment(mozCertVar.pData, aTargetPath.pData);
+ OUString gpgHomeVar("GNUPGHOME");
+ osl_setEnvironment(gpgHomeVar.pData, aTargetPath.pData);
}
void SigningTest::tearDown()
More information about the Libreoffice-commits
mailing list