What changed, and why it matters
This commit is a small internal GUI change for the Blockstream Jade hardware wallet. It adds a new label ('icon type') to icon elements so the code can tell the difference between a regular icon and a QR-code icon. There is no indication in the commit that this fixes a security bug or changes user-visible behavior in a risky way.
No security action required. Treat as normal code maintenance. If reviewing for security, verify that future commits using `icon_type` for rendering or trust decisions handle the value safely.
Security signals we found
No security-relevant signals observed in the diff.
Change is a data-structure tagging addition with no security logic attached.
Evidence from the diff
The patch introduces an icon_node_kind enum (ICON_PLAIN, ICON_QR) and stores it in view_node_icon_data. It initializes plain icons to ICON_PLAIN and adds a helper gui_set_icon_to_qr() that marks QR-code icons as ICON_QR. The only caller is make_qrcode() in main/ui/qrmode.c. The change is purely structural/tagging; no logic that consumes icon_type is added in this commit, and no bounds checks, memory handling, or trust decisions are modified.
Changed components
main/gui.cmain/gui.hmain/ui/qrmode.cInspect captured patch +19 / −7
diff --git a/main/gui.c b/main/gui.c
index 45305d6..67a4938 100644
--- a/main/gui.c
+++ b/main/gui.c
@@ -1142,13 +1142,14 @@ void gui_make_icon(gui_view_node_t** ptr, const Icon* icon, color_t color, const
// background color is set to foreground color to imply transparency
data->bg_color = bg_color ? *bg_color : color;
- // and top-left
- data->halign = GUI_ALIGN_LEFT;
- data->valign = GUI_ALIGN_TOP;
-
// without animation
data->animation = NULL;
+ // and top-left, normal icon
+ data->halign = GUI_ALIGN_LEFT;
+ data->valign = GUI_ALIGN_TOP;
+ data->icon_type = ICON_PLAIN;
+
// also set free_view_node_icon_data as destructor to free any animation data
make_view_node(ptr, ICON, data, free_view_node_icon_data);
}
@@ -1210,6 +1211,12 @@ void gui_set_icon_animation(gui_view_node_t* node, Icon* icons, const size_t num
}
}
+void gui_set_icon_to_qr(gui_view_node_t* node)
+{
+ JADE_ASSERT(node);
+ node->icon->icon_type = ICON_QR;
+}
+
void gui_make_picture(gui_view_node_t** ptr, const Picture* picture)
{
JADE_INIT_OUT_PPTR(ptr);
diff --git a/main/gui.h b/main/gui.h
index 481e3e0..2bb50f3 100644
--- a/main/gui.h
+++ b/main/gui.h
@@ -264,6 +264,8 @@ struct view_node_button_data {
void* args;
};
+enum __attribute__((__packed__)) icon_node_kind { ICON_PLAIN, ICON_QR };
+
// Data for an icon node
// NOTE: animated icons ARE owned here
struct view_node_icon_animation_data {
@@ -285,11 +287,12 @@ struct view_node_icon_data {
// background color is set to foreground color to imply transparency
color_t bg_color;
- enum gui_horizontal_align halign;
- enum gui_vertical_align valign;
-
// if != NULL the icon will be regularly updated and so appear animated
struct view_node_icon_animation_data* animation;
+
+ enum gui_horizontal_align halign;
+ enum gui_vertical_align valign;
+ enum icon_node_kind icon_type;
};
// Data for a picture node
@@ -439,6 +442,7 @@ void gui_set_colors(gui_view_node_t* node, color_t color, color_t selected_color
void gui_set_color(gui_view_node_t* node, color_t color);
void gui_set_align(gui_view_node_t* node, enum gui_horizontal_align halign, enum gui_vertical_align valign);
void gui_set_icon_animation(gui_view_node_t* node, Icon* icons, size_t num_icons, size_t frames_per_icon);
+void gui_set_icon_to_qr(gui_view_node_t* node);
void gui_set_text_scroll(gui_view_node_t* node, color_t background_color);
void gui_set_text_scroll_selected(
gui_view_node_t* node, bool only_when_selected, color_t background_color, color_t selected_background_color);
diff --git a/main/ui/qrmode.c b/main/ui/qrmode.c
index aaa6936..8ba9925 100644
--- a/main/ui/qrmode.c
+++ b/main/ui/qrmode.c
@@ -14,6 +14,7 @@ static void make_qrcode(gui_view_node_t* parent, Icon* icons, const size_t num_i
gui_set_align(icon, GUI_ALIGN_CENTER, GUI_ALIGN_MIDDLE);
gui_set_parent(icon, fill);
gui_set_icon_animation(icon, icons, num_icons, frames_per_qr_icon);
+ gui_set_icon_to_qr(icon);
}
gui_activity_t* make_show_xpub_qr_activity(
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.