This commit is contained in:
relyea%netscape.com 2000-09-22 17:34:29 +00:00
Родитель f923ace5db
Коммит 60d0900ca3
2 изменённых файлов: 45 добавлений и 2 удалений

Просмотреть файл

@ -32,7 +32,7 @@
* may use your version of this file under either the MPL or the * may use your version of this file under either the MPL or the
* GPL. * GPL.
* *
* $Id: nss.h,v 1.1 2000-03-31 20:01:55 relyea%netscape.com Exp $ * $Id: nss.h,v 1.2 2000-09-22 17:34:28 relyea%netscape.com Exp $
*/ */
#ifndef __nss_h_ #ifndef __nss_h_
@ -49,6 +49,11 @@ SEC_BEGIN_PROTOS
*/ */
extern SECStatus NSS_Init(const char *configdir); extern SECStatus NSS_Init(const char *configdir);
/*
* initialize NSS without a creating cert db's, key db's, or secmod db's.
*/
SECStatus NSS_NoDB_Init(const char *configdir);
/* /*
* Close the Cert, Key databases. * Close the Cert, Key databases.
*/ */

Просмотреть файл

@ -32,7 +32,7 @@
* may use your version of this file under either the MPL or the * may use your version of this file under either the MPL or the
* GPL. * GPL.
* *
# $Id: nssinit.c,v 1.1 2000-03-31 20:02:17 relyea%netscape.com Exp $ # $Id: nssinit.c,v 1.2 2000-09-22 17:34:29 relyea%netscape.com Exp $
*/ */
#include "seccomon.h" #include "seccomon.h"
@ -43,6 +43,7 @@
#include "ssl.h" #include "ssl.h"
#include "sslproto.h" #include "sslproto.h"
#include "secmod.h" #include "secmod.h"
#include "secmodi.h"
#include "nss.h" #include "nss.h"
#include "secrng.h" #include "secrng.h"
#include "cdbhdl.h" /* ??? */ #include "cdbhdl.h" /* ??? */
@ -180,6 +181,42 @@ loser:
return rv; return rv;
} }
/*
* initialize NSS without a creating cert db's, key db's, or secmod db's.
*/
SECStatus
NSS_NoDB_Init(const char * configdir)
{
CERTCertDBHandle certhandle = { 0 };
SECStatus rv = SECSuccess;
SECMODModule *module;
/* now we want to verify the signature */
/* Initialize the cert code */
rv = CERT_OpenVolatileCertDB(&certhandle);
if (rv != SECSuccess) {
return rv;
}
CERT_SetDefaultCertDB(&certhandle);
RNG_RNGInit();
RNG_SystemInfoForRNG();
PK11_InitSlotLists();
module = SECMOD_NewInternal();
if (module == NULL) {
return SECFailure;
}
rv = SECMOD_LoadModule(module);
if (rv != SECSuccess) {
return rv;
}
SECMOD_SetInternalModule(module);
return rv;
}
void void
NSS_Shutdown(void) NSS_Shutdown(void)
{ {
@ -199,3 +236,4 @@ NSS_Shutdown(void)
* but there's no secmod function to close the DB. * but there's no secmod function to close the DB.
*/ */
} }