ensure current getrandom works with strict provenance
This commit is contained in:
parent
105dba7968
commit
859310a370
@ -15,7 +15,7 @@ page_size = "0.4.1"
|
||||
num_cpus = "1.10.1"
|
||||
|
||||
getrandom_1 = { package = "getrandom", version = "0.1" }
|
||||
getrandom_2 = { package = "getrandom", version = "0.2" }
|
||||
getrandom = { version = "0.2" }
|
||||
rand = { version = "0.8", features = ["small_rng"] }
|
||||
|
||||
[workspace]
|
||||
|
8
src/tools/miri/tests/pass-dep/getrandom_1.rs
Normal file
8
src/tools/miri/tests/pass-dep/getrandom_1.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// mac-os `getrandom_1` does some pointer shenanigans
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
|
||||
/// Test old version of `getrandom`.
|
||||
fn main() {
|
||||
let mut data = vec![0; 16];
|
||||
getrandom_1::getrandom(&mut data).unwrap();
|
||||
}
|
@ -1,12 +1,10 @@
|
||||
// mac-os `getrandom_1` does some pointer shenanigans
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
use rand::{rngs::SmallRng, Rng, SeedableRng};
|
||||
|
||||
fn main() {
|
||||
// Test `getrandom` directly (in multiple different versions).
|
||||
// Test `getrandom` directly.
|
||||
let mut data = vec![0; 16];
|
||||
getrandom_1::getrandom(&mut data).unwrap();
|
||||
getrandom_2::getrandom(&mut data).unwrap();
|
||||
getrandom::getrandom(&mut data).unwrap();
|
||||
|
||||
// Try seeding with "real" entropy.
|
||||
let mut rng = SmallRng::from_entropy();
|
||||
|
Loading…
x
Reference in New Issue
Block a user