Skip to content

Commit

Permalink
Remove ChromeOS TPM slot unlock hacks that are unnecessary with chaps.
Browse files Browse the repository at this point in the history
BUG=125848

Review URL: https://codereview.chromium.org/76693005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236418 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mattm@chromium.org committed Nov 21, 2013
1 parent 64bbe7b commit 6dd1e16
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
18 changes: 0 additions & 18 deletions chrome/browser/ui/crypto_module_password_dialog_nss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
#include "net/base/crypto_module.h"
#include "net/cert/x509_certificate.h"

#if defined(OS_CHROMEOS)
#include "crypto/nss_util.h"
#endif

using content::BrowserThread;

namespace {
Expand Down Expand Up @@ -72,20 +68,6 @@ void SlotUnlocker::Start() {

for (; current_ < modules_.size(); ++current_) {
if (ShouldShowDialog(modules_[current_].get())) {
#if defined(OS_CHROMEOS)
if (crypto::IsTPMTokenReady()) {
std::string token_name;
std::string user_pin;
crypto::GetTPMTokenInfo(&token_name, &user_pin);
if (modules_[current_]->GetTokenName() == token_name) {
// The user PIN is a well known secret on this machine, and
// the user didn't set it, so we need to fetch the value and
// supply it for them here.
GotPassword(user_pin.c_str());
return;
}
}
#endif
ShowCryptoModulePasswordDialog(
modules_[current_]->GetTokenName(),
retry_,
Expand Down
19 changes: 1 addition & 18 deletions crypto/nss_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ base::FilePath GetInitialConfigDirectory() {
// This callback for NSS forwards all requests to a caller-specified
// CryptoModuleBlockingPasswordDelegate object.
char* PKCS11PasswordFunc(PK11SlotInfo* slot, PRBool retry, void* arg) {
#if defined(OS_CHROMEOS)
// If we get asked for a password for the TPM, then return the
// well known password we use, as long as the TPM slot has been
// initialized.
if (crypto::IsTPMTokenReady()) {
std::string token_name;
std::string user_pin;
crypto::GetTPMTokenInfo(&token_name, &user_pin);
if (PK11_GetTokenName(slot) == token_name)
return PORT_Strdup(user_pin.c_str());
}
#endif
crypto::CryptoModuleBlockingPasswordDelegate* delegate =
reinterpret_cast<crypto::CryptoModuleBlockingPasswordDelegate*>(arg);
if (delegate) {
Expand Down Expand Up @@ -289,12 +277,7 @@ class NSSInitSingleton {
}

void GetTPMTokenInfo(std::string* token_name, std::string* user_pin) {
// TODO(mattm): Change to DCHECK when callers have been fixed.
if (!thread_checker_.CalledOnValidThread()) {
DVLOG(1) << "Called on wrong thread.\n"
<< base::debug::StackTrace().ToString();
}

DCHECK(thread_checker_.CalledOnValidThread());
if (!tpm_token_enabled_for_nss_) {
LOG(ERROR) << "GetTPMTokenInfo called before TPM Token is ready.";
return;
Expand Down

0 comments on commit 6dd1e16

Please sign in to comment.