Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

walkingeyerobot
Copy link
Collaborator

fixes #22782

I'm not sure how to get this tested. Any feedback would be appreciated.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 31, 2024

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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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?

@@ -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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 31, 2024

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?

@sbc100
Copy link
Collaborator

sbc100 commented Oct 31, 2024

Closing in favor of #22820

@sbc100 sbc100 closed this Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standalone: implement getentropy() via wasi_snapshot_preview1.random_get()
2 participants