-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Better error handling in SubtleCrypto workers #71693
Conversation
Handle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack. Reset web worker when a request fails. Also, fix race conditions where the web worker can read its own response as part of the next request. Contributes to dotnet#69740
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones Issue DetailsHandle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack. Reset web worker when a request fails. Also, fix race conditions where the web worker can read its own response as part of the next request. Contributes to #69740
|
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsHandle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack. Reset web worker when a request fails. Also, fix race conditions where the web worker can read its own response as part of the next request. Contributes to #69740
|
Format the code Fix args bug in setup_proxy_console
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
We agreed, offline, to leave the debug messages as-is for now. LGTM 👍
...em.Security.Cryptography/src/System/Security/Cryptography/HMACHashProvider.Browser.Native.cs
Show resolved
Hide resolved
Generally seems OK; but I sort of skimmed the js parts. |
...m.Security.Cryptography/src/System/Security/Cryptography/AesSubtleCryptoTransform.Browser.cs
Outdated
Show resolved
Hide resolved
WasmBuildTests failures are unrelated, and can be ignored. |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
The wasm failures are unrelated to this PR. |
for (; ;) { | ||
const lock_state = Atomics.load(this.comm, this.LOCK_IDX); | ||
if (lock_state !== this.LOCK_UNLOCKED) | ||
continue; |
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.
This tight spin loop is unfortunate, but as this is all part of a large workaround for sync-over-async, I guess we have nothing better.
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.
Unfortunately, we don't 😞
Handle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack.
Reset web worker when a request fails.
Also, fix race conditions where the web worker can read its own response as part of the next request.
Contributes to #69740