-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Crypto support in wasi-wasm runtime #99126
Comments
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones Issue DetailsDescriptionCurrently, the Reproduction StepsCompile any program accessing any of the crypto functions (e.g. SHA1). When run an exception will be thrown:
Expected behaviorWhile no WASI Crypto API has been finalized and made available via Actual behaviorA Regression?No response Known WorkaroundsNo response Configuration
Other informationNo response
|
There's not a special runtime/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj Line 6 in 8688afa
Based on the message, I think it's just pulling in the RID-less build; since that looks like the output from |
It's not. We would need to treat |
We would also need to go and annotate all of our UnsupportedOSPlatforms that have browser with "wasi", I think. |
Correct, since wasi is still an experiemental platform we haven't annotated the apis for the analyzer yet. https://github.com/WebAssembly/WASI-crypto is the proposal we would wrap if we decide to add platform support. |
Description
Currently, the
System.Security.Cryptography.HashAlgorithmName
methods throw aPlatformNotSupportedException
when executed in a C# program that got compiled against thewasi-wasm
runtime. While the WASI Crypto API hasn't been finalized (AFAICT) andwasmtime
doesn't provide any implementation, it would be really useful if at least the managed implementation of these crypto functions were available for programs running under wasi-wasm.Reproduction Steps
Compile any program accessing any of the crypto functions (e.g. SHA1). When run an exception will be thrown:
Expected behavior
While no WASI Crypto API has been finalized and made available via
wasmtime
, it would be really useful if the managed implementations could be used. I am trying to use Roslyn APIs, which internally use both SHA1 and SHA256 and thus cannot be executed under wasi-wasm.Actual behavior
A
PlatformNotSupportedException
gets thrown.Regression?
No response
Known Workarounds
No response
Configuration
Other information
No response
The text was updated successfully, but these errors were encountered: