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

Make less-safe work on espidf #1944

Merged
merged 3 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ default = ["alloc", "dev_urandom_fallback"]
alloc = []
dev_urandom_fallback = []
less-safe-getrandom-custom-or-rdrand = []
less-safe-getrandom-espidf = []
slow_tests = []
std = ["alloc"]
unstable-testing-arm-no-hw = []
Expand Down
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
//! </a> and <a href="https://docs.rs/getrandom/0.2.10/getrandom/#rdrand-on-x86">
//! RDRAND on x86
//! </a> for additional details.
//! <tr><td><code>less-safe-getrandom-espidf</code>
//! <td>Treat getrandom as a secure random number generator (see
//! <code>SecureRandom</code>) on the esp-idf target. While the esp-idf
//! target does have hardware RNG, it is beyond the scope of ring to
//! ensure its configuration. This feature allows ring to build
//! on esp-idf despite the liklihood that RNG is not secure.
//! This feature only works with <code>os = espidf</code> targets.
//! See <a href="https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/random.html">
//! <tr><td><code>std</code>
//! <td>Enable features that use libstd, in particular
//! <code>std::error::Error</code> integration. Implies `alloc`.
Expand Down
1 change: 1 addition & 0 deletions src/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl crate::sealed::Sealed for SystemRandom {}
// implementation.
#[cfg(any(
all(feature = "less-safe-getrandom-custom-or-rdrand", target_os = "none"),
all(feature = "less-safe-getrandom-espidf", target_os = "espidf"),
target_os = "aix",
target_os = "android",
target_os = "dragonfly",
Expand Down