Skip to content
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

Add support for forced custom implementation #269

Closed
wants to merge 1 commit into from
Closed

Add support for forced custom implementation #269

wants to merge 1 commit into from

Conversation

Protryon
Copy link

This adds a feature force-custom that will supersede target_os based rng selection.

This fixes #230, and supports my particular use case, which is building for wasm32-unknown-unknown in theory, but using wasm32-unknown-emscripten in practice, with a custom rand impl.

@newpavlov
Copy link
Member

We intentionally did not want an easy way for users to overwrite the "default" sources on supported platforms, since it may cause security issues. Imagine a crate which silently enables the force-custom feature and uses a backdoored RNG.

If users absolutely need to use a different entropy source on supported platforms, then they always can override getrandom with their custom crate.

@josephlr
Copy link
Member

I agree with @newpavlov here. We don't want to allow unilateral overriding of the RNG, and there are other ways to achieve your goal here. Note that when we add #275, it may help your use-case, as you could then link against a different getentropy.

I'm going to leave #230 open, as it deals with out desired preference for rdrand vs custom.

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.

It should be possible to use a custom implementation when RDRAND is available
3 participants