bug 130747, update trust after login to catch user certs when token doesn't return public key (ncipher)
git-svn-id: svn://10.0.0.236/trunk@116652 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
c6cc0546de
commit
bf3291aaf7
@ -35,7 +35,7 @@
|
||||
#define DEVNSS3HACK_H
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char DEVNSS3HACK_CVS_ID[] = "@(#) $RCSfile: dev3hack.h,v $ $Revision: 1.5 $ $Date: 2002-03-06 01:44:50 $ $Name: not supported by cvs2svn $";
|
||||
static const char DEVNSS3HACK_CVS_ID[] = "@(#) $RCSfile: dev3hack.h,v $ $Revision: 1.6 $ $Date: 2002-03-15 19:23:14 $ $Name: not supported by cvs2svn $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
#include "cert.h"
|
||||
@ -58,9 +58,12 @@ void PK11Slot_SetNSSToken(PK11SlotInfo *sl, NSSToken *nsst);
|
||||
|
||||
NSSToken * PK11Slot_GetNSSToken(PK11SlotInfo *sl);
|
||||
|
||||
NSS_IMPLEMENT PRStatus
|
||||
NSS_EXTERN PRStatus
|
||||
nssToken_LoadCerts(NSSToken *token);
|
||||
|
||||
NSS_EXTERN void
|
||||
nssToken_UpdateTrustForCerts(NSSToken *token);
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* DEVNSS3HACK_H */
|
||||
|
||||
@ -1149,6 +1149,7 @@ PK11_DoPassword(PK11SlotInfo *slot, PRBool loadCerts, void *wincx)
|
||||
if (rv == SECSuccess && slot->nssToken && !PK11_IsFriendly(slot)) {
|
||||
/* notify stan about the login if certs are not public readable */
|
||||
nssToken_LoadCerts(slot->nssToken);
|
||||
nssToken_UpdateTrustForCerts(slot->nssToken);
|
||||
}
|
||||
} else if (!attempt) PORT_SetError(SEC_ERROR_BAD_PASSWORD);
|
||||
return rv;
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: pki3hack.c,v $ $Revision: 1.44 $ $Date: 2002-03-08 00:02:35 $ $Name: not supported by cvs2svn $";
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: pki3hack.c,v $ $Revision: 1.45 $ $Date: 2002-03-15 19:23:10 $ $Name: not supported by cvs2svn $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
/*
|
||||
@ -282,6 +282,25 @@ nssToken_LoadCerts(NSSToken *token)
|
||||
return nssrv;
|
||||
}
|
||||
|
||||
NSS_IMPLEMENT void
|
||||
nssToken_UpdateTrustForCerts(NSSToken *token)
|
||||
{
|
||||
nssListIterator *certs;
|
||||
NSSCertificate *cert;
|
||||
certs = nssList_CreateIterator(token->certList);
|
||||
for (cert = (NSSCertificate *)nssListIterator_Start(certs);
|
||||
cert != (NSSCertificate *)NULL;
|
||||
cert = (NSSCertificate *)nssListIterator_Next(certs))
|
||||
{
|
||||
CERTCertificate *cc = STAN_GetCERTCertificate(cert);
|
||||
cc->trust = NULL;
|
||||
/* force an update of the trust fields of the CERTCertificate */
|
||||
(void)stan_GetCERTCertificate(cert, PR_FALSE);
|
||||
}
|
||||
nssListIterator_Finish(certs);
|
||||
nssListIterator_Destroy(certs);
|
||||
}
|
||||
|
||||
NSS_IMPLEMENT PRBool
|
||||
nssToken_SearchCerts
|
||||
(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user