diff options
author | alexei.volkov.bugs%sun.com <devnull@localhost> | 2007-09-20 19:04:01 +0000 |
---|---|---|
committer | alexei.volkov.bugs%sun.com <devnull@localhost> | 2007-09-20 19:04:01 +0000 |
commit | f8113879aae4b1b3a9e3c47a23e78e5c407da79f (patch) | |
tree | 9ad14ef7659cfeec3fda78f5de6b0adb83fba039 | |
parent | b581e0f609257b2e8ad282dfff37a18e7bd0c3fe (diff) | |
download | nss-hg-f8113879aae4b1b3a9e3c47a23e78e5c407da79f.tar.gz |
395265 - eliminate libPKIX initialization from all the individual PKIX unit test source files. r=nelson
69 files changed, 263 insertions, 748 deletions
diff --git a/security/nss/cmd/libpkix/perf/libpkix_buildthreads.c b/security/nss/cmd/libpkix/perf/libpkix_buildthreads.c index 8240ee842..bd95c3f97 100644 --- a/security/nss/cmd/libpkix/perf/libpkix_buildthreads.c +++ b/security/nss/cmd/libpkix/perf/libpkix_buildthreads.c @@ -312,8 +312,8 @@ static void finish(char* message, int code) static void usage(char* progname) { - (void) printf("Usage : %s <duration> <threads> <anchorNickname> " - "<eecertNickname>\n\n", progname); + (void) printf("Usage : %s <-d certStoreDirectory> <duration> <threads> " + "<anchorNickname> <eecertNickname>\n\n", progname); finish("", 0); } @@ -343,15 +343,8 @@ libpkix_buildthreads(int argc, char** argv) threads = atoi(argv[2]); } - PKIX_Initialize_SetConfigDir(PKIX_STORE_TYPE_PK11, ".", plContext); - - PKIX_Initialize(PKIX_TRUE, /* nssInitNeeded */ - PKIX_FALSE, /* useArenas */ - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext); + PKIX_PL_NssContext_Create(certificateUsageEmailSigner, PKIX_FALSE, + NULL, &plContext); handle = CERT_GetDefaultCertDB(); PR_ASSERT(handle); diff --git a/security/nss/cmd/libpkix/perf/nss_threads.c b/security/nss/cmd/libpkix/perf/nss_threads.c index 202e1805f..1f0ed1d80 100644 --- a/security/nss/cmd/libpkix/perf/nss_threads.c +++ b/security/nss/cmd/libpkix/perf/nss_threads.c @@ -182,12 +182,7 @@ int nss_threads(int argc, char** argv) { threads = atoi(argv[2]); } - rv = NSS_Initialize(".", "", "", - "secmod.db", NSS_INIT_READONLY); - if (SECSuccess != rv) - { - finish("Unable to initialize NSS.\n", 1); - } + handle = CERT_GetDefaultCertDB(); PR_ASSERT(handle); cert = CERT_FindCertByNicknameOrEmailAddr(handle, argv[3]); diff --git a/security/nss/cmd/libpkix/pkix/certsel/test_certselector.c b/security/nss/cmd/libpkix/pkix/certsel/test_certselector.c index 5117703f2..57068b76e 100644 --- a/security/nss/cmd/libpkix/pkix/certsel/test_certselector.c +++ b/security/nss/cmd/libpkix/pkix/certsel/test_certselector.c @@ -1827,22 +1827,13 @@ int test_certselector(int argc, char *argv[]) { PKIX_ComCertSelParams *selParams = NULL; char *certDir = NULL; char *dirName = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("CertSelector"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 3) { printUsage(); diff --git a/security/nss/cmd/libpkix/pkix/certsel/test_comcertselparams.c b/security/nss/cmd/libpkix/pkix/certsel/test_comcertselparams.c index f56e01744..0ebbdd462 100644 --- a/security/nss/cmd/libpkix/pkix/certsel/test_comcertselparams.c +++ b/security/nss/cmd/libpkix/pkix/certsel/test_comcertselparams.c @@ -750,7 +750,6 @@ int test_comcertselparams(int argc, char *argv[]) { PKIX_PL_String *stringRep = NULL; char *asciiRep = NULL; char *dirName = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); @@ -761,16 +760,8 @@ int test_comcertselparams(int argc, char *argv[]) { startTests("ComCertSelParams"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); dirName = argv[j+1]; diff --git a/security/nss/cmd/libpkix/pkix/checker/test_certchainchecker.c b/security/nss/cmd/libpkix/pkix/checker/test_certchainchecker.c index c1f1fde6d..7ddd2c74e 100755 --- a/security/nss/cmd/libpkix/pkix/checker/test_certchainchecker.c +++ b/security/nss/cmd/libpkix/pkix/checker/test_certchainchecker.c @@ -167,22 +167,13 @@ int test_certchainchecker(int argc, char *argv[]) { PKIX_List *supportedExtensions = NULL; PKIX_PL_Object *initialState = NULL; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("CertChainChecker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_Create (&supportedExtensions, plContext)); diff --git a/security/nss/cmd/libpkix/pkix/crlsel/test_comcrlselparams.c b/security/nss/cmd/libpkix/pkix/crlsel/test_comcrlselparams.c index 066a45f39..64a61e966 100644 --- a/security/nss/cmd/libpkix/pkix/crlsel/test_comcrlselparams.c +++ b/security/nss/cmd/libpkix/pkix/crlsel/test_comcrlselparams.c @@ -416,22 +416,13 @@ int test_comcrlselparams(int argc, char *argv[]){ PKIX_ComCRLSelParams *diffObject = NULL; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("ComCRLSelParams"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 2){ printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix/crlsel/test_crlselector.c b/security/nss/cmd/libpkix/pkix/crlsel/test_crlselector.c index d910fcc4e..f5d6c4f3b 100644 --- a/security/nss/cmd/libpkix/pkix/crlsel/test_crlselector.c +++ b/security/nss/cmd/libpkix/pkix/crlsel/test_crlselector.c @@ -151,23 +151,14 @@ int test_crlselector(int argc, char *argv[]){ PKIX_CRLSelector *diffObject = NULL; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *asciiDate = "040329134847Z"; PKIX_TEST_STD_VARS(); startTests("CRLSelector"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); context = createDate(asciiDate, plContext); diff --git a/security/nss/cmd/libpkix/pkix/params/test_buildparams.c b/security/nss/cmd/libpkix/pkix/params/test_buildparams.c index 326a99244..b3d165443 100644 --- a/security/nss/cmd/libpkix/pkix/params/test_buildparams.c +++ b/security/nss/cmd/libpkix/pkix/params/test_buildparams.c @@ -106,7 +106,6 @@ int test_buildparams(int argc, char *argv[]) { PKIX_BuildParams *diffObject = NULL; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *dataCentralDir = NULL; char *goodInput = "yassir2yassir"; @@ -150,16 +149,8 @@ int test_buildparams(int argc, char *argv[]) { startTests("BuildParams"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 2){ printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix/params/test_procparams.c b/security/nss/cmd/libpkix/pkix/params/test_procparams.c index 7ed34cf76..1598de199 100644 --- a/security/nss/cmd/libpkix/pkix/params/test_procparams.c +++ b/security/nss/cmd/libpkix/pkix/params/test_procparams.c @@ -433,7 +433,6 @@ int test_procparams(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; char *dataCentralDir = NULL; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *oidAnyPolicy = PKIX_CERTIFICATEPOLICIES_ANYPOLICY_OID; char *oidNist1Policy = "2.16.840.1.101.3.2.1.48.2"; @@ -476,16 +475,8 @@ int test_procparams(int argc, char *argv[]) { startTests("ProcessingParams"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 2){ printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix/params/test_resourcelimits.c b/security/nss/cmd/libpkix/pkix/params/test_resourcelimits.c index a9d0c62c4..9299d4239 100644 --- a/security/nss/cmd/libpkix/pkix/params/test_resourcelimits.c +++ b/security/nss/cmd/libpkix/pkix/params/test_resourcelimits.c @@ -73,7 +73,6 @@ int test_resourcelimits(int argc, char *argv[]) { PKIX_UInt32 maxDepth = 0; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *expectedAscii = "[\n" "\tMaxTime: 10\n" @@ -85,16 +84,8 @@ int test_resourcelimits(int argc, char *argv[]) { startTests("ResourceLimits"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_ResourceLimits_Create"); PKIX_TEST_EXPECT_NO_ERROR(PKIX_ResourceLimits_Create diff --git a/security/nss/cmd/libpkix/pkix/params/test_trustanchor.c b/security/nss/cmd/libpkix/pkix/params/test_trustanchor.c index 1ac4b76f6..6d4909304 100644 --- a/security/nss/cmd/libpkix/pkix/params/test_trustanchor.c +++ b/security/nss/cmd/libpkix/pkix/params/test_trustanchor.c @@ -227,7 +227,6 @@ int test_trustanchor(int argc, char *argv[]) { PKIX_TrustAnchor *diffObject = NULL; PKIX_PL_Cert *diffCert = NULL; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; char *goodInput = "yassir2yassir"; @@ -245,16 +244,8 @@ int test_trustanchor(int argc, char *argv[]) { startTests("TrustAnchor"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 3) { printUsage(); diff --git a/security/nss/cmd/libpkix/pkix/params/test_valparams.c b/security/nss/cmd/libpkix/pkix/params/test_valparams.c index 27317cbc9..999fd95bc 100644 --- a/security/nss/cmd/libpkix/pkix/params/test_valparams.c +++ b/security/nss/cmd/libpkix/pkix/params/test_valparams.c @@ -140,7 +140,6 @@ int test_valparams(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; char *dirName = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; char *goodInput = "yassir2yassir"; char *diffInput = "yassir2bcn"; @@ -226,16 +225,8 @@ int test_valparams(int argc, char *argv[]) { startTests("ValidateParams"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 2){ printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix/results/test_buildresult.c b/security/nss/cmd/libpkix/pkix/results/test_buildresult.c index e557b10c4..89bd9c531 100644 --- a/security/nss/cmd/libpkix/pkix/results/test_buildresult.c +++ b/security/nss/cmd/libpkix/pkix/results/test_buildresult.c @@ -138,7 +138,6 @@ int test_buildresult(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; char *dirName = NULL; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *goodInput = "yassir2yassir"; char *diffInput = "yassir2bcn"; @@ -208,16 +207,8 @@ int test_buildresult(int argc, char *argv[]) { startTests("BuildResult"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 2){ printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix/results/test_policynode.c b/security/nss/cmd/libpkix/pkix/results/test_policynode.c index 00b00ee45..8229a337f 100644 --- a/security/nss/cmd/libpkix/pkix/results/test_policynode.c +++ b/security/nss/cmd/libpkix/pkix/results/test_policynode.c @@ -500,7 +500,6 @@ int test_policynode(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *dirName = NULL; PKIX_TEST_STD_VARS(); @@ -512,16 +511,8 @@ int test_policynode(int argc, char *argv[]) { startTests("PolicyNode"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); dirName = argv[j+1]; diff --git a/security/nss/cmd/libpkix/pkix/results/test_valresult.c b/security/nss/cmd/libpkix/pkix/results/test_valresult.c index 3097b14f2..6633c5529 100644 --- a/security/nss/cmd/libpkix/pkix/results/test_valresult.c +++ b/security/nss/cmd/libpkix/pkix/results/test_valresult.c @@ -172,7 +172,6 @@ int test_valresult(int argc, char *argv[]) { PKIX_ValidateResult *diffObject = NULL; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *goodInput = "yassir2yassir"; char *diffInput = "yassir2bcn"; @@ -196,16 +195,8 @@ int test_valresult(int argc, char *argv[]) { startTests("ValidateResult"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 2){ printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix/results/test_verifynode.c b/security/nss/cmd/libpkix/pkix/results/test_verifynode.c index 7019b5f18..849c1d13d 100644 --- a/security/nss/cmd/libpkix/pkix/results/test_verifynode.c +++ b/security/nss/cmd/libpkix/pkix/results/test_verifynode.c @@ -66,7 +66,6 @@ int test_verifynode(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *dirName = NULL; char *twoNodeAscii = "CERT[Issuer:CN=Trust Anchor,O=Test Cert" "ificates,C=US, Subject:CN=Trust Anchor,O=Test Certif" @@ -91,16 +90,8 @@ int test_verifynode(int argc, char *argv[]) { startTests("VerifyNode"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); dirName = argv[++j]; diff --git a/security/nss/cmd/libpkix/pkix/store/test_store.c b/security/nss/cmd/libpkix/pkix/store/test_store.c index c8f411e5c..d54b7f9a2 100755 --- a/security/nss/cmd/libpkix/pkix/store/test_store.c +++ b/security/nss/cmd/libpkix/pkix/store/test_store.c @@ -194,21 +194,12 @@ int test_store(int argc, char *argv[]) { char *dataDir = NULL; char *combinedDir = NULL; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; PKIX_TEST_STD_VARS(); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < (3 + j)) { printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix/top/test_basicchecker.c b/security/nss/cmd/libpkix/pkix/top/test_basicchecker.c index 73aa7b047..f66fdf390 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_basicchecker.c +++ b/security/nss/cmd/libpkix/pkix/top/test_basicchecker.c @@ -232,23 +232,14 @@ int test_basicchecker(int argc, char *argv[]) { char *dateAscii = "991201000000Z"; char *dirName = NULL; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 actualMinorVersion; PKIX_TEST_STD_VARS(); startTests("SignatureChecker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 2){ printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix/top/test_basicconstraintschecker.c b/security/nss/cmd/libpkix/pkix/top/test_basicconstraintschecker.c index 98a19b6bb..fcaf2d966 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_basicconstraintschecker.c +++ b/security/nss/cmd/libpkix/pkix/top/test_basicconstraintschecker.c @@ -73,7 +73,6 @@ int test_basicconstraintschecker(int argc, char *argv[]){ PKIX_UInt32 chainLength = 0; PKIX_UInt32 i = 0; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_Boolean testValid = PKIX_FALSE; char *dirName = NULL; @@ -86,16 +85,8 @@ int test_basicconstraintschecker(int argc, char *argv[]){ startTests("BasicConstraintsChecker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ENE = expect no error; EE = expect error */ if (PORT_Strcmp(argv[2+j], "ENE") == 0) { diff --git a/security/nss/cmd/libpkix/pkix/top/test_buildchain.c b/security/nss/cmd/libpkix/pkix/top/test_buildchain.c index a7fae3dea..1f22e4f6a 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_buildchain.c +++ b/security/nss/cmd/libpkix/pkix/top/test_buildchain.c @@ -151,7 +151,6 @@ int test_buildchain(int argc, char *argv[]) PKIX_List *revCheckers = NULL; char * asciiResult = NULL; PKIX_Boolean result = PKIX_FALSE; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_Boolean testValid = PKIX_TRUE; PKIX_List *expectedCerts = NULL; PKIX_PL_Cert *dirCert = NULL; @@ -173,16 +172,8 @@ int test_buildchain(int argc, char *argv[]) startTests("BuildChain"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* * arguments: diff --git a/security/nss/cmd/libpkix/pkix/top/test_buildchain_partialchain.c b/security/nss/cmd/libpkix/pkix/top/test_buildchain_partialchain.c index b5a6cb308..2cc26e08b 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_buildchain_partialchain.c +++ b/security/nss/cmd/libpkix/pkix/top/test_buildchain_partialchain.c @@ -700,7 +700,6 @@ int test_buildchain_partialchain(int argc, char *argv[]) PKIX_UInt32 actualMinorVersion = 0; PKIX_UInt32 j = 0; PKIX_UInt32 k = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_Boolean ene = PKIX_TRUE; /* expect no error */ PKIX_List *listOfCerts = NULL; PKIX_List *certStores = NULL; @@ -724,16 +723,8 @@ int test_buildchain_partialchain(int argc, char *argv[]) startTests("BuildChain"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* * arguments: diff --git a/security/nss/cmd/libpkix/pkix/top/test_buildchain_resourcelimits.c b/security/nss/cmd/libpkix/pkix/top/test_buildchain_resourcelimits.c index 95928819c..76ddaf327 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_buildchain_resourcelimits.c +++ b/security/nss/cmd/libpkix/pkix/top/test_buildchain_resourcelimits.c @@ -284,7 +284,6 @@ int test_buildchain_resourcelimits(int argc, char *argv[]) PKIX_CertStore *certStore = NULL; PKIX_List *certStores = NULL; PKIX_List *expectedCerts = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_Boolean testValid = PKIX_FALSE; PKIX_Boolean usebind = PKIX_FALSE; PKIX_Boolean useLDAP = PKIX_FALSE; @@ -298,16 +297,8 @@ int test_buildchain_resourcelimits(int argc, char *argv[]) startTests("BuildChain_ResourceLimits"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* * arguments: diff --git a/security/nss/cmd/libpkix/pkix/top/test_buildchain_uchecker.c b/security/nss/cmd/libpkix/pkix/top/test_buildchain_uchecker.c index 7738ff679..5c5d70b60 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_buildchain_uchecker.c +++ b/security/nss/cmd/libpkix/pkix/top/test_buildchain_uchecker.c @@ -115,7 +115,6 @@ int test_buildchain_uchecker(int argc, char *argv[]) char *oidString = NULL; void *buildState = NULL; /* needed by pkix_build for non-blocking I/O */ void *nbioContext = NULL; /* needed by pkix_build for non-blocking I/O */ - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); @@ -126,16 +125,8 @@ int test_buildchain_uchecker(int argc, char *argv[]) startTests("BuildChain_UserChecker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ENE = expect no error; EE = expect error */ if (PORT_Strcmp(argv[2+j], "ENE") == 0) { diff --git a/security/nss/cmd/libpkix/pkix/top/test_customcrlchecker.c b/security/nss/cmd/libpkix/pkix/top/test_customcrlchecker.c index 5d02eeeaa..fed86f278 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_customcrlchecker.c +++ b/security/nss/cmd/libpkix/pkix/top/test_customcrlchecker.c @@ -404,7 +404,6 @@ int test_customcrlchecker(int argc, char *argv[]){ PKIX_UInt32 i = 0; PKIX_UInt32 j = 0; PKIX_Boolean testValid = PKIX_TRUE; - PKIX_Boolean useArenas = PKIX_FALSE; char *anchorName = NULL; PKIX_TEST_STD_VARS(); @@ -416,16 +415,8 @@ int test_customcrlchecker(int argc, char *argv[]){ startTests("CRL Checker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ENE = expect no error; EE = expect error */ if (PORT_Strcmp(argv[2+j], "ENE") == 0) { diff --git a/security/nss/cmd/libpkix/pkix/top/test_defaultcrlchecker2stores.c b/security/nss/cmd/libpkix/pkix/top/test_defaultcrlchecker2stores.c index e01fcfc75..dc763a1d3 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_defaultcrlchecker2stores.c +++ b/security/nss/cmd/libpkix/pkix/top/test_defaultcrlchecker2stores.c @@ -172,7 +172,6 @@ int test_defaultcrlchecker2stores(int argc, char *argv[]){ PKIX_UInt32 i = 0; PKIX_UInt32 j = 0; PKIX_Boolean testValid = PKIX_TRUE; - PKIX_Boolean useArenas = PKIX_FALSE; char *dirName = NULL; char *anchorName = NULL; @@ -185,16 +184,8 @@ int test_defaultcrlchecker2stores(int argc, char *argv[]){ startTests("CRL Checker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ENE = expect no error; EE = expect error */ if (PORT_Strcmp(argv[2+j], "ENE") == 0) { diff --git a/security/nss/cmd/libpkix/pkix/top/test_ocsp.c b/security/nss/cmd/libpkix/pkix/top/test_ocsp.c index 644ecaf8e..4a4d9fe59 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_ocsp.c +++ b/security/nss/cmd/libpkix/pkix/top/test_ocsp.c @@ -48,12 +48,14 @@ static void *plContext = NULL; static void printUsage(void){ - (void) printf("\nUSAGE:\nOcspChecker TestName [ENE|EE] " - "<certStoreDirectory> <trustedCert> <targetCert>\n\n"); + (void) printf("\nUSAGE:\nOcspChecker -d <certStoreDirectory> TestName " + "[ENE|EE] <certLocationDirectory> <trustedCert> " + "<targetCert>\n\n"); (void) printf ("Validates a chain of certificates between " "<trustedCert> and <targetCert>\n" - "using the certs and CRLs in <certStoreDirectory>. " + "using the certs and CRLs in <certLocationDirectory> and " + "pkcs11 db from <certStoreDirectory>. " "If ENE is specified,\n" "then an Error is Not Expected. " "If EE is specified, an Error is Expected.\n"); @@ -190,7 +192,6 @@ int test_ocsp(int argc, char *argv[]){ PKIX_UInt32 k = 0; PKIX_UInt32 chainLength = 0; PKIX_Boolean testValid = PKIX_TRUE; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_List *chainCerts = NULL; PKIX_VerifyNode *verifyTree = NULL; PKIX_PL_String *verifyString = NULL; @@ -213,22 +214,8 @@ int test_ocsp(int argc, char *argv[]){ startTests("OcspChecker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - databaseDir = argv[3+j]; - - /* This must precede the call to PKIX_Initialize! */ - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize_SetConfigDir - (PKIX_STORE_TYPE_PK11, databaseDir, plContext)); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ENE = expect no error; EE = expect error */ if (PORT_Strcmp(argv[2+j], "ENE") == 0) { @@ -242,7 +229,7 @@ int test_ocsp(int argc, char *argv[]){ subTest(argv[1+j]); - dirName = databaseDir; + dirName = argv[3+j]; chainLength = argc - j - 5; diff --git a/security/nss/cmd/libpkix/pkix/top/test_policychecker.c b/security/nss/cmd/libpkix/pkix/top/test_policychecker.c index 9004b3404..e2593c81d 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_policychecker.c +++ b/security/nss/cmd/libpkix/pkix/top/test_policychecker.c @@ -416,7 +416,6 @@ int test_policychecker(int argc, char *argv[]) PKIX_Boolean initialAnyPolicyInhibit = PKIX_FALSE; PKIX_Boolean initialExplicitPolicy = PKIX_FALSE; PKIX_Boolean expectedResult = PKIX_FALSE; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 chainLength = 0; PKIX_UInt32 initArgs = 0; PKIX_UInt32 firstCert = 0; @@ -442,16 +441,8 @@ int test_policychecker(int argc, char *argv[]) PKIX_TEST_STD_VARS(); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* * Perform hard-coded tests if no command line args. diff --git a/security/nss/cmd/libpkix/pkix/top/test_subjaltnamechecker.c b/security/nss/cmd/libpkix/pkix/top/test_subjaltnamechecker.c index 85f3ed9b6..ceeddab67 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_subjaltnamechecker.c +++ b/security/nss/cmd/libpkix/pkix/top/test_subjaltnamechecker.c @@ -137,7 +137,6 @@ int test_subjaltnamechecker(int argc, char *argv[]){ PKIX_UInt32 nameType; PKIX_Boolean matchAll = PKIX_TRUE; PKIX_Boolean testValid = PKIX_TRUE; - PKIX_Boolean useArenas = PKIX_FALSE; char *dirName = NULL; char *anchorName = NULL; PKIX_VerifyNode *verifyTree = NULL; @@ -152,16 +151,8 @@ int test_subjaltnamechecker(int argc, char *argv[]){ startTests("SubjAltNameConstraintChecker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); j++; /* skip test-purpose string */ diff --git a/security/nss/cmd/libpkix/pkix/top/test_validatechain.c b/security/nss/cmd/libpkix/pkix/top/test_validatechain.c index b4ca32e16..196c345ad 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_validatechain.c +++ b/security/nss/cmd/libpkix/pkix/top/test_validatechain.c @@ -169,7 +169,6 @@ int test_validatechain(int argc, char *argv[]){ PKIX_UInt32 k = 0; PKIX_UInt32 chainLength = 0; PKIX_Boolean testValid = PKIX_TRUE; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_List *chainCerts = NULL; PKIX_PL_Cert *dirCert = NULL; PKIX_VerifyNode *verifyTree = NULL; @@ -187,16 +186,8 @@ int test_validatechain(int argc, char *argv[]){ startTests("ValidateChain"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ENE = expect no error; EE = expect error */ if (PORT_Strcmp(argv[2+j], "ENE") == 0) { diff --git a/security/nss/cmd/libpkix/pkix/top/test_validatechain_NB.c b/security/nss/cmd/libpkix/pkix/top/test_validatechain_NB.c index 52f872838..2963d60da 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_validatechain_NB.c +++ b/security/nss/cmd/libpkix/pkix/top/test_validatechain_NB.c @@ -206,7 +206,6 @@ int test_validatechain_NB(int argc, char *argv[]){ PKIX_UInt32 k = 0; PKIX_UInt32 chainLength = 0; PKIX_Boolean testValid = PKIX_TRUE; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_List *chainCerts = NULL; PKIX_PL_Cert *dirCert = NULL; char *dirCertName = NULL; @@ -238,16 +237,8 @@ int test_validatechain_NB(int argc, char *argv[]){ startTests("ValidateChain_NB"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ENE = expect no error; EE = expect error */ if (PORT_Strcmp(argv[2+j], "ENE") == 0) { diff --git a/security/nss/cmd/libpkix/pkix/top/test_validatechain_bc.c b/security/nss/cmd/libpkix/pkix/top/test_validatechain_bc.c index 68f1265f6..fc0c533fe 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_validatechain_bc.c +++ b/security/nss/cmd/libpkix/pkix/top/test_validatechain_bc.c @@ -151,7 +151,6 @@ int test_validatechain_bc(int argc, char *argv[]) PKIX_UInt32 i = 0; PKIX_UInt32 j = 0; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_VerifyNode *verifyTree = NULL; PKIX_PL_String *verifyString = NULL; @@ -164,16 +163,8 @@ int test_validatechain_bc(int argc, char *argv[]) startTests("ValidateChainBasicConstraints"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); chainLength = (argc - j) - 2; diff --git a/security/nss/cmd/libpkix/pkix/util/test_error.c b/security/nss/cmd/libpkix/pkix/util/test_error.c index 5234a7681..81297d9a4 100644 --- a/security/nss/cmd/libpkix/pkix/util/test_error.c +++ b/security/nss/cmd/libpkix/pkix/util/test_error.c @@ -383,23 +383,14 @@ int test_error(int argc, char *argv[]) { char *descChar2 = "Another Error Message"; char *infoChar = "Auxiliary Info"; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; PKIX_TEST_STD_VARS(); startTests("Errors"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_Error_Create"); createErrors diff --git a/security/nss/cmd/libpkix/pkix/util/test_list.c b/security/nss/cmd/libpkix/pkix/util/test_list.c index 33c86e7f4..eb145c0b1 100644 --- a/security/nss/cmd/libpkix/pkix/util/test_list.c +++ b/security/nss/cmd/libpkix/pkix/util/test_list.c @@ -799,23 +799,14 @@ int test_list(int argc, char *argv[]) { char *testItemString2 = "b"; char *testItemString3 = "c"; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; PKIX_TEST_STD_VARS(); startTests("Lists"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_List_Create"); createLists(&list, &list2); diff --git a/security/nss/cmd/libpkix/pkix/util/test_list2.c b/security/nss/cmd/libpkix/pkix/util/test_list2.c index 0c2b8afa3..3dffef26e 100644 --- a/security/nss/cmd/libpkix/pkix/util/test_list2.c +++ b/security/nss/cmd/libpkix/pkix/util/test_list2.c @@ -69,23 +69,14 @@ int test_list2(int argc, char *argv[]) { "1.2.3.4.5", "0.39.1.300" }; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 actualMinorVersion; PKIX_TEST_STD_VARS(); startTests("List Sorting"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("Creating Unsorted Lists"); PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_Create(&list, plContext)); diff --git a/security/nss/cmd/libpkix/pkix/util/test_logger.c b/security/nss/cmd/libpkix/pkix/util/test_logger.c index 3b1cc0b77..8bac07d76 100644 --- a/security/nss/cmd/libpkix/pkix/util/test_logger.c +++ b/security/nss/cmd/libpkix/pkix/util/test_logger.c @@ -324,23 +324,14 @@ int test_logger(int argc, char *argv[]) { PKIX_Logger *logger, *logger2; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; PKIX_TEST_STD_VARS(); startTests("Loggers"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_Logger_Create"); createLogger(&logger, NULL, testLoggerCallback); diff --git a/security/nss/cmd/libpkix/pkix_pl/module/test_colcertstore.c b/security/nss/cmd/libpkix/pkix_pl/module/test_colcertstore.c index 37ecbc0c7..5e3316c9b 100644 --- a/security/nss/cmd/libpkix/pkix_pl/module/test_colcertstore.c +++ b/security/nss/cmd/libpkix/pkix_pl/module/test_colcertstore.c @@ -247,7 +247,6 @@ static void printUsage(char *pName){ int test_colcertstore(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; char *platformDir = NULL; char *dataDir = NULL; @@ -257,16 +256,8 @@ int test_colcertstore(int argc, char *argv[]) { startTests("CollectionCertStore"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < (3 + j)) { printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix_pl/module/test_ekuchecker.c b/security/nss/cmd/libpkix/pkix_pl/module/test_ekuchecker.c index 3d64f954c..ed7561332 100644 --- a/security/nss/cmd/libpkix/pkix_pl/module/test_ekuchecker.c +++ b/security/nss/cmd/libpkix/pkix_pl/module/test_ekuchecker.c @@ -228,7 +228,6 @@ int test_ekuchecker(int argc, char *argv[]){ PKIX_UInt32 j = 0; PKIX_Boolean testValid = PKIX_FALSE; PKIX_Boolean only4EE = PKIX_FALSE; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); @@ -239,16 +238,8 @@ int test_ekuchecker(int argc, char *argv[]){ startTests("EKU Checker"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ENE = expect no error; EE = expect error */ if (PORT_Strcmp(argv[2+j], "ENE") == 0) { diff --git a/security/nss/cmd/libpkix/pkix_pl/module/test_httpcertstore.c b/security/nss/cmd/libpkix/pkix_pl/module/test_httpcertstore.c index 901566992..b5ec21425 100644 --- a/security/nss/cmd/libpkix/pkix_pl/module/test_httpcertstore.c +++ b/security/nss/cmd/libpkix/pkix_pl/module/test_httpcertstore.c @@ -127,7 +127,6 @@ int test_httpcertstore(int argc, char *argv[]) { PKIX_UInt32 numCerts = 0; PKIX_UInt32 numCrls = 0; int j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 length = 0; @@ -156,16 +155,8 @@ int test_httpcertstore(int argc, char *argv[]) { startTests("HttpCertStore"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc != (j + 3)) { printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix_pl/module/test_pk11certstore.c b/security/nss/cmd/libpkix/pkix_pl/module/test_pk11certstore.c index 92970a5fa..a2f54aec9 100644 --- a/security/nss/cmd/libpkix/pkix_pl/module/test_pk11certstore.c +++ b/security/nss/cmd/libpkix/pkix_pl/module/test_pk11certstore.c @@ -437,20 +437,18 @@ cleanup: static void printUsage(char *pName){ - printf("\nUSAGE: %s <data-dir> <database-dir>\n\n", pName); + printf("\nUSAGE: %s <-d data-dir> <database-dir>\n\n", pName); } /* Functional tests for Pk11CertStore public functions */ int test_pk11certstore(int argc, char *argv[]) { - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; PKIX_UInt32 actualMinorVersion; PKIX_PL_Date *validityDate = NULL; PKIX_PL_Date *betweenDate = NULL; char *crlDir = NULL; - char *databaseDir = NULL; char *expectedProfAscii = "([\n" "\tVersion: v3\n" "\tSerialNumber: 00ca\n" @@ -607,27 +605,8 @@ int test_pk11certstore(int argc, char *argv[]) { return (0); } - /* too bad we cannot do this after the macro NSSCONTEXT_SETUP */ - databaseDir = argv[1]; - if (databaseDir[0] == '-') { - /* with -arenas at front */ - databaseDir = argv[2]; - } - - /* This must precede the call to PKIX_Initialize! */ - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize_SetConfigDir - (PKIX_STORE_TYPE_PK11, databaseDir, plContext)); - - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); crlDir = argv[j+2]; diff --git a/security/nss/cmd/libpkix/pkix_pl/module/test_socket.c b/security/nss/cmd/libpkix/pkix_pl/module/test_socket.c index 9f1cfd9fa..e5340e901 100644 --- a/security/nss/cmd/libpkix/pkix_pl/module/test_socket.c +++ b/security/nss/cmd/libpkix/pkix_pl/module/test_socket.c @@ -444,7 +444,6 @@ void dispatcher() int test_socket(int argc, char *argv[]) { - PKIX_Boolean useArenas = PKIX_FALSE; int j = 0; PKIX_UInt32 actualMinorVersion; char buf[PR_NETDB_BUF_SIZE]; @@ -462,16 +461,8 @@ int test_socket(int argc, char *argv[]) { startTests("Socket"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc != (j + 2)) { printUsage(argv[0]); diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_authorityinfoaccess.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_authorityinfoaccess.c index 19cb1b1e6..faae34899 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_authorityinfoaccess.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_authorityinfoaccess.c @@ -62,7 +62,6 @@ int test_authorityinfoaccess(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; PKIX_UInt32 size, i; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *expectedAscii = "[method:caIssuers, location:ldap:" "//betty.nist.gov/cn=CA,ou=Basic%20LDAP%20URI%20OU1," "o=Test%20Certificates,c=US?cACertificate;binary," @@ -72,16 +71,8 @@ int test_authorityinfoaccess(int argc, char *argv[]) { startTests("AuthorityInfoAccess"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 5+j) { printf("Usage: %s <test-purpose> <cert> <diff-cert>\n", argv[0]); diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_cert.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_cert.c index 01293c225..5d036658d 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_cert.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_cert.c @@ -2236,7 +2236,6 @@ int test_cert(int argc, char *argv[]) { PKIX_PL_Cert *equalObject = NULL; PKIX_PL_Cert *diffObject = NULL; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; char *dataCentralDir = NULL; @@ -2276,16 +2275,8 @@ int test_cert(int argc, char *argv[]) { startTests("Cert"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 3+j) { printUsage(); diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_crl.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_crl.c index 7e970f10a..87fb31bc1 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_crl.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_crl.c @@ -249,7 +249,6 @@ int test_crl(int argc, char *argv[]) { PKIX_PL_CRL *goodObject = NULL; PKIX_PL_CRL *equalObject = NULL; PKIX_PL_CRL *diffObject = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; @@ -292,16 +291,8 @@ int test_crl(int argc, char *argv[]) { startTests("CRL"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 3+j) { printUsage(); diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_crlentry.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_crlentry.c index a1280b43c..fb1e07002 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_crlentry.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_crlentry.c @@ -185,7 +185,6 @@ int test_crlentry(int argc, char *argv[]) { PKIX_PL_CRLEntry *diffObject = NULL; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *dataDir = NULL; char *goodInput = "crlgood.crl"; @@ -203,16 +202,8 @@ int test_crlentry(int argc, char *argv[]) { startTests("CRLEntry"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 1+j) { printUsage(); diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_date.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_date.c index bb9452763..02ce70e5c 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_date.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_date.c @@ -115,7 +115,6 @@ int test_date(int argc, char *argv[]) { char *goodInput = NULL; char *diffInput = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; @@ -123,16 +122,8 @@ int test_date(int argc, char *argv[]) { startTests("Date"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); goodInput = "040329134847Z"; diffInput = "050329135847Z"; diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_generalname.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_generalname.c index 249397190..2ee4beed4 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_generalname.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_generalname.c @@ -105,7 +105,6 @@ int test_generalname(int argc, char *argv[]) { char *goodInput = NULL; char *diffInput = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; @@ -113,16 +112,8 @@ int test_generalname(int argc, char *argv[]) { startTests("GeneralName"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); goodInput = "john@sun.com"; diffInput = "john@labs.com"; diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_nameconstraints.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_nameconstraints.c index a2b251746..14193ad6b 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_nameconstraints.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_nameconstraints.c @@ -122,7 +122,6 @@ int test_nameconstraints(int argc, char *argv[]) { char *platformDir = NULL; char *dataDir = NULL; char *combinedDir = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; /* Note XXX serialnumber and reasoncode need debug */ @@ -130,16 +129,8 @@ int test_nameconstraints(int argc, char *argv[]) { startTests("NameConstraints"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 3 + j) { printUsage(); diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_subjectinfoaccess.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_subjectinfoaccess.c index d7440f197..9f2260f93 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_subjectinfoaccess.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_subjectinfoaccess.c @@ -64,7 +64,6 @@ int test_subjectinfoaccess(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; PKIX_UInt32 size, i; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *expectedAscii = "[method:caRepository, " "location:http://betty.nist.gov/pathdiscoverytestsuite/" "p7cfiles/IssuedByTrustAnchor1.p7c]"; @@ -73,16 +72,8 @@ int test_subjectinfoaccess(int argc, char *argv[]) { startTests("SubjectInfoAccess"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); if (argc < 5+j) { printf("Usage: %s <test-purpose> <cert> <diff-cert>\n", argv[0]); diff --git a/security/nss/cmd/libpkix/pkix_pl/pki/test_x500name.c b/security/nss/cmd/libpkix/pkix_pl/pki/test_x500name.c index 7b026d059..2bf098188 100644 --- a/security/nss/cmd/libpkix/pkix_pl/pki/test_x500name.c +++ b/security/nss/cmd/libpkix/pkix_pl/pki/test_x500name.c @@ -166,7 +166,6 @@ int test_x500name(int argc, char *argv[]) { PKIX_PL_X500Name *equalObject = NULL; PKIX_PL_X500Name *diffObject = NULL; PKIX_PL_X500Name *diffObjectMatch = NULL; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; @@ -180,16 +179,8 @@ int test_x500name(int argc, char *argv[]) { startTests("X500Name"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); createX500Names (goodInput, diffInput, diffInputMatch, diff --git a/security/nss/cmd/libpkix/pkix_pl/system/stress_test.c b/security/nss/cmd/libpkix/pkix_pl/system/stress_test.c index a063680db..251abe87c 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/stress_test.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/stress_test.c @@ -58,23 +58,14 @@ int stress_test(int argc, char *argv[]) { void *dest; PKIX_PL_HashTable *ht = NULL; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; PKIX_TEST_STD_VARS(); startTests("Stress Test"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); /* ---------------------------- */ subTest("Create every three letter String"); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_bigint.c b/security/nss/cmd/libpkix/pkix_pl/system/test_bigint.c index 70127deaa..236a1f295 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_bigint.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_bigint.c @@ -153,7 +153,6 @@ int test_bigint(int argc, char *argv[]) { PKIX_Int32 cmpResult; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char *bigIntValue[4] = { @@ -169,16 +168,8 @@ int test_bigint(int argc, char *argv[]) { startTests("BigInts"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); for (i = 0; i < badSize; i++) { subTest("PKIX_PL_BigInt_Create <error_handling>"); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_bytearray.c b/security/nss/cmd/libpkix/pkix_pl/system/test_bytearray.c index abae8cbda..d59199a9c 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_bytearray.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_bytearray.c @@ -213,7 +213,6 @@ int test_bytearray(int argc, char *argv[]) { char *dummyArray[4]; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); @@ -224,16 +223,8 @@ int test_bytearray(int argc, char *argv[]) { startTests("ByteArrays"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest ("PKIX_PL_ByteArray_Create <zero length>"); testZeroLength(); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_hashtable.c b/security/nss/cmd/libpkix/pkix_pl/system/test_hashtable.c index b6c3477d2..57bcb7cc4 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_hashtable.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_hashtable.c @@ -407,23 +407,14 @@ int test_hashtable(int argc, char *argv[]) { PKIX_PL_String *testString, *testString2, *testString3; PKIX_PL_OID *testOID; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_UInt32 j = 0; PKIX_TEST_STD_VARS(); startTests("HashTables"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_PL_HashTable_Create"); createHashTables(&ht, &ht2, &ht3, &ht4); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_mem.c b/security/nss/cmd/libpkix/pkix_pl/system/test_mem.c index ebbec73a1..e5a749bea 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_mem.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_mem.c @@ -116,22 +116,13 @@ int test_mem(int argc, char *argv[]) { int arraySize = 10; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("Memory Allocation"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_PL_Malloc"); testMalloc(&array); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_monitorlock.c b/security/nss/cmd/libpkix/pkix_pl/system/test_monitorlock.c index 967dfee5e..a21a620c6 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_monitorlock.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_monitorlock.c @@ -106,22 +106,13 @@ int test_monitorlock(int argc, char *argv[]) { PKIX_PL_MonitorLock *monitorLock, *monitorLock2, *monitorLock3; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("MonitorLocks"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_PL_MonitorLock_Create"); createMonitorLockes(&monitorLock, &monitorLock2, &monitorLock3); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_mutex.c b/security/nss/cmd/libpkix/pkix_pl/system/test_mutex.c index 0715c8169..981beb698 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_mutex.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_mutex.c @@ -98,22 +98,13 @@ int test_mutex(int argc, char *argv[]) { PKIX_PL_Mutex *mutex, *mutex2, *mutex3; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("Mutexes"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_PL_Mutex_Create"); createMutexes(&mutex, &mutex2, &mutex3); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_mutex2.c b/security/nss/cmd/libpkix/pkix_pl/system/test_mutex2.c index 7ca65caee..5edcb24ac 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_mutex2.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_mutex2.c @@ -114,22 +114,13 @@ int test_mutex2(int argc, char *argv[]) { int x = 10, y = 20, z = 30; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("Mutex and Threads"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); (void) printf("Attempting to create new mutex...\n"); subTest("Mutex Creation"); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_mutex3.c b/security/nss/cmd/libpkix/pkix_pl/system/test_mutex3.c index 1a2c9c554..9eaa2cdcf 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_mutex3.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_mutex3.c @@ -82,22 +82,13 @@ int test_mutex3(int argc, char *argv[]) { PRThread *thread, *thread2; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("Mutex and Threads"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("Mutex Creation"); PKIX_TEST_EXPECT_NO_ERROR(PKIX_PL_Mutex_Create(&mutex, plContext)); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_object.c b/security/nss/cmd/libpkix/pkix_pl/system/test_object.c index 0c0896af8..e3cc601a9 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_object.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_object.c @@ -285,22 +285,13 @@ int test_object(int argc, char *argv[]) { PKIX_PL_Object *obj, *obj2, *obj3, *obj4; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("Objects"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_PL_Object_Create"); createObjects(&obj, &obj2, &obj3, &obj4); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_oid.c b/security/nss/cmd/libpkix/pkix_pl/system/test_oid.c index 5234ce531..819a95a50 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_oid.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_oid.c @@ -164,7 +164,6 @@ int test_oid(int argc, char *argv[]) { PKIX_UInt32 i, size = 6; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; char* validOID[6] = { "2.11.22222.33333", @@ -202,16 +201,8 @@ int test_oid(int argc, char *argv[]) { startTests("OIDs"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); for (i = 0; i < size; i++) { subTest("PKIX_PL_OID_Create"); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_rwlock.c b/security/nss/cmd/libpkix/pkix_pl/system/test_rwlock.c index ef1c08fff..ad48ee83a 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_rwlock.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_rwlock.c @@ -123,23 +123,14 @@ static void reader2(void) { int test_rwlock() { PKIX_PL_String* outputString = NULL; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_Boolean bool; PKIX_UInt32 actualMinorVersion; PKIX_TEST_STD_VARS(); startTests("RWLocks"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); (void) printf("Attempting to create new rwlock...\n"); diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_string.c b/security/nss/cmd/libpkix/pkix_pl/system/test_string.c index 703d174e7..ba49c18df 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_string.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_string.c @@ -407,22 +407,13 @@ int test_string(int argc, char *argv[]) { PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("Strings"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_PL_String_Create <ascii format>"); for (i = 0; i < size; i++) { diff --git a/security/nss/cmd/libpkix/pkix_pl/system/test_string2.c b/security/nss/cmd/libpkix/pkix_pl/system/test_string2.c index 81800aba0..170a945c2 100644 --- a/security/nss/cmd/libpkix/pkix_pl/system/test_string2.c +++ b/security/nss/cmd/libpkix/pkix_pl/system/test_string2.c @@ -315,22 +315,13 @@ int test_string2(int argc, char *argv[]) { PKIX_PL_String *chineseString, *jeanRenoString, *gorbachevString; PKIX_UInt32 actualMinorVersion; PKIX_UInt32 j = 0; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); startTests("Unicode Strings"); - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); subTest("PKIX_PL_String_Create"); createString(&vivaEspanaString, diff --git a/security/nss/cmd/libpkix/pkixutil/pkixutil.c b/security/nss/cmd/libpkix/pkixutil/pkixutil.c index 114037308..6d23c7059 100644 --- a/security/nss/cmd/libpkix/pkixutil/pkixutil.c +++ b/security/nss/cmd/libpkix/pkixutil/pkixutil.c @@ -43,6 +43,10 @@ #include <stdio.h> +#include "nspr.h" +#include "plgetopt.h" + +#include "nss.h" #include "secport.h" typedef int (*mainTestFn)(int argc, char* argv[]); @@ -198,7 +202,7 @@ testFunctionRef testFnRefTable[] = { static void printUsage(char *cmdName) { - int fnCounter = 0, totalCharLen = 0; + int fnCounter = 0; fprintf(stderr, "Usage: %s [test name] [arg1]...[argN]\n\n", cmdName); fprintf(stderr, "List of possible names for the tests:"); @@ -212,27 +216,120 @@ void printUsage(char *cmdName) { fprintf(stderr, "\n"); } - -int main(int argc, char **argv) { - char *fnName = NULL; - int fnCounter = 0; - +static SECStatus +getTestArguments(int argc, + char **argv, + mainTestFn *ptestFn, + char **pdbPath, + int *pargc, + char ***pargv) +{ + PLOptState *optstate = NULL; + PLOptStatus status; + mainTestFn testFunction = NULL; + char **wArgv = NULL; + char *dbPath = NULL; + char *fnName = NULL; + int wArgc = 0; + int fnCounter = 0; + if (argc < 2) { - printUsage(argv[0]); - return 1; + printf("ERROR: insufficient number of arguments: %s.\n", fnName); + return SECFailure; } - + fnName = argv[1]; while (testFnRefTable[fnCounter].fnName != NULL) { - int fnNameLen = PORT_Strlen(testFnRefTable[fnCounter].fnName); - if (!PORT_Strncmp(fnName, testFnRefTable[fnCounter].fnName, - fnNameLen)) { - return testFnRefTable[fnCounter].fnPointer(argc - 1, argv + 1); + if (!PORT_Strcmp(fnName, testFnRefTable[fnCounter].fnName)) { + testFunction = testFnRefTable[fnCounter].fnPointer; + break; } fnCounter += 1; } - printf("ERROR: unknown name of the test: %s.\n", fnName); - printUsage(argv[0]); - return -1; + if (!testFunction) { + printf("ERROR: unknown name of the test: %s.\n", fnName); + return SECFailure; + } + + wArgv = PORT_ZNewArray(char*, argc); + if (!wArgv) { + return SECFailure; + } + + /* set name of the function as a first arg and increment arg count. */ + wArgv[0] = fnName; + wArgc += 1; + + optstate = PL_CreateOptState(argc - 1, argv + 1, "d:"); + while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) { + switch (optstate->option) { + case 'd': + dbPath = (char*)optstate->value; + break; + + default: + wArgv[wArgc] = (char*)optstate->value; + wArgc += 1; + break; + } + } + PL_DestroyOptState(optstate); + + *ptestFn = testFunction; + *pdbPath = dbPath; + *pargc = wArgc; + *pargv = wArgv; + + return SECSuccess; +} + + +static +int runCmd(mainTestFn fnPointer, + int argc, + char **argv, + char *dbPath) +{ + int retStat = 0; + + /* Initialize NSPR and NSS. */ + PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1); + + /* if using databases, use NSS_Init and not NSS_NoDB_Init */ + if (dbPath && PORT_Strlen(dbPath) != 0) { + if (NSS_Init(dbPath) != SECSuccess) + return SECFailure; + } else { + if (NSS_NoDB_Init(NULL) != 0) + return SECFailure; + } + retStat = fnPointer(argc, argv); + + if (NSS_Shutdown() != SECSuccess) { + exit(1); + } + PR_Cleanup(); + return retStat; +} + +int main(int argc, char **argv) { + mainTestFn testFunction = NULL; + char *dbPath = NULL; + char **testArgv = NULL; + int testArgc = 0; + int rv = 0; + + rv = getTestArguments(argc, argv, &testFunction, &dbPath, + &testArgc, &testArgv); + if (rv != SECSuccess) { + printUsage(argv[0]); + return 1; + } + + rv = runCmd(testFunction, testArgc, testArgv, dbPath); + + PORT_Free(testArgv); + + return rv; } diff --git a/security/nss/cmd/libpkix/sample_apps/validate_chain.c b/security/nss/cmd/libpkix/sample_apps/validate_chain.c index 675675afb..c580399bb 100644 --- a/security/nss/cmd/libpkix/sample_apps/validate_chain.c +++ b/security/nss/cmd/libpkix/sample_apps/validate_chain.c @@ -156,7 +156,6 @@ int validate_chain(int argc, char *argv[]) PKIX_UInt32 i = 0; PKIX_UInt32 j = 0; PKIX_UInt32 actualMinorVersion; - PKIX_Boolean useArenas = PKIX_FALSE; PKIX_TEST_STD_VARS(); @@ -165,16 +164,8 @@ int validate_chain(int argc, char *argv[]) return (0); } - useArenas = PKIX_TEST_ARENAS_ARG(argv[1]); - - PKIX_TEST_EXPECT_NO_ERROR(PKIX_Initialize - (PKIX_TRUE, /* nssInitNeeded */ - useArenas, - PKIX_MAJOR_VERSION, - PKIX_MINOR_VERSION, - PKIX_MINOR_VERSION, - &actualMinorVersion, - &plContext)); + PKIX_TEST_EXPECT_NO_ERROR( + PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); chainLength = (argc - j) - 2; diff --git a/security/nss/cmd/libpkix/testutil/testutil.h b/security/nss/cmd/libpkix/testutil/testutil.h index 40fd9bd35..528fc0ea9 100755 --- a/security/nss/cmd/libpkix/testutil/testutil.h +++ b/security/nss/cmd/libpkix/testutil/testutil.h @@ -274,7 +274,7 @@ extern "C" { #define PKIX_TEST_ARENAS_ARG(arena) \ (arena? \ - (PORT_Strcmp(arena, "-arenas") ? PKIX_FALSE : (j++, PKIX_TRUE)): \ + (PORT_Strcmp(arena, "arenas") ? PKIX_FALSE : (j++, PKIX_TRUE)): \ PKIX_FALSE) #define PKIX_TEST_ERROR_RECEIVED (pkixTestErrorMsg || pkixTestErrorResult) diff --git a/security/nss/tests/libpkix/pkix_pl_tests/module/runPLTests.sh b/security/nss/tests/libpkix/pkix_pl_tests/module/runPLTests.sh index 996bff4ea..f6d787e05 100755 --- a/security/nss/tests/libpkix/pkix_pl_tests/module/runPLTests.sh +++ b/security/nss/tests/libpkix/pkix_pl_tests/module/runPLTests.sh @@ -106,7 +106,7 @@ export SOCKETTRACE RunTests <<EOF pkixutil test_colcertstore NIST-Test-Files-Used rev_data/local ${HOSTDIR} -pkixutil test_pk11certstore ../../pkix_pl_tests/module ../../pkix_tests/top/rev_data/crlchecker +pkixutil test_pk11certstore -d ../../pkix_pl_tests/module ../../pkix_tests/top/rev_data/crlchecker pkixutil test_ekuchecker "Test-EKU-without-OID" ENE "" rev_data test_eku_codesigning_clientauth.crt test_eku_clientauth.crt test_eku_clientauthEE.crt pkixutil test_ekuchecker "Test-EKU-with-good-OID" ENE "1.3.6.1.5.5.7.3.3" rev_data test_eku_codesigning_clientauth.crt test_eku_clientauth.crt test_eku_clientauthEE.crt pkixutil test_ekuchecker "Test-EKU-with-bad-OID" EE "1.3.6.1.5.5.7.3.4" rev_data test_eku_codesigning_clientauth.crt test_eku_clientauth.crt test_eku_clientauthEE.crt diff --git a/security/nss/tests/libpkix/pkix_tests/top/runTests.sh b/security/nss/tests/libpkix/pkix_tests/top/runTests.sh index f79c93846..def12e3f5 100755 --- a/security/nss/tests/libpkix/pkix_tests/top/runTests.sh +++ b/security/nss/tests/libpkix/pkix_tests/top/runTests.sh @@ -106,10 +106,15 @@ export LOGGING SOCKETTRACE RunTests <<EOF pkixutil test_validatechain_NB NIST-Test.4.1.1 ENE $NIST TrustAnchorRootCertificate.crt GoodCACert.crt ValidCertificatePathTest1EE.crt +pkixutil_or test_validatechain_NB NIST-Test.4.1.1 ENE $NIST TrustAnchorRootCertificate.crt GoodCACert.crt ValidCertificatePathTest1EE.crt pkixutil test_validatechain_NB NIST-Test.4.1.2 EE $NIST TrustAnchorRootCertificate.crt BadSignedCACert.crt InvalidCASignatureTest2EE.crt +pkixutil_or test_validatechain_NB NIST-Test.4.1.2 EE $NIST TrustAnchorRootCertificate.crt BadSignedCACert.crt InvalidCASignatureTest2EE.crt pkixutil test_validatechain_NB NIST-Test.4.1.3 EE $NIST TrustAnchorRootCertificate.crt GoodCACert.crt InvalidEESignatureTest3EE.crt +pkixutil_or test_validatechain_NB NIST-Test.4.1.3 EE $NIST TrustAnchorRootCertificate.crt GoodCACert.crt InvalidEESignatureTest3EE.crt pkixutil test_validatechain_NB NIST-Test.4.1.4 ENE $NIST TrustAnchorRootCertificate.crt DSACACert.crt ValidDSASignaturesTest4EE.crt +pkixutil_or test_validatechain_NB NIST-Test.4.1.4 ENE $NIST TrustAnchorRootCertificate.crt DSACACert.crt ValidDSASignaturesTest4EE.crt pkixutil test_validatechain_NB NIST-Test.4.1.5 ENE $NIST TrustAnchorRootCertificate.crt DSACACert.crt DSAParametersInheritedCACert.crt ValidDSAParameterInheritanceTest5EE.crt +pkixutil_or test_validatechain_NB NIST-Test.4.1.5 ENE $NIST TrustAnchorRootCertificate.crt DSACACert.crt DSAParametersInheritedCACert.crt ValidDSAParameterInheritanceTest5EE.crt EOF tracedErrors=$? @@ -499,8 +504,8 @@ pkixutil test_buildchain_partialchain ${LDAP} NIST-Test.4.6.14 ENE $NIST Validp pkixutil test_buildchain_partialchain ${LDAP} NIST-Test.4.13.13 EE $NIST InvalidDNnameConstraintsTest13EE.crt nameConstraintsDN1subCA2Cert.crt nameConstraintsDN1subCA2Cert.crt nameConstraintsDN1CACert.crt TrustAnchorRootCertificate.crt pkixutil test_buildchain_partialchain ${LDAP} NIST-Test.4.13.27 ENE $NIST ValidDNandRFC822nameConstraintsTest27EE.crt nameConstraintsDN1subCA3Cert.crt nameConstraintsDN1subCA2Cert.crt TrustAnchorRootCertificate.crt pkixutil test_buildchain ${LDAP} NIST-PDTest ENE ${NIST_PDTEST} certs/BasicHTTPURIPathDiscoveryTest2EE.crt certs/BasicHTTPURITrustAnchorRootCert.crt -pkixutil test_ocsp OCSP-Test ENE ${HOSTDIR}/ocsp anchorcert.crt goodcert.crt -pkixutil test_ocsp OCSP-Test EE ${HOSTDIR}/ocsp anchorcert.crt revokedcert.crt +pkixutil test_ocsp -d ${HOSTDIR}/ocsp OCSP-Test ENE ${HOSTDIR}/ocsp anchorcert.crt goodcert.crt +pkixutil test_ocsp -d ${HOSTDIR}/ocsp OCSP-Test EE ${HOSTDIR}/ocsp anchorcert.crt revokedcert.crt EOF totalErrors=$? diff --git a/security/nss/tests/libpkix/sample_apps/runPerf.sh b/security/nss/tests/libpkix/sample_apps/runPerf.sh index 384d8dad6..38e1d00a2 100755 --- a/security/nss/tests/libpkix/sample_apps/runPerf.sh +++ b/security/nss/tests/libpkix/sample_apps/runPerf.sh @@ -127,7 +127,7 @@ Display "*********************************************************************** errors=0 iLoop=0 - perfPgm="${DIST_BIN}/pkixutil libpkix_buildthreads 5 8 ValidCertificatePathTest1EE" + perfPgm="${DIST_BIN}/pkixutil libpkix_buildthreads -d . 5 8 ValidCertificatePathTest1EE" while [ $iLoop -lt $totalLoop ] do @@ -154,12 +154,11 @@ Display "*********************************************************************** } #main - perfTest <<EOF -pkixutil libpkix_buildthreads 5 1 ValidCertificatePathTest1EE -pkixutil libpkix_buildthreads 5 8 ValidCertificatePathTest1EE -pkixutil nss_threads 5 1 ValidCertificatePathTest1EE -pkixutil nss_threads 5 8 ValidCertificatePathTest1EE +pkixutil libpkix_buildthreads -d . 5 1 ValidCertificatePathTest1EE +pkixutil libpkix_buildthreads -d . 5 8 ValidCertificatePathTest1EE +pkixutil nss_threads -d . 5 1 ValidCertificatePathTest1EE +pkixutil nss_threads -d . 5 8 ValidCertificatePathTest1EE EOF totalErrors=$? |