summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-10-14 13:44:14 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-04-01 14:02:30 +0200
commitd2131df258d63c090500fc72e1a7886ec5c96f1d (patch)
tree1b300487ab4ffa2243383b3ae1592dba82e3ab93
parentxmlsecurity: fix new tests on WNT (diff)
downloadcore-d2131df258d63c090500fc72e1a7886ec5c96f1d.tar.gz
core-d2131df258d63c090500fc72e1a7886ec5c96f1d.zip
test: upgrade test NSS database from dbm: to sql:
Fedora nss-3.69.0-1.fc34.x86_64 and Debian libnss3:amd64 2:3.70-1 no longer support the old BerekelyDB databases, so convert them to the new SQLite format for the benefit of --with-system-nss builds. This worked to do the upgrade: > certutil -N -d sql:test/new --empty-password > LD_LIBRARY_PATH=instdir/program workdir/UnpackedTarball/nss/dist/out/bin/certutil --merge -d sql:test/new --source-dir dbm:test/signing-keys Builds would fail running tests added in commit 40d70d427edddb589eda64fafc2e56536953d274 signing.cxx:551:Assertion Test name: testODFX509CertificateChain::TestBody equality assertion failed - Expected: 0 - Actual : 1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123586 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 907784ccce7bd8b5121888cff7f5723a55d35358) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123643 Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 7b4b03b9cf21ecd11bc82da5f29c4ff91ad242c9) Change-Id: I00aa20703e117ebf583c3331b84e966c2cfc78cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123837 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 755155498b13c8724831276808c930adba891f5c)
-rw-r--r--xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx7
-rw-r--r--xmlsecurity/qa/unit/signing/data/cert9.db (renamed from xmlsecurity/qa/unit/signing/data/cert8.db)bin65536 -> 53248 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/data/key3.dbbin16384 -> 0 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/data/key4.dbbin0 -> 49152 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/data/pkcs11.txt5
-rw-r--r--xmlsecurity/qa/unit/signing/signing.cxx7
6 files changed, 13 insertions, 6 deletions
diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index 1d45d5bef16b..2894b4a2fa2d 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -79,9 +79,10 @@ void PDFSigningTest::setUp()
OUString caVar("LIBO_TEST_CRYPTOAPI_PKCS7");
osl_setEnvironment(caVar.pData, aTargetPath.pData);
#else
- // Set up cert8.db and key3.db in workdir/CppunitTest/
- osl::File::copy(aSourceDir + "cert8.db", aTargetDir + "cert8.db");
- osl::File::copy(aSourceDir + "key3.db", aTargetDir + "key3.db");
+ // Set up NSS database in workdir/CppunitTest/
+ osl::File::copy(aSourceDir + "cert9.db", aTargetDir + "/cert9.db");
+ osl::File::copy(aSourceDir + "key4.db", aTargetDir + "/key4.db");
+ osl::File::copy(aSourceDir + "pkcs11.txt", aTargetDir + "/pkcs11.txt");
setenv("MOZILLA_CERTIFICATE_FOLDER", aTargetPath.toUtf8().getStr(), 1);
#endif
}
diff --git a/xmlsecurity/qa/unit/signing/data/cert8.db b/xmlsecurity/qa/unit/signing/data/cert9.db
index 95e58ffe5b92..c4064e419f42 100644
--- a/xmlsecurity/qa/unit/signing/data/cert8.db
+++ b/xmlsecurity/qa/unit/signing/data/cert9.db
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/data/key3.db b/xmlsecurity/qa/unit/signing/data/key3.db
deleted file mode 100644
index f449e60a667f..000000000000
--- a/xmlsecurity/qa/unit/signing/data/key3.db
+++ /dev/null
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/data/key4.db b/xmlsecurity/qa/unit/signing/data/key4.db
new file mode 100644
index 000000000000..34a7fa28aa32
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/key4.db
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/data/pkcs11.txt b/xmlsecurity/qa/unit/signing/data/pkcs11.txt
new file mode 100644
index 000000000000..22c8f8519efd
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/pkcs11.txt
@@ -0,0 +1,5 @@
+library=
+name=NSS Internal PKCS #11 Module
+parameters=configdir='sql:test/new' certPrefix='' keyPrefix='' secmod='secmod.db' flags= updatedir='' updateCertPrefix='' updateKeyPrefix='' updateid='' updateTokenDescription=''
+NSS=Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={slotFlags=[ECC,RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512] askpw=any timeout=30})
+
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index e1853d4ad235..fb1cdb86eee0 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -101,9 +101,10 @@ void SigningTest::setUp()
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");
+ // Set up NSS database in workdir/CppunitTest/
+ osl::File::copy(aSourceDir + "cert9.db", aTargetDir + "/cert9.db");
+ osl::File::copy(aSourceDir + "key4.db", aTargetDir + "/key4.db");
+ osl::File::copy(aSourceDir + "pkcs11.txt", aTargetDir + "/pkcs11.txt");
// Make gpg use our own defined setup & keys
osl::File::copy(aSourceDir + "pubring.gpg", aTargetDir + "/pubring.gpg");