summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicolson%netscape.com <devnull@localhost>2001-06-12 22:25:13 +0000
committernicolson%netscape.com <devnull@localhost>2001-06-12 22:25:13 +0000
commita9b9eda208a4673bfa07fb2dc542ad0732716462 (patch)
treefb7cb7a4f64f8d668cccc6d9ebb03578142620b1
parentbf93a3fc6788184f49d0e6883aee439baee7928d (diff)
downloadnss-hg-a9b9eda208a4673bfa07fb2dc542ad0732716462.tar.gz
Make NSS_Init* idempotent.
Move new symbols to NSS 3.3 section of nss.def.
-rw-r--r--security/nss/lib/nss/nss.def5
-rw-r--r--security/nss/lib/nss/nss.h7
-rw-r--r--security/nss/lib/nss/nssinit.c10
3 files changed, 6 insertions, 16 deletions
diff --git a/security/nss/lib/nss/nss.def b/security/nss/lib/nss/nss.def
index 6ecbc3db9..4792ceec4 100644
--- a/security/nss/lib/nss/nss.def
+++ b/security/nss/lib/nss/nss.def
@@ -95,7 +95,6 @@ DER_GeneralizedTimeToTime;
NSS_Init;
NSS_Initialize;
NSS_InitReadWrite;
-NSS_IsInitialized;
NSS_NoDB_Init;
NSS_Shutdown;
NSS_VersionCheck;
@@ -114,7 +113,6 @@ PK11_DigestOp;
PK11_DigestFinal;
PK11_DoesMechanism;
PK11_FindCertFromNickname;
-PK11_FindCertsFromNickname;
PK11_FindCertFromDERCert;
PK11_FindCertByIssuerAndSN;
PK11_FindKeyByAnyCert;
@@ -309,7 +307,6 @@ PK11_GetKeyStrength;
PK11_ImportCertForKeyToSlot;
PK11_ImportEncryptedPrivateKeyInfo;
PK11_ImportPrivateKeyInfo;
-PK11_ImportDERPrivateKeyInfo;
PK11_MapPBEMechanismToCryptoMechanism;
PK11_PBEKeyGen;
PK11_ParamFromAlgid;
@@ -483,6 +480,7 @@ PK11_CheckSSOPassword;
PK11_CopySymKeyForSigning;
PK11_DeleteTokenCertAndKey;
PK11_DEREncodePublicKey;
+PK11_FindCertsFromNickname;
PK11_FindKeyByKeyID;
PK11_GetIVLength;
PK11_GetKeyData;
@@ -491,6 +489,7 @@ PK11_GetLowLevelKeyIDForCert;
PK11_GetLowLevelKeyIDForPrivateKey;
PK11_ImportCertForKey;
PK11_ImportDERCertForKey;
+PK11_ImportDERPrivateKeyInfo;
PK11_IsLoggedIn;
PK11_KeyForDERCertExists;
PK11_KeyForCertExists;
diff --git a/security/nss/lib/nss/nss.h b/security/nss/lib/nss/nss.h
index 14c68974c..51d4ae895 100644
--- a/security/nss/lib/nss/nss.h
+++ b/security/nss/lib/nss/nss.h
@@ -131,13 +131,6 @@ SECStatus NSS_NoDB_Init(const char *configdir);
*/
extern void NSS_Shutdown(void);
-/*
- * Returns PR_TRUE if NSS has already been successfully initialized,
- * PR_FALSE otherwise.
- */
-PRBool NSS_IsInitialized();
-
-
SEC_END_PROTOS
#endif /* __nss_h_ */
diff --git a/security/nss/lib/nss/nssinit.c b/security/nss/lib/nss/nssinit.c
index 2cd4988a0..27b51ff18 100644
--- a/security/nss/lib/nss/nssinit.c
+++ b/security/nss/lib/nss/nssinit.c
@@ -240,6 +240,10 @@ nss_Init(const char *configdir, const char *certPrefix, const char *keyPrefix,
SECStatus status;
SECStatus rv = SECFailure;
+ if( isInitialized ) {
+ return SECSuccess;
+ }
+
status = RNG_RNGInit(); /* initialize random number generator */
if (status != SECSuccess)
goto loser;
@@ -304,12 +308,6 @@ NSS_InitReadWrite(const char *configdir)
PR_FALSE, PR_FALSE, PR_FALSE);
}
-PRBool
-NSS_IsInitialized()
-{
- return isInitialized;
-}
-
/*
* OK there are now lots of options here, lets go through them all:
*