log: added CONFIG_LOG_CBOR (default off) to control logging via jade serial API
What changed, and why it matters
This commit adds a new build-time setting (CONFIG_LOG_CBOR) that is off by default. Previously, the Jade hardware wallet could send log messages over its serial interface; now that behavior is gated behind an explicit opt-in flag. The change reduces the risk that diagnostic logs leak sensitive information over the serial port in normal production builds.
No immediate action required. Users building firmware should verify that CONFIG_LOG_CBOR remains disabled for production builds unless serial CBOR logging is explicitly required. Review what serial_logger emits to confirm no sensitive data is logged when the option is enabled.
Security signals we found
Logging over serial is now opt-in rather than enabled by default
Potential reduction of information disclosure via serial interface
No functional code changes beyond the guard condition
Evidence from the diff
The patch introduces a Kconfig boolean CONFIG_LOG_CBOR and changes the preprocessor guard in main.c so that esp_log_set_vprintf(serial_logger) is only compiled when both CONFIG_LOG_DEFAULT_LEVEL_NONE is unset and CONFIG_LOG_CBOR is set. Previously, any non-silent log level would redirect ESP log output to a custom serial_logger vprintf function. The new flag defaults to off, so production-like builds will not route logs over the serial API unless explicitly enabled at build time.
Changed components
main/main.cmain/Kconfig.projbuildESP-IDF logging subsystem integrationInspect captured patch +4 / −1
diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild
index 330f73b..993ebc4 100644
--- a/main/Kconfig.projbuild
+++ b/main/Kconfig.projbuild
@@ -651,4 +651,7 @@ menu "Blockstream Jade"
help
Enable smoketest firmware.
+ config LOG_CBOR
+ bool "Enable logging messages CBOR encoded over serial"
+
endmenu
diff --git a/main/main.c b/main/main.c
index d769cd1..ee111aa 100644
--- a/main/main.c
+++ b/main/main.c
@@ -152,7 +152,7 @@ static void boot_process(void)
JADE_ABORT();
}
-#ifndef CONFIG_LOG_DEFAULT_LEVEL_NONE
+#if !defined(CONFIG_LOG_DEFAULT_LEVEL_NONE) && defined(CONFIG_LOG_CBOR)
esp_log_set_vprintf(serial_logger);
#endif
Why this scored 29/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.