From b17bc3666e113665c90fe6eb9dc0047460f52b37 Mon Sep 17 00:00:00 2001 From: "pneubeck@chromium.org" Date: Mon, 12 Aug 2013 14:09:19 +0000 Subject: Make CryptohomeClientImplStub and ScopedTestNSSDB use the same TokenName. This allows for tests which rely on CertLoader::IsHardwareBacked returning true. BUG=NONE R=agl@chromium.org, stevenjb@chromium.org Review URL: https://codereview.chromium.org/22407013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216991 0039d316-1c4b-4281-b951-d872f2087c98 --- crypto/nss_util.cc | 4 +++- crypto/nss_util.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'crypto') diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc index 069d5b6..27541ca 100644 --- a/crypto/nss_util.cc +++ b/crypto/nss_util.cc @@ -313,7 +313,7 @@ class NSSInitSingleton { return true; if (!g_test_nss_db_dir.Get().CreateUniqueTempDir()) return false; - test_slot_ = OpenUserDB(g_test_nss_db_dir.Get().path(), "Test DB"); + test_slot_ = OpenUserDB(g_test_nss_db_dir.Get().path(), kTestTPMTokenName); return !!test_slot_; } @@ -594,6 +594,8 @@ base::LazyInstance::Leaky g_nss_singleton = LAZY_INSTANCE_INITIALIZER; } // namespace +const char kTestTPMTokenName[] = "Test DB"; + #if defined(USE_NSS) void EarlySetupForNSSInit() { base::FilePath database_dir = GetInitialConfigDirectory(); diff --git a/crypto/nss_util.h b/crypto/nss_util.h index 77a9649..1d7503d 100644 --- a/crypto/nss_util.h +++ b/crypto/nss_util.h @@ -20,6 +20,9 @@ class Time; // initialization functions. namespace crypto { +// The TPMToken name used for the NSS slot opened by ScopedTestNSSDB. +CRYPTO_EXPORT extern const char kTestTPMTokenName[]; + #if defined(USE_NSS) // EarlySetupForNSSInit performs lightweight setup which must occur before the // process goes multithreaded. This does not initialise NSS. For test, see -- cgit v1.1