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

Unified Diff: base/nss_util.cc

Issue 3186021: DONOTLAND: Start of PK11 password dialog for Linux/NSS (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Start of hooking up the hang monitor, probably requires WebKit changes Created 10 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 | « no previous file | base/nss_util_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nss_util.cc
diff --git a/base/nss_util.cc b/base/nss_util.cc
index b14488103e861392ce6b6c212136380143550f76..a641f5dbb058196634fa5c05642745264cc39a1f 100644
--- a/base/nss_util.cc
+++ b/base/nss_util.cc
@@ -68,6 +68,17 @@ FilePath GetInitialConfigDirectory() {
#endif // defined(OS_CHROMEOS)
}
+// This callback for NSS forwards all requests to a caller-specified
+// PK11BlockingPasswordDelegate object.
+char* PK11PasswordFunc(PK11SlotInfo* slot, PRBool retry, void* arg) {
+ base::PK11BlockingPasswordDelegate* delegate =
+ reinterpret_cast<base::PK11BlockingPasswordDelegate*>(arg);
+ if (delegate)
+ return delegate->RequestPassword(slot, retry);
+ DLOG(ERROR) << "PK11 password requested with NULL arg";
+ return NULL;
+}
+
// NSS creates a local cache of the sqlite database if it detects that the
// filesystem the database is on is much slower than the local disk. The
// detection doesn't work with the latest versions of sqlite, such as 3.6.22
@@ -194,6 +205,8 @@ class NSSInitSingleton {
}
}
+ PK11_SetPasswordFunc(PK11PasswordFunc);
+
// If we haven't initialized the password for the NSS databases,
// initialize an empty-string password so that we don't need to
// log in.
« no previous file with comments | « no previous file | base/nss_util_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698