Mercurial > trustbridge
changeset 830:344d15e23f6c
Add nss shared db data and use it.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 24 Jul 2014 12:09:28 +0200 |
parents | 294d76174102 |
children | 747a48996c1f |
files | ui/tests/data/nss/pki-nssdb/cert9.db ui/tests/data/nss/pki-nssdb/key4.db ui/tests/data/nss/pki-nssdb/pkcs11.txt ui/tests/data/testdata.qrc ui/tests/nsstest.cpp |
diffstat | 5 files changed, 20 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/tests/data/nss/pki-nssdb/pkcs11.txt Thu Jul 24 12:09:28 2014 +0200 @@ -0,0 +1,5 @@ +library= +name=NSS Internal PKCS #11 Module +parameters=configdir='sql:TOREPLACE' certPrefix='' keyPrefix='' secmod='secmod.db' flags=optimizeSpace updatedir='' updateCertPrefix='' updateKeyPrefix='' updateid='' updateTokenDescription='' +NSS=Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512] askpw=any timeout=30}) +
--- a/ui/tests/data/testdata.qrc Thu Jul 24 11:41:52 2014 +0200 +++ b/ui/tests/data/testdata.qrc Thu Jul 24 12:09:28 2014 +0200 @@ -7,6 +7,9 @@ <file>nss/cert8.db</file> <file>nss/key3.db</file> <file>nss/secmod.db</file> + <file>nss/pki-nssdb/cert9.db</file> + <file>nss/pki-nssdb/key4.db</file> + <file>nss/pki-nssdb/pkcs11.txt</file> <file>import_test.pem</file> <file>valid_ssl_rsa.pem</file> <file>valid_ssl_bp.pem</file>
--- a/ui/tests/nsstest.cpp Thu Jul 24 11:41:52 2014 +0200 +++ b/ui/tests/nsstest.cpp Thu Jul 24 12:09:28 2014 +0200 @@ -95,14 +95,20 @@ /* Copy the current systems NSSSHARED db in the fake home for benchmark tests */ QDir fakeNSSSharedDir = fakeHome.path() + "/.pki/nssdb"; QVERIFY(fakeNSSSharedDir.mkpath(fakeNSSSharedDir.path())); - qDebug() << "Copying: " << QDir::homePath() + "/.pki/nssdb/cert9.db" << - " to " << fakeNSSSharedDir.path() + "cert9.db"; - QVERIFY(QFile::copy(QDir::homePath() + "/.pki/nssdb/cert9.db", + QVERIFY(QFile::copy(":/nss/pki-nssdb/cert9.db", fakeNSSSharedDir.path() + "cert9.db")); - QVERIFY(QFile::copy(QDir::homePath() + "/.pki/nssdb/key4.db", + QVERIFY(QFile::copy(":/nss/pki-nssdb/key4.db", fakeNSSSharedDir.path() + "key4.db")); - QVERIFY(QFile::copy(QDir::homePath() + "/.pki/nssdb/pkcs11.txt", - fakeNSSSharedDir.path() + "pkcs11.txt")); + QFile pkcs11(":/nss/pki-nssdb/pkcs11.txt"); + pkcs11.open(QIODevice::ReadOnly); + + QString pkcs11content = pkcs11.readAll(); + pkcs11.close(); + pkcs11content.replace("TOREPLACE", fakeNSSSharedDir.path()); + QFile p11outfile (fakeNSSSharedDir.path() + "pkcs11.txt"); + p11outfile.open(QIODevice::WriteOnly); + p11outfile.write(pkcs11content.toUtf8()); + p11outfile.close(); QVERIFY(!setenv ("HOME", fakeHome.path().toLocal8Bit().constData(), 1)); #else