OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/certificate_manager_model.h" | 5 #include "chrome/browser/certificate_manager_model.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/ui/crypto_module_password_dialog.h" | 11 #include "chrome/browser/ui/crypto_module_password_dialog_nss.h" |
12 #include "chrome/common/net/x509_certificate_model.h" | 12 #include "chrome/common/net/x509_certificate_model.h" |
13 #include "net/base/crypto_module.h" | 13 #include "net/base/crypto_module.h" |
14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
15 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
16 | 16 |
17 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) |
18 #include <cert.h> | 18 #include <cert.h> |
19 | 19 |
20 #include "crypto/nss_util.h" | 20 #include "crypto/nss_util.h" |
21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 bool CertificateManagerModel::IsHardwareBacked( | 158 bool CertificateManagerModel::IsHardwareBacked( |
159 const net::X509Certificate* cert) const { | 159 const net::X509Certificate* cert) const { |
160 #if defined(OS_CHROMEOS) | 160 #if defined(OS_CHROMEOS) |
161 return crypto::IsTPMTokenReady() && | 161 return crypto::IsTPMTokenReady() && |
162 cert->os_cert_handle()->slot == | 162 cert->os_cert_handle()->slot == |
163 cert_db_->GetPrivateModule()->os_module_handle(); | 163 cert_db_->GetPrivateModule()->os_module_handle(); |
164 #else | 164 #else |
165 return false; | 165 return false; |
166 #endif | 166 #endif |
167 } | 167 } |
OLD | NEW |