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

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

Issue 3536010: Update to NSS 3.12.8. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 2 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
Index: nss/mozilla/security/nss/lib/pk11wrap/pk11auth.c
===================================================================
--- nss/mozilla/security/nss/lib/pk11wrap/pk11auth.c (revision 61548)
+++ nss/mozilla/security/nss/lib/pk11wrap/pk11auth.c (working copy)
@@ -164,6 +164,21 @@
len = PORT_Strlen(pw);
}
+ /*
+ * If the token does't need a login, don't try to relogin beause the
+ * effect is undefined. It's not clear what it means to check a non-empty
+ * password with such a token, so treat that as an error.
+ */
+ if (!slot->needLogin) {
+ if (len == 0) {
+ rv = SECSuccess;
+ } else {
+ PORT_SetError(SEC_ERROR_BAD_PASSWORD);
+ rv = SECFailure;
+ }
+ return rv;
+ }
+
/* force a logout */
PK11_EnterSlotMonitor(slot);
PK11_GETTAB(slot)->C_Logout(slot->session);
« no previous file with comments | « nss/mozilla/security/nss/lib/pk11wrap/debug_module.c ('k') | nss/mozilla/security/nss/lib/softoken/pkcs11.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698