Fix for bug 326637 . Unnecessary request of PKCS11 device password. r=rrelyea

This commit is contained in:
julien.pierre.bugs%sun.com 2006-06-07 02:30:27 +00:00
parent ea225ae19b
commit 172c1bdf45
5 changed files with 13 additions and 11 deletions

View File

@ -494,7 +494,7 @@ CERT_GetCertNicknames(CERTCertDBHandle *handle, int what, void *wincx)
names->totallen = 0;
/* make sure we are logged in */
(void) pk11_TraverseAllSlots(NULL, NULL, wincx);
(void) pk11_TraverseAllSlots(NULL, NULL, PR_TRUE, wincx);
NSSTrustDomain_TraverseCertificates(handle,
CollectNicknames, (void *)names);

View File

@ -481,7 +481,7 @@ PK11_TraverseSlotCerts(SECStatus(* callback)(CERTCertificate*,SECItem *,void *),
struct nss3_cert_cbstr pk11cb;
/* authenticate to the tokens first */
(void) pk11_TraverseAllSlots( NULL, NULL, wincx);
(void) pk11_TraverseAllSlots( NULL, NULL, PR_TRUE, wincx);
fda.callback = callback;
fda.arg = arg;
@ -2323,7 +2323,7 @@ PK11_ListCerts(PK11CertListType type, void *pwarg)
listCerts.certList = certList;
/* authenticate to the slots */
(void) pk11_TraverseAllSlots( NULL, NULL, pwarg);
(void) pk11_TraverseAllSlots( NULL, NULL, PR_TRUE, pwarg);
NSSTrustDomain_TraverseCertificates(defaultTD, pk11ListCertCallback,
&listCerts);
return certList;

View File

@ -270,7 +270,7 @@ PK11_LookupCrls(CERTCrlHeadNode *nodes, int type, void *wincx) {
creater.findTemplate = theTemplate;
creater.templateCount = (attrs - theTemplate);
return pk11_TraverseAllSlots(PK11_TraverseSlot, &creater, wincx);
return pk11_TraverseAllSlots(PK11_TraverseSlot, &creater, PR_FALSE, wincx);
}
struct crlOptionsStr {
@ -421,7 +421,7 @@ SECStatus pk11_RetrieveCrls(CERTCrlHeadNode *nodes, SECItem* issuer,
creater.findTemplate = theTemplate;
creater.templateCount = (attrs - theTemplate);
return pk11_TraverseAllSlots(PK11_TraverseSlot, &creater, wincx);
return pk11_TraverseAllSlots(PK11_TraverseSlot, &creater, PR_FALSE, wincx);
}
/*

View File

@ -1571,8 +1571,8 @@ PK11_TraverseSlot(PK11SlotInfo *slot, void *arg)
* Traverse all the objects in all slots.
*/
SECStatus
pk11_TraverseAllSlots( SECStatus (*callback)(PK11SlotInfo *,void *),
void *arg,void *wincx) {
pk11_TraverseAllSlots( SECStatus (*callback)(PK11SlotInfo *,void *),
void *arg, PRBool forceLogin, void *wincx) {
PK11SlotList *list;
PK11SlotListElement *le;
SECStatus rv;
@ -1583,9 +1583,11 @@ pk11_TraverseAllSlots( SECStatus (*callback)(PK11SlotInfo *,void *),
/* look at each slot and authenticate as necessary */
for (le = list->head ; le; le = le->next) {
rv = pk11_AuthenticateUnfriendly(le->slot, PR_FALSE, wincx);
if (rv != SECSuccess) {
continue;
if (forceLogin) {
rv = pk11_AuthenticateUnfriendly(le->slot, PR_FALSE, wincx);
if (rv != SECSuccess) {
continue;
}
}
if (callback) {
(*callback)(le->slot,arg);

View File

@ -207,7 +207,7 @@ SECStatus PK11_SetObjectNickname(PK11SlotInfo *slot, CK_OBJECT_HANDLE id,
/* private */
SECStatus pk11_TraverseAllSlots( SECStatus (*callback)(PK11SlotInfo *,void *),
void *cbArg, void *pwArg);
void *cbArg, PRBool forceLogin, void *pwArg);
/* fetch multiple CRLs for a specific issuer */
SECStatus pk11_RetrieveCrls(CERTCrlHeadNode *nodes, SECItem* issuer,