implement getentropy via __wasi_random_get.#22819
Closed
walkingeyerobot wants to merge 3 commits intoemscripten-core:mainfrom
Closed
implement getentropy via __wasi_random_get.#22819walkingeyerobot wants to merge 3 commits intoemscripten-core:mainfrom
walkingeyerobot wants to merge 3 commits intoemscripten-core:mainfrom
Conversation
Collaborator
|
From the CI failures it looks like you need to perhaps update/rebase on top of the main branch? |
sbc100
approved these changes
Oct 31, 2024
| // There is no good source of entropy without an import. Make this weak so that | ||
| // it can be replaced with a pRNG or a proper import. | ||
| weak int getentropy(void* buffer, size_t length) { | ||
| abort(); |
Collaborator
There was a problem hiding this comment.
Can you copy the code from https://github.com/WebAssembly/wasi-libc/blob/main/libc-bottom-half/sources/getentropy.c? (With a link/attribution I think).
Collaborator
Author
There was a problem hiding this comment.
done. should I leave it weak?
| @@ -139,7 +139,7 @@ weak int __syscall_lstat64(intptr_t path, intptr_t buf) { | |||
| // There is no good source of entropy without an import. Make this weak so that | |||
| // it can be replaced with a pRNG or a proper import. | |||
Collaborator
There was a problem hiding this comment.
I think this comment can now be removed.
Collaborator
|
I actually think we should probably just use this implementation everywhere (not just in standalone mode), then we can implement it in JS and get it tested that way. I'm happy to take over this work if you like? |
Collaborator
|
Closing in favor of #22820 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #22782
I'm not sure how to get this tested. Any feedback would be appreciated.