Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(994)

Unified Diff: crypto/hmac_nss.cc

Issue 8373022: Fixed slot selection in HMAC class to ensure that we are using softtoken instead of TPM slots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/hmac_nss.cc
===================================================================
--- crypto/hmac_nss.cc (revision 106500)
+++ crypto/hmac_nss.cc (working copy)
@@ -12,6 +12,10 @@
#include "crypto/nss_util.h"
#include "crypto/scoped_nss_types.h"
+#if defined(OS_CHROMEOS)
+#include "crypto/nss_util_internal.h"
+#endif
+
namespace crypto {
struct HMACPlatformData {
@@ -48,7 +52,15 @@
return false;
}
+#if defined(OS_CHROMEOS)
+ // TODO(zelidrag): http://crosbug.com/21633
+ // For yet unknown reasons, on ChromeOS PK11_GetBestSlot is matching slot from
+ // TPM here on a fresh machine when an account is just created. Need to
+ // investigate what is the underlying cause of this transient behavior.
+ plat_->slot_.reset(GetPublicNSSKeySlot());
+#else
plat_->slot_.reset(PK11_GetBestSlot(plat_->mechanism_, NULL));
wtc 2011/10/22 22:58:23 Please try plat_->slot_.reset(PK11_GetInternal
+#endif
if (!plat_->slot_.get()) {
NOTREACHED();
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698