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

Unified Diff: chrome/browser/certificate_manager_model.cc

Issue 7111014: [ChromeOS] Add a "hardware-backed" suffix to tpm-backed cert. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/certificate_manager_model.cc
diff --git a/chrome/browser/certificate_manager_model.cc b/chrome/browser/certificate_manager_model.cc
index be4a21f34759e82e8d97b36547b38a0802b99827..8f5518ace0c0e0eb6ce7f2d95b9a8efffe467867 100644
--- a/chrome/browser/certificate_manager_model.cc
+++ b/chrome/browser/certificate_manager_model.cc
@@ -14,6 +14,15 @@
#include "net/base/net_errors.h"
#include "net/base/x509_certificate.h"
+#if defined(OS_CHROMEOS)
+#include <pk11pub.h>
+
+#include "crypto/nss_util.h"
+#include "grit/generated_resources.h"
+#include "net/base/x509_certificate.h"
+#include "ui/base/l10n/l10n_util.h"
+#endif
+
CertificateManagerModel::CertificateManagerModel(Observer* observer)
: observer_(observer) {
}
@@ -70,6 +79,23 @@ string16 CertificateManagerModel::GetColumnText(
case COL_SUBJECT_NAME:
rv = UTF8ToUTF16(
x509_certificate_model::GetCertNameOrNickname(cert.os_cert_handle()));
+
+#if defined(OS_CHROMEOS)
+ // TODO(xiyuan): Put this into a column when we have js tree-table.
+ if (crypto::IsTPMTokenReady()) {
+ std::string tpm_token_name;
+ std::string user_pin;
+ crypto::GetTPMTokenInfo(&tpm_token_name, &user_pin);
+
+ PK11SlotInfo* cert_slot = cert.os_cert_handle()->slot;
+ if (cert_slot && PK11_GetTokenName(cert_slot) == tpm_token_name) {
mattm 2011/06/04 02:00:32 If we want to do it by comparing the name, it coul
xiyuan 2011/06/06 17:17:17 This is what I want to hear. I'd like to compare h
+ rv = l10n_util::GetStringFUTF16(
+ IDS_CERT_MANAGER_HARDWARE_BACKED_KEY_FORMAT,
+ rv,
+ l10n_util::GetStringUTF16(IDS_CERT_MANAGER_HARDWARE_BACKED));
+ }
+ }
+#endif
break;
case COL_CERTIFICATE_STORE:
rv = UTF8ToUTF16(
« 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