OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/cros/cert_library.h" | 5 #include "chrome/browser/chromeos/cros/cert_library.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/observer_list_threadsafe.h" | 9 #include "base/observer_list_threadsafe.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/browser_process.h" // g_browser_process | 11 #include "chrome/browser/browser_process.h" // g_browser_process |
12 #include "chrome/browser/chromeos/login/user_manager.h" | 12 #include "chrome/browser/chromeos/login/user_manager.h" |
13 #include "chrome/common/net/x509_certificate_model.h" | 13 #include "chrome/common/net/x509_certificate_model.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "crypto/nss_util.h" | 15 #include "crypto/nss_util.h" |
16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
17 #include "net/base/cert_database.h" | 17 #include "net/base/cert_database.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 #include "ui/base/l10n/l10n_util_collator.h" | 19 #include "ui/base/l10n/l10n_util_collator.h" |
20 #include "unicode/coll.h" // icu::Collator | 20 #include "unicode/coll.h" // icu::Collator |
21 | 21 |
| 22 using content::BrowserThread; |
| 23 |
22 ////////////////////////////////////////////////////////////////////////////// | 24 ////////////////////////////////////////////////////////////////////////////// |
23 | 25 |
24 namespace { | 26 namespace { |
25 | 27 |
26 // Root CA certificates that are built into Chrome use this token name. | 28 // Root CA certificates that are built into Chrome use this token name. |
27 const char kRootCertificateTokenName[] = "Builtin Object Token"; | 29 const char kRootCertificateTokenName[] = "Builtin Object Token"; |
28 | 30 |
29 // Delay between certificate requests while waiting for TPM/PKCS#11 init. | 31 // Delay between certificate requests while waiting for TPM/PKCS#11 init. |
30 const int kRequestDelayMs = 500; | 32 const int kRequestDelayMs = 500; |
31 | 33 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 net::X509Certificate* cert = GetCertificateAt(index); | 403 net::X509Certificate* cert = GetCertificateAt(index); |
402 net::X509Certificate::OSCertHandle cert_handle = cert->os_cert_handle(); | 404 net::X509Certificate::OSCertHandle cert_handle = cert->os_cert_handle(); |
403 std::string id = x509_certificate_model::GetPkcs11Id(cert_handle); | 405 std::string id = x509_certificate_model::GetPkcs11Id(cert_handle); |
404 if (id == pkcs11_id) | 406 if (id == pkcs11_id) |
405 return index; | 407 return index; |
406 } | 408 } |
407 return -1; // Not found. | 409 return -1; // Not found. |
408 } | 410 } |
409 | 411 |
410 } // chromeos | 412 } // chromeos |
OLD | NEW |