summaryrefslogtreecommitdiffstats
path: root/base/nss_init.cc
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 18:48:29 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 18:48:29 +0000
commitf079defd1b007e8a91cb30c056611cc8d41f66af (patch)
tree8754f6d72667ba3858487cf386ceeb18dc156691 /base/nss_init.cc
parent76e815ed97bc8f44d80f44a13a0b8d26d4b414cd (diff)
downloadchromium_src-f079defd1b007e8a91cb30c056611cc8d41f66af.zip
chromium_src-f079defd1b007e8a91cb30c056611cc8d41f66af.tar.gz
chromium_src-f079defd1b007e8a91cb30c056611cc8d41f66af.tar.bz2
Initialize an empty password for NSS databases (so that the databases
won't require login) if the password hasn't been initialized yet. R=ukai BUG=http://crbug.com/13699 TEST=none Review URL: http://codereview.chromium.org/119381 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18185 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/nss_init.cc')
-rw-r--r--base/nss_init.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/nss_init.cc b/base/nss_init.cc
index 9f83898..e39a3a5 100644
--- a/base/nss_init.cc
+++ b/base/nss_init.cc
@@ -12,6 +12,7 @@
// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424
// until NSS 3.12.2 comes out and we update to it.
#define Lock FOO_NSS_Lock
+#include <pk11pub.h>
#include <secmod.h>
#include <ssl.h>
#undef Lock
@@ -78,6 +79,16 @@ class NSSInitSingleton {
NOTREACHED() << "Error initializing NSS: " << buffer;
}
+ // 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.
+ PK11SlotInfo* slot = PK11_GetInternalKeySlot();
+ if (slot) {
+ if (PK11_NeedUserInit(slot))
+ PK11_InitPin(slot, NULL, NULL);
+ PK11_FreeSlot(slot);
+ }
+
root_ = InitDefaultRootCerts();
NSS_SetDomesticPolicy();