From 5b8140ab83bd3316cdd9642549eaaa5a8abddcee Mon Sep 17 00:00:00 2001 From: Murisi Tarusenga Date: Thu, 22 Feb 2024 15:15:21 +0200 Subject: [PATCH] Do not allow MASP_TEST_SEED to be used outside of testing. --- crates/sdk/src/masp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/sdk/src/masp.rs b/crates/sdk/src/masp.rs index fba7829179..96044ed5ba 100644 --- a/crates/sdk/src/masp.rs +++ b/crates/sdk/src/masp.rs @@ -2304,6 +2304,8 @@ impl ShieldedContext { let memo = MemoBytes::empty(); // Try to get a seed from env var, if any. + let rng = StdRng::from_rng(OsRng).unwrap(); + #[cfg(feature = "testing")] let rng = if let Ok(seed) = env::var(ENV_VAR_MASP_TEST_SEED) .map_err(|e| Error::Other(e.to_string())) .and_then(|seed| { @@ -2319,7 +2321,7 @@ impl ShieldedContext { ); StdRng::seed_from_u64(seed) } else { - StdRng::from_rng(OsRng).unwrap() + rng }; // Now we build up the transaction within this object