show the se gen version on the about the welcome UI page
What changed, and why it matters
This commit simply adds the secure-element generation number (for example, a chip revision identifier) next to the firmware version string on three user-interface screens: the About page, the device-info page, and the welcome/setup page. It is a cosmetic display change with no security effect.
No security action required; routine UI change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes three UI widget source files to call GetSeGen() and append its integer value to the displayed firmware version string using snprintf_s. It also widens the local version buffers from fixed 32-byte sizes to SOFTWARE_VERSION_MAX_LEN (+4 for the appended text). No cryptographic, authentication, or access-control logic is modified.
Changed components
src/ui/gui_widgets/gui_about_info_widgets.csrc/ui/gui_widgets/gui_about_widgets.csrc/ui/gui_widgets/gui_setup_widgets.cInspect captured patch +15 / −7
diff --git a/src/ui/gui_widgets/gui_about_info_widgets.c b/src/ui/gui_widgets/gui_about_info_widgets.c
index dc402fa..74f91da 100644
--- a/src/ui/gui_widgets/gui_about_info_widgets.c
+++ b/src/ui/gui_widgets/gui_about_info_widgets.c
@@ -127,17 +127,19 @@ static void GuiAboutNVSBarInit()
void GuiAboutInfoEntranceWidget(lv_obj_t *parent)
{
- char version[BUFFER_SIZE_32] = {0};
+ char version[SOFTWARE_VERSION_MAX_LEN] = {0};
GetSoftWareVersion(version);
const char *versionPrefix = "Firmware ";
char *startPointer = strstr(version, versionPrefix);
- char versionStr[BUFFER_SIZE_32] = {0};
+ char versionStr[SOFTWARE_VERSION_MAX_LEN + 4] = {0};
char fpVersion[BUFFER_SIZE_32] = "v";
if (startPointer) {
- strncpy(versionStr, version + strlen(versionPrefix), strnlen_s(version, BUFFER_SIZE_32));
+ strncpy(versionStr, version + strlen(versionPrefix), strnlen_s(version, sizeof(version)));
} else {
- strncpy(versionStr, version, strnlen_s(version, BUFFER_SIZE_32));
+ strncpy(versionStr, version, strnlen_s(version, sizeof(version)));
}
+ uint32_t versionStrLen = strnlen_s(versionStr, sizeof(versionStr));
+ snprintf_s(versionStr + versionStrLen, sizeof(versionStr) - versionStrLen, "(%d)", (int)GetSeGen());
char serialNumber[64] = {0};
GetSerialNumber(serialNumber);
diff --git a/src/ui/gui_widgets/gui_about_widgets.c b/src/ui/gui_widgets/gui_about_widgets.c
index 8d8203b..fafe946 100644
--- a/src/ui/gui_widgets/gui_about_widgets.c
+++ b/src/ui/gui_widgets/gui_about_widgets.c
@@ -9,6 +9,7 @@
#include "presetting.h"
#include "gui_about_widgets.h"
#include "version.h"
+#include "se_manager.h"
#include "err_code.h"
#include "gui_page.h"
#include "user_fatfs.h"
@@ -109,8 +110,10 @@ void GuiAboutEntranceWidget(lv_obj_t *parent)
lv_obj_align(line, LV_ALIGN_DEFAULT, 0, 499);
//firmware
- char version[32] = {0};
+ char version[SOFTWARE_VERSION_MAX_LEN + 4] = {0};
GetSoftWareVersion(version);
+ uint32_t versionLen = strnlen_s(version, sizeof(version));
+ snprintf_s(version + versionLen, sizeof(version) - versionLen, "(%d)", (int)GetSeGen());
label = GuiCreateTextLabel(parent, version);
imgArrow = GuiCreateImg(parent, &imgArrowRight);
diff --git a/src/ui/gui_widgets/gui_setup_widgets.c b/src/ui/gui_widgets/gui_setup_widgets.c
index aa4ec38..cf7e836 100644
--- a/src/ui/gui_widgets/gui_setup_widgets.c
+++ b/src/ui/gui_widgets/gui_setup_widgets.c
@@ -4,6 +4,7 @@
#include "gui_setup_widgets.h"
#include "gui_obj.h"
#include "version.h"
+#include "se_manager.h"
#include "gui_web_auth_widgets.h"
#include "gui_web_auth_result_widgets.h"
#include "device_setting.h"
@@ -71,7 +72,9 @@ static void GuiWelcomeWidget(lv_obj_t *parent)
lv_obj_t *label = GuiCreateTitleLabel(parent, "Keystone");
lv_obj_align(label, LV_ALIGN_TOP_MID, 0, 268 - GUI_NAV_BAR_HEIGHT);
- label = GuiCreateNoticeLabel(parent, GetSoftwareVersionString());
+ char version[SOFTWARE_VERSION_MAX_LEN + 4] = {0};
+ snprintf_s(version, sizeof(version), "%s(%d)", GetSoftwareVersionString(), (int)GetSeGen());
+ label = GuiCreateNoticeLabel(parent, version);
lv_obj_align(label, LV_ALIGN_TOP_MID, 0, 328 - GUI_NAV_BAR_HEIGHT);
lv_obj_t *btn = GuiCreateBtn(parent, USR_SYMBOL_ARROW_NEXT);
@@ -321,4 +324,4 @@ static void DestroyTimer(void)
lv_timer_del(g_resetClickCountTimer);
g_resetClickCountTimer = NULL;
}
-}
\ No newline at end of file
+}
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.