From 106fbd997a42edeb2ed58c1862429259c28148cc Mon Sep 17 00:00:00 2001 From: "relyea%netscape.com" Date: Sat, 6 Jan 2001 21:10:18 +0000 Subject: [PATCH] Use NSS initialization. --- security/nss/cmd/certcgi/certcgi.c | 43 +++--------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/security/nss/cmd/certcgi/certcgi.c b/security/nss/cmd/certcgi/certcgi.c index 1762f5b3051..d55ccc8edf9 100644 --- a/security/nss/cmd/certcgi/certcgi.c +++ b/security/nss/cmd/certcgi/certcgi.c @@ -679,39 +679,6 @@ get_serial_number(Pair *data) - - -static CERTCertDBHandle -*OpenCertDB(void) - /* NOTE: This routine has been modified to allow the libsec/pcertdb.c - * routines to automatically find and convert the old cert database - * into the new v3.0 format (cert db version 5). - */ -{ - CERTCertDBHandle *certHandle; - SECStatus rv; - - /* Allocate a handle to fill with CERT_OpenCertDB below */ - certHandle = (CERTCertDBHandle *)PORT_ZAlloc(sizeof(CERTCertDBHandle)); - if (!certHandle) { - error_out("ERROR: unable to get database handle"); - return NULL; - } - - rv = CERT_OpenCertDB(certHandle, PR_FALSE, SECU_CertDBNameCallback, NULL); - - if (rv) { - error_out("ERROR: Could not open certificate database"); - if (certHandle) free (certHandle); /* we don't want to leave - anything behind... */ - return NULL; - } else { - CERT_SetDefaultCertDB(certHandle); - } - - return certHandle; -} - typedef SECStatus (* EXTEN_VALUE_ENCODER) (PRArenaPool *extHandle, void *value, SECItem *encodedValue); @@ -2281,14 +2248,10 @@ main() PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1); - SECU_PKCS11Init(PR_FALSE); - SEC_Init(); PK11_SetPasswordFunc(return_dbpasswd); - handle = NULL; - handle = OpenCertDB(); - if (handle == NULL) { - error_out("Error: Unable to open certificate database"); - } + NSS_InitReadWrite(DBdir); + handle = CERT_GetDefaultCertDB(); + prefix[0]= '\0'; #if !defined(OFFLINE) form_output = (char*) PORT_Alloc(length);