New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: crash in safeStorage
on Linux
#34263
Merged
codebytere
merged 4 commits into
electron:15-x-y
from
RaisinTen:15-bp-safeStorage-linux-crash
May 19, 2022
Merged
fix: crash in safeStorage
on Linux
#34263
codebytere
merged 4 commits into
electron:15-x-y
from
RaisinTen:15-bp-safeStorage-linux-crash
May 19, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On Linux, `isEncryptionAvailable()` was crashing instead of returning a boolean before the 'ready' event was emitted by the app. The reason of the crash is that [`CreateKeyStorage()`](https://source.chromium.org/chromium/chromium/src/+/main:components/os_crypt/os_crypt_linux.cc;l=74;drc=35be6215ec8f09e50176f36753c68f26c63d1885;bpv=1;bpt=0) expects the config to be set but the function responsible for setting the config, [`SetConfig()`](https://source.chromium.org/chromium/chromium/src/+/main:components/os_crypt/os_crypt_linux.cc;l=237;drc=35be6215ec8f09e50176f36753c68f26c63d1885;bpv=1;bpt=0), is called only after the app is ready inside [`PostCreateMainMessageLoop()`](https://github.com/electron/electron/blob/main/shell/browser/electron_browser_main_parts.cc#L499). So this changes `IsEncryptionAvailable()` to return `false` when the app is not ready on Linux and uses that instead of the raw API in other places like `EncryptString()` and `DecryptString()`. Fixes: electron#32206 Signed-off-by: Darshan Sen <raisinten@gmail.com>
5 tasks
trop
bot
added
15-x-y
backport
This is a backport PR
semver/patch
backwards-compatible bug fixes
labels
May 17, 2022
Signed-off-by: Darshan Sen <raisinten@gmail.com>
jkleinsc
previously requested changes
May 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newly added tests are failing.
This backports electron@0e09738. Signed-off-by: Darshan Sen <raisinten@gmail.com>
network::mojom::NetworkService::SetEncryptionKey() is only available on Windows and macOS. Signed-off-by: Darshan Sen <raisinten@gmail.com>
@jkleinsc the newly added tests are passing now. |
codebytere
changed the title
fix: fix a crash in
fix: crash in May 18, 2022
safeStorage
on LinuxsafeStorage
on Linux
codebytere
approved these changes
May 18, 2022
No Release Notes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #33913.
See that PR for details.
Notes: none.