What changed, and why it matters
This commit changes a build-time helper tool so that, instead of crashing with a generic panic when protobuf compilation fails, it prints the actual error message and exits with a clean error code. It is a developer-experience improvement with no runtime security effect on the BitBox02 device firmware.
No security action required. Treat as a normal code-quality/build-tool improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is in tools/prost-build-proto/src/main.rs, a Rust helper used during firmware builds to generate Rust code from .proto files via prost_build. The main function now returns Result<(), i32>, replaces .unwrap() with an explicit error check, prints the error to stderr, and returns Err(1). This only affects error reporting behavior of the build tool; it does not alter generated code, protocol parsing, or device logic.
Changed components
tools/prost-build-proto/src/main.rsInspect captured patch +6 / −4
diff --git a/tools/prost-build-proto/src/main.rs b/tools/prost-build-proto/src/main.rs
index 9ffe73c..e912cbd 100644
--- a/tools/prost-build-proto/src/main.rs
+++ b/tools/prost-build-proto/src/main.rs
@@ -14,13 +14,15 @@
use std::env;
-fn main() {
+fn main() -> Result<(), i32> {
let args: Vec<String> = env::args().collect();
let messages_dir = &args[1];
let out_dir = &args[2];
let mut config = prost_build::Config::new();
config.out_dir(out_dir);
- config
- .compile_protos(&["hww.proto", "backup.proto"], &[messages_dir])
- .unwrap();
+ if let Err(e) = config.compile_protos(&["hww.proto", "backup.proto"], &[messages_dir]) {
+ eprintln!("{e}");
+ return Err(1);
+ }
+ Ok(())
}
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.