CERT_CreateSubjKeyIDHashTable(); SECMOD_InitCallOnce();
nss_Init(const char *configdir, const char *certPrefix, const char *keyPrefix,		 const char *secmodName, PRBool readOnly, PRBool noCertDB, 			PRBool noModDB, PRBool forceOpen, PRBool noRootInit,			PRBool optimizeSpace){    char *moduleSpec = NULL;    char *flags = NULL;    SECStatus rv = SECFailure;    char *lconfigdir = NULL;    char *lcertPrefix = NULL;    char *lkeyPrefix = NULL;    char *lsecmodName = NULL;    if (nss_IsInitted) {	return SECSuccess;    }    if (SECSuccess != InitCRLCache()) {        return SECFailure;    }    flags = nss_makeFlags(readOnly,noCertDB,noModDB,forceOpen,					pk11_password_required, optimizeSpace);    if (flags == NULL) return rv;    /*     * configdir is double nested, and Windows uses the same character     * for file seps as we use for escapes! (sigh).     */    lconfigdir = nss_doubleEscape(configdir);    if (lconfigdir == NULL) {	goto loser;    }    lcertPrefix = nss_doubleEscape(certPrefix);    if (lcertPrefix == NULL) {	goto loser;    }    lkeyPrefix = nss_doubleEscape(keyPrefix);    if (lkeyPrefix == NULL) {	goto loser;    }    lsecmodName = nss_doubleEscape(secmodName);    if (lsecmodName == NULL) {	goto loser;    }    moduleSpec = PR_smprintf("name=\"%s\" parameters=\"configdir='%s' certPrefix='%s' keyPrefix='%s' secmod='%s' flags=%s %s\" NSS=\"flags=internal,moduleDB,moduleDBOnly,critical\"",		pk11_config_name ? pk11_config_name : NSS_DEFAULT_MOD_NAME,		lconfigdir,lcertPrefix,lkeyPrefix,lsecmodName,flags,		pk11_config_strings ? pk11_config_strings : "");loser:    PORT_Free(flags);    if (lconfigdir) PORT_Free(lconfigdir);    if (lcertPrefix) PORT_Free(lcertPrefix);    if (lkeyPrefix) PORT_Free(lkeyPrefix);    if (lsecmodName) PORT_Free(lsecmodName);    if (moduleSpec) {	SECMODModule *module = SECMOD_LoadModule(moduleSpec,NULL,PR_TRUE);	PR_smprintf_free(moduleSpec);	if (module) {	    if (module->loaded) rv=SECSuccess;	    SECMOD_DestroyModule(module);	}    }    if (rv == SECSuccess) {	/* can this function fail?? */	STAN_LoadDefaultNSS3TrustDomain();	CERT_SetDefaultCertDB((CERTCertDBHandle *)				STAN_GetDefaultTrustDomain());#ifndef XP_MAC	/* only servers need this. We currently do not have a mac server */	if ((!noModDB) && (!noCertDB) && (!noRootInit)) {	    if (!SECMOD_HasRootCerts()) {		nss_FindExternalRoot(configdir, secmodName);	    }	}#endif	pk11sdr_Init();	nss_IsInitted = PR_TRUE;    }    return rv;}