-
Notifications
You must be signed in to change notification settings - Fork 3.4k
implement getentropy via __wasi_random_get. #22819
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
Conversation
From the CI failures it looks like you need to perhaps update/rebase on top of the main branch? |
@@ -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. | |||
weak int getentropy(void* buffer, size_t length) { | |||
abort(); |
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.
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).
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.
done. should I leave it weak
?
system/lib/standalone/standalone.c
Outdated
@@ -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. |
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.
I think this comment can now be removed.
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.
done.
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? |
Closing in favor of #22820 |
fixes #22782
I'm not sure how to get this tested. Any feedback would be appreciated.