| 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 "chromeos/network/client_cert_util.h" | 5 #include "chromeos/network/client_cert_util.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| 11 #include <list> | 11 #include <list> |
| 12 | 12 |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chromeos/network/network_event_log.h" | 16 #include "chromeos/network/network_event_log.h" |
| 17 #include "components/onc/onc_constants.h" | 17 #include "components/onc/onc_constants.h" |
| 18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 19 #include "net/cert/cert_database.h" | 19 #include "net/cert/cert_database.h" |
| 20 #include "net/cert/nss_cert_database.h" | 20 #include "net/cert/nss_cert_database.h" |
| 21 #include "net/cert/scoped_nss_types.h" | 21 #include "net/cert/scoped_nss_types.h" |
| 22 #include "net/cert/x509_cert_types.h" | 22 #include "net/cert/x509_cert_types.h" |
| 23 #include "net/cert/x509_certificate.h" | 23 #include "net/cert/x509_certificate.h" |
| 24 #include "third_party/cros_system_api/dbus/service_constants.h" | 24 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 25 | 25 |
| 26 namespace chromeos { | 26 namespace chromeos { |
| 27 | 27 |
| 28 namespace client_cert { | 28 namespace client_cert { |
| 29 | 29 |
| 30 const char kDefaultTPMPin[] = "111111"; |
| 31 |
| 30 namespace { | 32 namespace { |
| 31 | 33 |
| 32 const char kDefaultTPMPin[] = "111111"; | |
| 33 | |
| 34 std::string GetStringFromDictionary(const base::DictionaryValue& dict, | 34 std::string GetStringFromDictionary(const base::DictionaryValue& dict, |
| 35 const std::string& key) { | 35 const std::string& key) { |
| 36 std::string s; | 36 std::string s; |
| 37 dict.GetStringWithoutPathExpansion(key, &s); | 37 dict.GetStringWithoutPathExpansion(key, &s); |
| 38 return s; | 38 return s; |
| 39 } | 39 } |
| 40 | 40 |
| 41 void GetClientCertTypeAndPattern( | 41 void GetClientCertTypeAndPattern( |
| 42 onc::ONCSource onc_source, | 42 onc::ONCSource onc_source, |
| 43 const base::DictionaryValue& dict_with_client_cert, | 43 const base::DictionaryValue& dict_with_client_cert, |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 return !cert_id.empty() && !key_id.empty() && !identity.empty(); | 359 return !cert_id.empty() && !key_id.empty() && !identity.empty(); |
| 360 } | 360 } |
| 361 } | 361 } |
| 362 NOTREACHED(); | 362 NOTREACHED(); |
| 363 return false; | 363 return false; |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace client_cert | 366 } // namespace client_cert |
| 367 | 367 |
| 368 } // namespace chromeos | 368 } // namespace chromeos |
| OLD | NEW |