chore(prodtest): libtropic - remove `max_len` from `lt_get_info_riscv_fw_ver()` and `lt_get_info_spect_fw_ver()` [no changelog]
What changed, and why it matters
This is a small code cleanup in Trezor's internal production-testing tool. It removes an unused `max_len` argument from two helper functions that read firmware version numbers from a Tropic chip during manufacturing tests. There is no indication this change fixes a security bug or introduces one; it simply follows an updated library API.
No security action required. Treat as routine API-alignment cleanup. Verify the matching libtropic header change is present in the build to avoid compile failures.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates calls to lt_get_info_riscv_fw_ver() and lt_get_info_spect_fw_ver() in core/embed/projects/prodtest/cmd/prodtest_tropic.c to match a new signature that no longer takes a max_len parameter. The local buffers already use the fixed compile-time sizes LT_L2_GET_INFO_RISCV_FW_SIZE and LT_L2_GET_INFO_SPECT_FW_SIZE, so the removed argument was redundant. The change affects only the prodtest CLI commands for retrieving and updating Tropic firmware versions.
Changed components
core/embed/projects/prodtest/cmd/prodtest_tropic.cInspect captured patch +4 / −6
diff --git a/core/embed/projects/prodtest/cmd/prodtest_tropic.c b/core/embed/projects/prodtest/cmd/prodtest_tropic.c
index 7a2bb0f7b..ffbfe1585 100644
--- a/core/embed/projects/prodtest/cmd/prodtest_tropic.c
+++ b/core/embed/projects/prodtest/cmd/prodtest_tropic.c
@@ -497,8 +497,7 @@ static void prodtest_tropic_get_riscv_fw_version(cli_t* cli) {
lt_handle_t* tropic_handle = tropic_get_handle();
uint8_t version[LT_L2_GET_INFO_RISCV_FW_SIZE] = {0};
- if (lt_get_info_riscv_fw_ver(tropic_handle, version, sizeof(version)) !=
- LT_OK) {
+ if (lt_get_info_riscv_fw_ver(tropic_handle, version) != LT_OK) {
cli_error(cli, CLI_ERROR, "Unable to get RISCV FW version");
return;
}
@@ -516,8 +515,7 @@ static void prodtest_tropic_get_spect_fw_version(cli_t* cli) {
lt_handle_t* tropic_handle = tropic_get_handle();
uint8_t version[LT_L2_GET_INFO_SPECT_FW_SIZE];
- if (lt_get_info_spect_fw_ver(tropic_handle, version, sizeof(version)) !=
- LT_OK) {
+ if (lt_get_info_spect_fw_ver(tropic_handle, version) != LT_OK) {
cli_error(cli, CLI_ERROR, "Unable to get SPECT FW version");
return;
}
@@ -1728,7 +1726,7 @@ static void prodtest_tropic_update_fw(cli_t* cli) {
cli_trace(cli, "Reading RISC-V FW version");
uint8_t risc_fw_ver[LT_L2_GET_INFO_RISCV_FW_SIZE] = {0};
- ret = lt_get_info_riscv_fw_ver(h, risc_fw_ver, LT_L2_GET_INFO_RISCV_FW_SIZE);
+ ret = lt_get_info_riscv_fw_ver(h, risc_fw_ver);
if (ret != LT_OK) {
cli_error(cli, CLI_ERROR, "Failed to get RISC-V FW version, ret=%s",
@@ -1742,7 +1740,7 @@ static void prodtest_tropic_update_fw(cli_t* cli) {
cli_trace(cli, "Reading SPECT FW version");
uint8_t spect_fw_ver[LT_L2_GET_INFO_SPECT_FW_SIZE] = {0};
- ret = lt_get_info_spect_fw_ver(h, spect_fw_ver, LT_L2_GET_INFO_SPECT_FW_SIZE);
+ ret = lt_get_info_spect_fw_ver(h, spect_fw_ver);
if (ret != LT_OK) {
cli_error(cli, CLI_ERROR, "Failed to get SPECT FW version, ret=%s",
Why this scored 11/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.