summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-23 21:52:07 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-23 21:52:07 +0000
commitf55d1b018c96331e10a3a9451ae2ac45015ec048 (patch)
tree6d668efd9a0cb35d3fe523c65d48eb79ecc1bbb6 /crypto
parent39e9012038fd85d410f5bd203ccf7e7c2647128b (diff)
downloadchromium_src-f55d1b018c96331e10a3a9451ae2ac45015ec048.zip
chromium_src-f55d1b018c96331e10a3a9451ae2ac45015ec048.tar.gz
chromium_src-f55d1b018c96331e10a3a9451ae2ac45015ec048.tar.bz2
Fixed slot selection in HMAC class to ensure that we are using softtoken instead of TPM slots.
BUG=chromium-os:21633 TEST=make sure that user signin works properly on Alex - we should not show Gaia signin screen on second login after system resote Review URL: http://codereview.chromium.org/8373022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto')
-rw-r--r--crypto/hmac_nss.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/hmac_nss.cc b/crypto/hmac_nss.cc
index 81b2e39..cf202e5 100644
--- a/crypto/hmac_nss.cc
+++ b/crypto/hmac_nss.cc
@@ -48,7 +48,7 @@ bool HMAC::Init(const unsigned char *key, int key_length) {
return false;
}
- plat_->slot_.reset(PK11_GetBestSlot(plat_->mechanism_, NULL));
+ plat_->slot_.reset(PK11_GetInternalSlot());
if (!plat_->slot_.get()) {
NOTREACHED();
return false;
@@ -100,6 +100,9 @@ bool HMAC::Sign(const base::StringPiece& data,
if (PK11_DigestOp(context.get(),
reinterpret_cast<const unsigned char*>(data.data()),
data.length()) != SECSuccess) {
+ LOG(WARNING) << "PK11_DigestOp failed, error " << PORT_GetError()
+ << ", slot name " << PK11_GetSlotName(plat_->slot_.get())
+ << ", token name " << PK11_GetTokenName(plat_->slot_.get());
NOTREACHED();
return false;
}