зеркало из https://github.com/mozilla/pjs.git
Use NSS initialization.
This commit is contained in:
Родитель
e5ac6a6d92
Коммит
106fbd997a
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче