You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use configuration flags to switch between backends (#504)
This PR removes `linux_disable_fallback`, `rdrand`, `js`,
`test-in-browser`, and `custom` crate features. As their replacement two
new configuration flags are introduced: `getrandom_browser_test` and
`getrandom_backend`. The latter can have the following values: `custom`,
`rdrand`, `linux_getrandom`, `wasm_js`, `esp_idf`.
`getrandom_backend` allows to change default backends which resolves
issues like #346 and provides more flexibility to users. For example, it
allows to use RDRAND or RDRND (see #494) directly instead of
syscall-based interfaces. We previously did not allow such overwrites
because of security concerns, but they do not apply in this case since
configuration flags used by a project can not be controlled by its
upstream dependencies.
The `register_custom_getrandom!` macro is removed in favor of explicitly
defining the `__getrandom_custom` function. It does not look like the
macro was widely used in practice and it's probably easier to explain
the `extern fn` approach (especially to embedded developers) than the
"magical" registration macro.
The new configuration flags also allow a great simplification of our
testing code.
Finally, ESP-IDF support is no longer enabled by default because of the
concerns raised in #397. Users can enable it by enabling the `esp_idf`
opt-in backend.
Closes#230Closes#346Closes#397Closes#498
0 commit comments