| 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 <cert.h> | 5 #include <cert.h> |
| 6 #include <pk11pub.h> | 6 #include <pk11pub.h> |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/scoped_temp_dir.h" | 16 #include "base/scoped_temp_dir.h" |
| 17 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 18 #include "chrome/browser/chromeos/cros/network_library.h" | 18 #include "chrome/browser/chromeos/cros/network_library.h" |
| 19 #include "chrome/browser/chromeos/cros/onc_network_parser.h" | 19 #include "chrome/browser/chromeos/cros/onc_network_parser.h" |
| 20 #include "chrome/common/chrome_paths.h" | 20 #include "chrome/common/chrome_paths.h" |
| 21 #include "crypto/nss_util.h" | 21 #include "crypto/nss_util.h" |
| 22 #include "net/base/cert_database.h" | |
| 23 #include "net/base/crypto_module.h" | 22 #include "net/base/crypto_module.h" |
| 23 #include "net/base/nss_cert_database.h" |
| 24 #include "net/base/x509_certificate.h" | 24 #include "net/base/x509_certificate.h" |
| 25 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 27 |
| 28 using ::testing::Return; | 28 using ::testing::Return; |
| 29 | 29 |
| 30 namespace chromeos { | 30 namespace chromeos { |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 bool CleanupSlotContents(PK11SlotInfo* slot) { | 199 bool CleanupSlotContents(PK11SlotInfo* slot) { |
| 200 bool ok = true; | 200 bool ok = true; |
| 201 net::CertificateList certs = ListCertsInSlot(slot); | 201 net::CertificateList certs = ListCertsInSlot(slot); |
| 202 for (size_t i = 0; i < certs.size(); ++i) { | 202 for (size_t i = 0; i < certs.size(); ++i) { |
| 203 if (!cert_db_.DeleteCertAndKey(certs[i])) | 203 if (!cert_db_.DeleteCertAndKey(certs[i])) |
| 204 ok = false; | 204 ok = false; |
| 205 } | 205 } |
| 206 return ok; | 206 return ok; |
| 207 } | 207 } |
| 208 | 208 |
| 209 net::CertDatabase cert_db_; | 209 net::NSSCertDatabase cert_db_; |
| 210 scoped_refptr<net::CryptoModule> slot_; | 210 scoped_refptr<net::CryptoModule> slot_; |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 // Default stub state: | 213 // Default stub state: |
| 214 // vpn1: disconnected, L2TP/IPsec + PSK | 214 // vpn1: disconnected, L2TP/IPsec + PSK |
| 215 // vpn2: disconnected, L2TP/IPsec + user cert | 215 // vpn2: disconnected, L2TP/IPsec + user cert |
| 216 // vpn3: disconnected, OpenVpn | 216 // vpn3: disconnected, OpenVpn |
| 217 // eth1: connected (active network) | 217 // eth1: connected (active network) |
| 218 // wifi1: connected | 218 // wifi1: connected |
| 219 // wifi2: disconnected | 219 // wifi2: disconnected |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 371 |
| 372 // TODO(stevenjb): Test network profiles. | 372 // TODO(stevenjb): Test network profiles. |
| 373 | 373 |
| 374 // TODO(stevenjb): Test network devices. | 374 // TODO(stevenjb): Test network devices. |
| 375 | 375 |
| 376 // TODO(stevenjb): Test data plans. | 376 // TODO(stevenjb): Test data plans. |
| 377 | 377 |
| 378 // TODO(stevenjb): Test monitor network / device. | 378 // TODO(stevenjb): Test monitor network / device. |
| 379 | 379 |
| 380 } // namespace chromeos | 380 } // namespace chromeos |
| OLD | NEW |