Chromium Code Reviews| Index: crypto/nss_util.cc |
| diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc |
| index ea4b59c009c002cc5f95dd4170ef595de19b7c72..676ef8da727981183032934344a7ae49d22af3c9 100644 |
| --- a/crypto/nss_util.cc |
| +++ b/crypto/nss_util.cc |
| @@ -57,7 +57,7 @@ namespace crypto { |
| namespace { |
| #if defined(OS_CHROMEOS) |
| -const char kNSSDatabaseName[] = "Real NSS database"; |
| +const char kNSSDatabaseName[] = "Real NSS db"; |
|
pneubeck (no reviews)
2014/07/16 10:08:25
I reduced the length of this string because the ni
Ryan Sleevi
2014/07/16 19:32:18
pedantry: db -> DB
Nicknames have a fixed length.
pneubeck (no reviews)
2014/07/17 13:26:43
shortened the name further and change it to indica
|
| // Constants for loading the Chrome OS TPM-backed PKCS #11 library. |
| const char kChapsModuleName[] = "Chaps"; |
| @@ -287,7 +287,8 @@ class NSSInitSingleton { |
| PK11SlotInfo* tpm_slot; |
| }; |
| - PK11SlotInfo* OpenPersistentNSSDBForPath(const base::FilePath& path) { |
| + PK11SlotInfo* OpenPersistentNSSDBForPath(const std::string& db_name, |
| + const base::FilePath& path) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| // NSS is allowed to do IO on the current thread since dispatching |
| // to a dedicated thread would still have the affect of blocking |
| @@ -299,7 +300,7 @@ class NSSInitSingleton { |
| LOG(ERROR) << "Failed to create " << nssdb_path.value() << " directory."; |
| return NULL; |
| } |
| - return OpenUserDB(nssdb_path, kNSSDatabaseName); |
| + return OpenUserDB(nssdb_path, db_name); |
| } |
| void EnableTPMTokenForNSS() { |
| @@ -469,7 +470,9 @@ class NSSInitSingleton { |
| return false; |
| DVLOG(2) << "Opening NSS DB " << path.value(); |
| - ScopedPK11Slot public_slot(OpenPersistentNSSDBForPath(path)); |
| + std::string db_name = |
| + std::string(kNSSDatabaseName) + " for " + username_hash; |
|
Ryan Sleevi
2014/07/16 21:41:40
base::StringPrintF, rather than string concatting?
pneubeck (no reviews)
2014/07/17 13:26:43
Done.
|
| + ScopedPK11Slot public_slot(OpenPersistentNSSDBForPath(db_name, path)); |
| chromeos_user_map_[username_hash] = |
| new ChromeOSUserData(public_slot.Pass()); |
| return true; |
| @@ -861,10 +864,10 @@ class NSSInitSingleton { |
| #endif |
| static PK11SlotInfo* OpenUserDB(const base::FilePath& path, |
| - const char* description) { |
| + const std::string& description) { |
| const std::string modspec = |
| base::StringPrintf("configDir='sql:%s' tokenDescription='%s'", |
| - path.value().c_str(), description); |
| + path.value().c_str(), description.c_str()); |
| PK11SlotInfo* db_slot = SECMOD_OpenUserDB(modspec.c_str()); |
| if (db_slot) { |
| if (PK11_NeedUserInit(db_slot)) |