Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: mozilla/security/nss/lib/pk11wrap/pk11auth.c

Issue 10961060: Update NSS to NSS 3.14 Beta 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Add the NSS snapshot timestamp to README.chromium and nss-checkout.sh Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mozilla/security/nss/lib/nss/nssinit.c ('k') | mozilla/security/nss/lib/pk11wrap/pk11cert.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mozilla/security/nss/lib/pk11wrap/pk11auth.c
===================================================================
--- mozilla/security/nss/lib/pk11wrap/pk11auth.c (revision 158129)
+++ mozilla/security/nss/lib/pk11wrap/pk11auth.c (working copy)
@@ -46,7 +46,7 @@
* succeed if the user is already logged in.
*/
SECStatus
-pk11_CheckPassword(PK11SlotInfo *slot,char *pw)
+pk11_CheckPassword(PK11SlotInfo *slot,char *pw,PRBool contextSpecific)
{
int len = 0;
CK_RV crv;
@@ -67,7 +67,8 @@
do {
PK11_EnterSlotMonitor(slot);
- crv = PK11_GETTAB(slot)->C_Login(slot->session,CKU_USER,
+ crv = PK11_GETTAB(slot)->C_Login(slot->session,
+ contextSpecific ? CKU_CONTEXT_SPECIFIC : CKU_USER,
(unsigned char *)pw,len);
slot->lastLoginCheck = 0;
mustRetry = PR_FALSE;
@@ -75,6 +76,7 @@
switch (crv) {
/* if we're already logged in, we're good to go */
case CKR_OK:
+ /* TODO If it was for CKU_CONTEXT_SPECIFIC should we do this */
slot->authTransact = PK11_Global.transaction;
/* Fall through */
case CKR_USER_ALREADY_LOGGED_IN:
@@ -240,7 +242,7 @@
NeedAuth = PR_TRUE;
}
}
- if (NeedAuth) PK11_DoPassword(slot,PR_TRUE,wincx);
+ if (NeedAuth) PK11_DoPassword(slot,PR_TRUE,wincx,PR_FALSE);
}
void
@@ -299,7 +301,7 @@
SECStatus
PK11_Authenticate(PK11SlotInfo *slot, PRBool loadCerts, void *wincx) {
if (pk11_LoginStillRequired(slot,wincx)) {
- return PK11_DoPassword(slot,loadCerts,wincx);
+ return PK11_DoPassword(slot,loadCerts,wincx,PR_FALSE);
}
return SECSuccess;
}
@@ -530,7 +532,8 @@
* of the PKCS 11 module.
*/
SECStatus
-PK11_DoPassword(PK11SlotInfo *slot, PRBool loadCerts, void *wincx)
+PK11_DoPassword(PK11SlotInfo *slot, PRBool loadCerts, void *wincx,
+ PRBool contextSpecific)
{
SECStatus rv = SECFailure;
char * password;
@@ -599,7 +602,7 @@
break;
}
}
- rv = pk11_CheckPassword(slot,password);
+ rv = pk11_CheckPassword(slot,password,contextSpecific);
PORT_Memset(password, 0, PORT_Strlen(password));
PORT_Free(password);
if (rv != SECWouldBlock) break;
« no previous file with comments | « mozilla/security/nss/lib/nss/nssinit.c ('k') | mozilla/security/nss/lib/pk11wrap/pk11cert.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698