[M126 Migration] Set crypt config for EFL 27/317127/2
authorChandan Padhi <c.padhi@samsung.com>
Thu, 6 Jun 2024 12:49:29 +0000 (18:19 +0530)
committerChandan Padhi <c.padhi@samsung.com>
Wed, 4 Sep 2024 08:30:41 +0000 (14:00 +0530)
Crypt config was not set that resulted in browser crash due to a
CHECK failure in OSCryptImpl::CreateKeyStorage.

This crash was reproduced while verifying signin on passkey demo
at https://passkeys-demo.appspot.com/.

Reference: https://review.tizen.org/gerrit/312319/

Change-Id: I7d44b8b30537b2d668fae013e40b9834785128f1
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
(cherry picked from commit 3c0c4ab3ea5d8c148078368fe7bfb66a7a485b3d)

tizen_src/ewk/efl_integration/browser_main_parts_efl.cc
tizen_src/ewk/efl_integration/browser_main_parts_efl.h

index 892d028b8518f2bd0f86794a267021ac35dcbcc3..a95b6673f0cd9fdaf653742551eaf680bf63f7a6 100644 (file)
@@ -9,6 +9,8 @@
 
 #include "base/base_switches.h"
 #include "base/command_line.h"
+#include "components/os_crypt/sync/key_storage_config_linux.h"
+#include "components/os_crypt/sync/os_crypt.h"
 #include "content/browser/inspector/devtools_util_manager.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/result_codes.h"
@@ -36,4 +38,13 @@ void BrowserMainPartsEfl::PostMainMessageLoopRun() {
   DevToolsUtilManager::GetInstance()->InspectorServerStop();
 }
 
+void BrowserMainPartsEfl::PostCreateMainMessageLoop() {
+  std::unique_ptr<os_crypt::Config> config =
+      std::make_unique<os_crypt::Config>();
+  config->product_name = "ChromiumEFL";
+  config->should_use_preference = false;
+  config->user_data_path = base::FilePath();
+  OSCrypt::SetConfig(std::move(config));
+}
+
 }  // namespace
index a6206fc48ba155e46363fbe51e6b18efc90db8bb..30d807ba8b02464416575f8035910be2a6379877 100644 (file)
@@ -26,6 +26,7 @@ class BrowserMainPartsEfl : public BrowserMainParts {
   // BrowserMainParts overrides.
   int PreMainMessageLoopRun() override;
   void PostMainMessageLoopRun() override;
+  void PostCreateMainMessageLoop() override;
 
  private:
   DevToolsDelegateEfl* devtools_delegate_;