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

Unified Diff: chromeos/cert_loader.cc

Issue 22588002: Refactor the client certificate code in chromeos/network/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 years, 4 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 | « chromeos/cert_loader.h ('k') | chromeos/chromeos.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/cert_loader.cc
diff --git a/chromeos/cert_loader.cc b/chromeos/cert_loader.cc
index 799815df549d163db6d99a48c79ce36d4c7b5c1a..964c777fbd588a1f1038bdd4874cc3371946d04e 100644
--- a/chromeos/cert_loader.cc
+++ b/chromeos/cert_loader.cc
@@ -110,7 +110,7 @@ void CertLoader::SetCryptoTaskRunner(
}
void CertLoader::SetSlowTaskRunnerForTest(
- const scoped_refptr<base::SequencedTaskRunner>& task_runner) {
+ const scoped_refptr<base::TaskRunner>& task_runner) {
slow_task_runner_for_test_ = task_runner;
}
@@ -238,6 +238,7 @@ void CertLoader::OnPersistentNSSDBOpened() {
InitializeTokenAndLoadCertificates();
}
+// This is copied from chrome/common/net/x509_certificate_model_nss.cc.
// For background see this discussion on dev-tech-crypto.lists.mozilla.org:
// http://web.archiveorange.com/archive/v/6JJW7E40sypfZGtbkzxX
//
@@ -245,11 +246,9 @@ void CertLoader::OnPersistentNSSDBOpened() {
// is shared between a certificate and its associated private and public
// keys. I tried to implement this with PK11_GetLowLevelKeyIDForCert(),
// but that always returns NULL on Chrome OS for me.
-std::string CertLoader::GetPkcs11IdForCert(
- const net::X509Certificate& cert) const {
- if (!IsHardwareBacked())
- return std::string();
+// static
+std::string CertLoader::GetPkcs11IdForCert(const net::X509Certificate& cert) {
CERTCertificateStr* cert_handle = cert.os_cert_handle();
SECKEYPrivateKey *priv_key =
PK11_FindKeyByAnyCert(cert_handle, NULL /* wincx */);
« no previous file with comments | « chromeos/cert_loader.h ('k') | chromeos/chromeos.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698