| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/utility/extensions/extensions_handler.h" | 5 #include "chrome/utility/extensions/extensions_handler.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "chrome/common/chrome_utility_messages.h" | 9 #include "chrome/common/chrome_utility_messages.h" |
| 10 #include "chrome/common/extensions/chrome_extensions_client.h" | 10 #include "chrome/common/extensions/chrome_extensions_client.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 scoped_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create()); | 271 scoped_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create()); |
| 272 wifi_service->Initialize(NULL); | 272 wifi_service->Initialize(NULL); |
| 273 | 273 |
| 274 std::string key_data; | 274 std::string key_data; |
| 275 std::string error; | 275 std::string error; |
| 276 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 276 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
| 277 | 277 |
| 278 std::vector<uint8> ciphertext; | 278 std::vector<uint8> ciphertext; |
| 279 bool success = error.empty() && !key_data.empty(); | 279 bool success = error.empty() && !key_data.empty(); |
| 280 if (success) { | 280 if (success) { |
| 281 NetworkingPrivateCrypto crypto; | 281 success = networking_private_crypto::EncryptByteString( |
| 282 success = crypto.EncryptByteString(public_key, key_data, &ciphertext); | 282 public_key, key_data, &ciphertext); |
| 283 } | 283 } |
| 284 | 284 |
| 285 Send(new ChromeUtilityHostMsg_GotEncryptedWiFiCredentials(ciphertext, | 285 Send(new ChromeUtilityHostMsg_GotEncryptedWiFiCredentials(ciphertext, |
| 286 success)); | 286 success)); |
| 287 } | 287 } |
| 288 #endif // defined(OS_WIN) | 288 #endif // defined(OS_WIN) |
| 289 | 289 |
| 290 } // namespace extensions | 290 } // namespace extensions |
| OLD | NEW |