summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-04-29 11:58:51 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-05-14 16:29:07 +0200
commit50101f735af5fdecbe7534a845a7a6a8ddfe763e (patch)
treefe257ed68072ebab1fdcb9c1372558f8bc720600
parenta9854f30e1825240edc839e5f508f9d189fb31af (diff)
unotest: fix NSS initialization for CentOS7 system NSS
When given an unprefixed path, CentOS7 system NSS 3.67 apparently ignores the nice unit test database and creates a legacy "dbm:" one in the same directory, which is of course empty. This causes: xmlsecurity/qa/unit/signing/signing.cxx:570:aaa_testODFX509CertificateChain::TestBody equality assertion failed - Expected: 0 - Actual : 1 The intermediate/root CA certificates are read from the signature and added with CERT_NewTempCertificate(), which then does a lookup in the database to find the trust flags of the certificate: 0 nssTrust_GetCERTCertTrustForCert () at pki3hack.c:610 1 fill_CERTCertificateFields () at pki3hack.c:819 2 stan_GetCERTCertificate () at pki3hack.c:926 3 STAN_GetCERTCertificate () at pki3hack.c:973 4 add_cert_to_cache () at tdcache.c:721 5 nssTrustDomain_AddCertsToCache () at tdcache.c:849 6 cert_createObject () at pkibase.c:1023 7 nssPKIObjectCollection_GetObjects () at pkibase.c:853 8 nssPKIObjectCollection_GetCertificates () at pkibase.c:1077 9 nssTrustDomain_FindCertificateByIssuerAndSerialNumber () at trustdomain.c:796 10 nssTrustDomain_FindCertificateByEncodedCertificate () at trustdomain.c:839 11 NSSTrustDomain_FindCertificateByEncodedCertificate () at trustdomain.c:852 12 CERT_NewTempCertificate () at stanpcertdb.c:366 13 __CERT_NewTempCertificate () at stanpcertdb.c:474 14 SecurityEnvironment_NssImpl::verifyCertificate() () at xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx:524 Change-Id: If334d056a9e13ad806e3ea1a03d395d606fd3d84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133622 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 55b9b3c9d4a71de1f4e4c79bfce2766d3ef73e28) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134292 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--unotest/source/cpp/macros_test.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx
index 718c0b1b8954..4c48574e759a 100644
--- a/unotest/source/cpp/macros_test.cxx
+++ b/unotest/source/cpp/macros_test.cxx
@@ -129,7 +129,8 @@ void MacrosTest::setUpNssGpg(const test::Directories& rDirectories, const OUStri
osl_setEnvironment(caVar.pData, aTargetPath.pData);
#else
OUString mozCertVar("MOZILLA_CERTIFICATE_FOLDER");
- osl_setEnvironment(mozCertVar.pData, aTargetPath.pData);
+ // explicit prefix with "sql:" needed for CentOS7 system NSS 3.67
+ osl_setEnvironment(mozCertVar.pData, OUString("sql:" + aTargetPath).pData);
#endif
OUString gpgHomeVar("GNUPGHOME");
osl_setEnvironment(gpgHomeVar.pData, aTargetPath.pData);