diff --git a/security/nss/lib/dev/dev.h b/security/nss/lib/dev/dev.h index cc37293749c8..e4993c6262c4 100644 --- a/security/nss/lib/dev/dev.h +++ b/security/nss/lib/dev/dev.h @@ -35,7 +35,7 @@ #define DEV_H #ifdef DEBUG -static const char DEV_CVS_ID[] = "@(#) $RCSfile: dev.h,v $ $Revision: 1.16 $ $Date: 2002/02/01 17:25:10 $ $Name: $"; +static const char DEV_CVS_ID[] = "@(#) $RCSfile: dev.h,v $ $Revision: 1.17 $ $Date: 2002/02/04 21:57:03 $ $Name: $"; #endif /* DEBUG */ #ifndef DEVT_H @@ -158,6 +158,12 @@ nssSlot_Destroy NSSSlot *slot ); +NSS_EXTERN PRBool +nssSlot_IsPermanent +( + NSSSlot *slot +); + NSS_EXTERN PRStatus nssSlot_Refresh ( diff --git a/security/nss/lib/dev/devtoken.c b/security/nss/lib/dev/devtoken.c index 9d2be4422143..ce95822c0391 100644 --- a/security/nss/lib/dev/devtoken.c +++ b/security/nss/lib/dev/devtoken.c @@ -32,7 +32,7 @@ */ #ifdef DEBUG -static const char CVS_ID[] = "@(#) $RCSfile: devtoken.c,v $ $Revision: 1.5 $ $Date: 2002/02/01 17:25:11 $ $Name: $"; +static const char CVS_ID[] = "@(#) $RCSfile: devtoken.c,v $ $Revision: 1.6 $ $Date: 2002/02/04 21:57:03 $ $Name: $"; #endif /* DEBUG */ #ifndef DEV_H @@ -208,6 +208,10 @@ nssToken_IsPresent CK_SLOT_INFO slotInfo; NSSSlot *slot = token->slot; session = token->defaultSession; + /* permanent slots are always present */ + if (nssSlot_IsPermanent(slot) && session != CK_INVALID_SESSION) { + return PR_TRUE; + } nssSession_EnterMonitor(session); /* First obtain the slot info */ ckrv = CKAPI(slot)->C_GetSlotInfo(slot->slotID, &slotInfo); diff --git a/security/nss/lib/pk11wrap/dev3hack.c b/security/nss/lib/pk11wrap/dev3hack.c index 3285bae0b8c1..c9303706541e 100644 --- a/security/nss/lib/pk11wrap/dev3hack.c +++ b/security/nss/lib/pk11wrap/dev3hack.c @@ -32,7 +32,7 @@ */ #ifdef DEBUG -static const char CVS_ID[] = "@(#) $RCSfile: dev3hack.c,v $ $Revision: 1.5 $ $Date: 2002/02/01 17:25:12 $ $Name: $"; +static const char CVS_ID[] = "@(#) $RCSfile: dev3hack.c,v $ $Revision: 1.6 $ $Date: 2002/02/04 21:57:07 $ $Name: $"; #endif /* DEBUG */ #ifndef NSS_3_4_CODE @@ -154,6 +154,15 @@ nssToken_CreateFromPK11SlotInfo(NSSTrustDomain *td, PK11SlotInfo *nss3slot) return rvToken; } +NSS_IMPLEMENT PRBool +nssSlot_IsPermanent +( + NSSSlot *slot +) +{ + return slot->pk11slot->isPerm; +} + NSS_IMPLEMENT PRStatus nssSlot_Refresh (