Skip to content

fix: fix cookie encryption provider loading on Windows and Linux - #49371

Merged
VerteDinde merged 2 commits into
mainfrom
cookie-encrypt-win-linux
Jan 13, 2026
Merged

VerteDinde merged 2 commits into
mainfrom
cookie-encrypt-win-linux

Conversation

@VerteDinde

Copy link
Copy Markdown
Member

Description of Change

Fast follow to #49348.

This PR modifies our existing cookie encryption logic to match an upstream change here: "Port net::CookieCryptoDelegate to os_crypt async" | https://chromium-review.googlesource.com/c/chromium/src/+/6996667 However, the previous PR only fixed the issue properly for MacOS. This PR provides the appropriate platform fixes for both Windows and Linux key providers.

We should try to land this fix before the 40.0.0 stable cut, as missing it breaks applications using cookie encryption.

Checklist

Release Notes

Notes: Fixed an issue on Windows and Linux where no cookie encryption key provider was passed into the network service when cookie encryption was enabled.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jan 12, 2026
@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases target/40-x-y PR should also be added to the "40-x-y" branch. labels Jan 12, 2026
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Jan 12, 2026
@VerteDinde
VerteDinde marked this pull request as ready for review January 12, 2026 20:06
Comment thread shell/browser/browser_process_impl.cc Resolved
@VerteDinde
VerteDinde force-pushed the cookie-encrypt-win-linux branch from 76eac79 to 3f9d4b8 Compare January 12, 2026 22:33

@clavin clavin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This provides a subset of Chromium's initialization providers. (Curious to know more about the ones we didn't include.) 👍

@VerteDinde
VerteDinde merged commit 0e4ee9f into main Jan 13, 2026
@VerteDinde
VerteDinde deleted the cookie-encrypt-win-linux branch January 13, 2026 03:39
@release-clerk

release-clerk Bot commented Jan 13, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue on Windows and Linux where no cookie encryption key provider was passed into the network service when cookie encryption was enabled.

@trop

trop Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "40-x-y", please check out #49375

@trop trop Bot added in-flight/40-x-y merged/40-x-y PR was merged to the "40-x-y" branch. and removed target/40-x-y PR should also be added to the "40-x-y" branch. in-flight/40-x-y labels Jan 13, 2026
providers.emplace_back(
/*precedence=*/10u,
std::make_unique<os_crypt_async::FreedesktopSecretKeyProvider>(
password_store, "Electron", nullptr));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VerteDinde Wouldn't this cause an issue, multiple apps sharing same product name, wallet folder https://source.chromium.org/chromium/chromium/src/+/main:components/os_crypt/async/browser/freedesktop_secret_key_provider.h;l=179-183 ? We should mimic the equivalent of sync path https://github.com/electron/electron/blob/main/shell/browser/electron_browser_main_parts.cc#L499-L543 in the async path as well,

An upstream friendly way would be they provide a config class that we can adjust on initialization with the product_name, wallet folder etc

VerteDinde added a commit that referenced this pull request Jan 13, 2026
codebytere pushed a commit that referenced this pull request Jan 14, 2026
* Revert "fix: provide explicit cookie encryption provider for cookie encryption (#49348)"

This reverts commit 95f097a.

* Revert "fix: fix cookie encryption provider loading on Windows and Linux (#49371)"

This reverts commit 0e4ee9f.

* revert: 6996667: Reland "Port net::CookieCryptoDelegate to os_crypt async" | https://chromium-review.googlesource.com/c/chromium/src/+/6996667
trop Bot added a commit that referenced this pull request Jan 14, 2026
codebytere pushed a commit that referenced this pull request Jan 14, 2026
* Revert "fix: provide explicit cookie encryption provider for cookie encryption (#49348)"

This reverts commit 95f097a.

Co-authored-by: Keeley Hammond <[email protected]>

* Revert "fix: fix cookie encryption provider loading on Windows and Linux (#49371)"

This reverts commit 0e4ee9f.

Co-authored-by: Keeley Hammond <[email protected]>

* revert: 6996667: Reland "Port net::CookieCryptoDelegate to os_crypt async" | https://chromium-review.googlesource.com/c/chromium/src/+/6996667

Co-authored-by: Keeley Hammond <[email protected]>

* chore: update patch for 40-x-y

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <[email protected]>
Co-authored-by: John Kleinschmidt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases merged/40-x-y PR was merged to the "40-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants