|
@@ -311,46 +311,14 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(
|
|
|
KeychainPassword::GetServiceName() = app_name + " Safe Storage";
|
|
|
KeychainPassword::GetAccountName() = app_name;
|
|
|
#endif
|
|
|
-#if defined(OS_LINUX)
|
|
|
- // c.f.
|
|
|
- // https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/net/system_network_context_manager.cc;l=515;drc=9d82515060b9b75fa941986f5db7390299669ef1;bpv=1;bpt=1
|
|
|
- const base::CommandLine& command_line =
|
|
|
- *base::CommandLine::ForCurrentProcess();
|
|
|
-
|
|
|
- auto config = std::make_unique<os_crypt::Config>();
|
|
|
- config->store = command_line.GetSwitchValueASCII(::switches::kPasswordStore);
|
|
|
- config->product_name = app_name;
|
|
|
- config->application_name = app_name;
|
|
|
- config->main_thread_runner = base::ThreadTaskRunnerHandle::Get();
|
|
|
- // c.f.
|
|
|
- // https://source.chromium.org/chromium/chromium/src/+/master:chrome/common/chrome_switches.cc;l=689;drc=9d82515060b9b75fa941986f5db7390299669ef1
|
|
|
- config->should_use_preference =
|
|
|
- command_line.HasSwitch(::switches::kEnableEncryptionSelection);
|
|
|
- base::PathService::Get(chrome::DIR_USER_DATA, &config->user_data_path);
|
|
|
-#endif
|
|
|
|
|
|
+#if defined(OS_WIN) || defined(OS_MAC)
|
|
|
// The OSCrypt keys are process bound, so if network service is out of
|
|
|
// process, send it the required key.
|
|
|
if (content::IsOutOfProcessNetworkService() &&
|
|
|
electron::fuses::IsCookieEncryptionEnabled()) {
|
|
|
-#if defined(OS_LINUX)
|
|
|
- network::mojom::CryptConfigPtr network_crypt_config =
|
|
|
- network::mojom::CryptConfig::New();
|
|
|
- network_crypt_config->application_name = config->application_name;
|
|
|
- network_crypt_config->product_name = config->product_name;
|
|
|
- network_crypt_config->store = config->store;
|
|
|
- network_crypt_config->should_use_preference = config->should_use_preference;
|
|
|
- network_crypt_config->user_data_path = config->user_data_path;
|
|
|
-
|
|
|
- network_service->SetCryptConfig(std::move(network_crypt_config));
|
|
|
-
|
|
|
-#else
|
|
|
network_service->SetEncryptionKey(OSCrypt::GetRawEncryptionKey());
|
|
|
-#endif
|
|
|
}
|
|
|
-
|
|
|
-#if defined(OS_LINUX)
|
|
|
- OSCrypt::SetConfig(std::move(config));
|
|
|
#endif
|
|
|
|
|
|
#if DCHECK_IS_ON()
|