What changed, and why it matters
This is a small fix to the Trezor hardware wallet's production-line testing tool for the vibration motor (haptic feedback). It renames a variable, updates the driver initialization and playback calls to use newer error-handling types, and switches from a fixed vibration pattern to a custom 100 Hz vibration lasting the user-specified duration. There is no indication this change fixes a security vulnerability or affects end-user device security.
No security action required. Treat as routine maintenance of production-test tooling.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies core/embed/projects/prodtest/cmd/prodtest_haptic.c, a command used during factory production testing. It changes uint32_t duration to uint32_t duration_ms, introduces a ts_t status variable, replaces boolean haptic_init()/haptic_test() calls with ts_t-returning haptic_init()/haptic_play_custom(100, duration_ms), and uses ts_error(status) for error checking. The CLI trace message is also reordered. This appears to be a functional/test-code compatibility fix, not a security patch.
Changed components
core/embed/projects/prodtest/cmd/prodtest_haptic.cInspect captured patch +9 / −6
diff --git a/core/embed/projects/prodtest/cmd/prodtest_haptic.c b/core/embed/projects/prodtest/cmd/prodtest_haptic.c
index 4281911ba..503b6d6fa 100644
--- a/core/embed/projects/prodtest/cmd/prodtest_haptic.c
+++ b/core/embed/projects/prodtest/cmd/prodtest_haptic.c
@@ -25,9 +25,11 @@
#include <rtl/cli.h>
static void prodtest_haptic_test(cli_t* cli) {
- uint32_t duration = 0; // ms
+ uint32_t duration_ms = 0; // ms
- if (!cli_arg_uint32(cli, "duration", &duration)) {
+ ts_t status;
+
+ if (!cli_arg_uint32(cli, "duration", &duration_ms)) {
cli_error_arg(cli, "Expecting time in milliseconds.");
return;
}
@@ -37,15 +39,16 @@ static void prodtest_haptic_test(cli_t* cli) {
return;
}
- if (!haptic_init()) {
+ status = haptic_init();
+ if (ts_error(status)) {
cli_error(cli, CLI_ERROR, "Haptic driver initialization failed.");
return;
}
- haptic_play(HAPTIC_BUTTON_PRESS);
+ cli_trace(cli, "Running haptic feedback test for %d ms...", duration_ms);
- cli_trace(cli, "Running haptic feedback test for %d ms...", duration);
- if (!haptic_test(duration)) {
+ status = haptic_play_custom(100, duration_ms);
+ if (ts_error(status)) {
cli_error(cli, CLI_ERROR, "Haptic feedback test failed.");
return;
}
Why this scored 12/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.