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). |
radical
left a comment
There was a problem hiding this comment.
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.
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.
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