-
Couldn't load subscription status.
- Fork 236
Add efi_rng opt-in backend
#570
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
| impl Error { | ||
| pub(crate) const BOOT_SERVICES_UNAVAILABLE: Error = Self::new_internal(10); | ||
| pub(crate) const NO_RNG_HANDLE: Error = Self::new_internal(11); | ||
| pub(crate) const TEMP_EFI_ERROR: Error = Self::new_internal(12); |
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.
Do we need TEMP_EFI_ERROR now if we have #569 ?
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.
As I wrote in the OP, to encapsulate the UEFI status codes we need a wider state than 32-bits. Technically, on x86-64 we need 64 bits, but we probably can use NonZeroU64 since status codes with prefixes 0x1, 0x3, and 0x7 are used for "warning" codes.
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.
Two questions:
- Do we think that adding in this backend is a blocker for 0.3?
- Is there a reason to have this be opt-in rather than our default implementation for the UEFI target? (Especially now that an alternative backend like
rdrandcan be enabled even on supported targets).
No, it's not a blocker and may be left for a later release.
There are two reasons:
|
### Added - `efi_rng` opt-in backend [#570] - `linux_raw` opt-in backend [#572] - `.cargo/config.toml` example in the crate-level docs [#591] - `getrandom_test_linux_without_fallback` configuration flag to test that file fallback is not triggered in the `linux_android_with_fallback` backend [#605] - Built-in support for `*-linux-none` targets [#618] - Cygwin support [#626] ### Changed - Update `wasi` dependency to v0.14 [#594] - Add `#[inline]` attribute to the inner functions [#596] - Update WASI and Emscripten links in the crate-level docs [#597] - Do not use `dlsym` on MUSL targets in the `linux_android_with_fallback` backend [#602] - Remove `linux_android.rs` and use `getrandom.rs` instead [#603] - Always use `RtlGenRandom` on Windows targets when compiling with pre-1.78 Rust [#610] - Internal representation of the `Error` type [#614] - Remove `windows-targets` dependency and use [`raw-dylib`] directly [#627] ### Removed - `Error::INTERNAL_START` and `Error::CUSTOM_START` associated constants [#614] [#570]: #570 [#572]: #572 [#591]: #591 [#594]: #594 [#596]: #596 [#597]: #597 [#602]: #602 [#603]: #603 [#605]: #605 [#610]: #610 [#614]: #614 [#618]: #618 [#626]: #626 [#627]: #627 [`raw-dylib`]: https://doc.rust-lang.org/reference/items/external-blocks.html?highlight=link#dylib-versus-raw-dylib
The implementation is based on the
stdcode. I am not sure why we need the try loop over protocol handles instead of just getting the first handle, but I decided to just followstdhere.Because the backend requires access to
BootServicesit has to rely on the unstableuefi_stdfeature. We could alternatively use theueficrate, but it would tie the backend to theueficrate environment, which is probably not desirable.TEMP_EFI_ERRORis used as a temporary solution until #568 is resolved, which I plan to do in a separate PR.cc @usamoi @nicholasbishop