workflow: use std::println! over C printf in C simulator
What changed, and why it matters
This commit is a small code cleanup in a test-only file for the C simulator. It replaces calls to a C-style print function with Rust's standard println macro. There is no security relevance: no real secrets are handled, no production code is changed, and no vulnerability is introduced or fixed.
No security action needed. Treat as routine refactoring/cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In src/rust/bitbox02-rust/src/workflow/mnemonic_c_unit_tests.rs, the commit swaps bitbox02::println_stdout(…) for std::println!(…) in two test helper functions (show_and_confirm_mnemonic and get). The file is part of C simulator unit tests and uses hardcoded dummy mnemonic words. The change removes a dependency on the bitbox02/C printf wrapper for test output only.
Changed components
src/rust/bitbox02-rust/src/workflow/mnemonic_c_unit_tests.rsInspect captured patch +6 / −4
diff --git a/src/rust/bitbox02-rust/src/workflow/mnemonic_c_unit_tests.rs b/src/rust/bitbox02-rust/src/workflow/mnemonic_c_unit_tests.rs
index f209675..3e3249d 100644
--- a/src/rust/bitbox02-rust/src/workflow/mnemonic_c_unit_tests.rs
+++ b/src/rust/bitbox02-rust/src/workflow/mnemonic_c_unit_tests.rs
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
+extern crate std;
+
use crate::hal::ui::UserAbort;
use alloc::string::String;
@@ -11,17 +13,17 @@ pub async fn show_and_confirm_mnemonic(
words: &[&str],
) -> Result<(), UserAbort> {
for word in words.iter() {
- bitbox02::println_stdout(word);
+ std::println!("{}", word);
}
- bitbox02::println_stdout("Words confirmed");
+ std::println!("Words confirmed");
Ok(())
}
pub async fn get(_ui: &mut impl crate::hal::Ui) -> Result<zeroize::Zeroizing<String>, UserAbort> {
let words = "boring mistake dish oyster truth pigeon viable emerge sort crash wire portion cannon couple enact box walk height pull today solid off enable tide";
- bitbox02::println_stdout("Restored from recovery words below:");
- bitbox02::println_stdout(words);
+ std::println!("Restored from recovery words below:");
+ std::println!("{}", words);
Ok(zeroize::Zeroizing::new(words.to_string()))
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.