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

Unified Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc

Issue 1139533002: Use FindNSSKeyFromPublicKeyInfoInSlot in GetPrivateKeyOnWorkerThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rsa-private-key-1
Patch Set: pneubeck comments Created 5 years, 7 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 | chrome/browser/chromeos/platform_keys/platform_keys_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc
diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc
index 46058c1692689a87c4506242e7ca86b40e8d6d02..ea8da2c12778b43386ee3535955a4741be1c3bad 100644
--- a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc
@@ -56,24 +56,21 @@ void GetSystemSlotOnIOThread(
}
// Checks if a private RSA key associated with |public_key| can be found in
-// |slot|.
+// |slot|. |slot| must be non-null.
// Must be called on a worker thread.
crypto::ScopedSECKEYPrivateKey GetPrivateKeyOnWorkerThread(
PK11SlotInfo* slot,
const std::string& public_key) {
+ DCHECK(slot);
xiyuan 2015/05/12 18:03:55 nit: This code only runs on real device. So let's
davidben 2015/05/12 18:05:28 Done. (It's redundant with CHECKs further up the c
const uint8* public_key_uint8 =
reinterpret_cast<const uint8*>(public_key.data());
std::vector<uint8> public_key_vector(
public_key_uint8, public_key_uint8 + public_key.size());
- // TODO(davidben): This should be equivalent to calling
- // FindNSSKeyFromPublicKeyInfoInSlot.
crypto::ScopedSECKEYPrivateKey rsa_key(
- crypto::FindNSSKeyFromPublicKeyInfo(public_key_vector));
- if (!rsa_key || rsa_key->pkcs11Slot != slot ||
- SECKEY_GetPrivateKeyType(rsa_key.get()) != rsaKey) {
+ crypto::FindNSSKeyFromPublicKeyInfoInSlot(public_key_vector, slot));
+ if (!rsa_key || SECKEY_GetPrivateKeyType(rsa_key.get()) != rsaKey)
return nullptr;
- }
return rsa_key.Pass();
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/platform_keys/platform_keys_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698