What changed, and why it matters
This commit is a small cleanup in the Tron (TRX) transaction handling code for the Keystone 3 hardware wallet. It replaces a hardcoded number (7) with a named constant (KeystoneSignRequest) and removes some debug print statements. There is no direct evidence in the commit that this fixes a security vulnerability.
No security action required based on this commit alone. Treat as routine maintenance/refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change updates three conditional checks in src/ui/gui_chain/multi/web3/gui_trx.c so they compare urType against the symbolic constant KeystoneSignRequest instead of the magic number 7. It also removes several printf debug logging statements. This is a code-quality/refactoring change. No buffer overflow, injection, authentication bypass, or cryptographic flaw is visible in the diff.
Changed components
src/ui/gui_chain/multi/web3/gui_trx.cInspect captured patch +3 / −6
diff --git a/src/ui/gui_chain/multi/web3/gui_trx.c b/src/ui/gui_chain/multi/web3/gui_trx.c
index d27511e..d0734d5 100644
--- a/src/ui/gui_chain/multi/web3/gui_trx.c
+++ b/src/ui/gui_chain/multi/web3/gui_trx.c
@@ -48,7 +48,7 @@ void *GuiGetTrxData(void)
char *trxXpub = GetCurrentAccountPublicKey(XPUB_TYPE_TRX);
do {
PtrT_TransactionParseResult_DisplayTron parseResult = NULL;
- if( urType == 7) {
+ if( urType == KeystoneSignRequest) {
parseResult = tron_parse_keystone(data, urType, mfp, sizeof(mfp), trxXpub);
}else{
parseResult = tron_parse_sign_request(data);
@@ -67,10 +67,8 @@ PtrT_TransactionCheckResult GuiGetTrxCheckResult(void)
void *data = g_isMulti ? g_urMultiResult->data : g_urResult->data;
char *trxXpub = GetCurrentAccountPublicKey(XPUB_TYPE_TRX);
QRCodeType urType = g_isMulti ? g_urMultiResult->ur_type : g_urResult->ur_type;
- printf("GuiGetTrxCheckResult, urType: %d\n", urType);
GetMasterFingerPrint(mfp);
- printf("Trx check sign request, mfp: %02x%02x%02x%02x, xpub: %s\n", mfp[0], mfp[1], mfp[2], mfp[3], trxXpub);
- if( urType == 7) {
+ if( urType == KeystoneSignRequest) {
return tron_check_keystone(data, urType, mfp, sizeof(mfp), trxXpub);
}
return tron_check_sign_request(data, trxXpub, mfp, sizeof(mfp));
@@ -149,7 +147,7 @@ static UREncodeResult *GuiGetTrxSignUrDataDynamic(bool unLimit)
if (ret != 0) {
break;
}
- if( urType == 7) {
+ if( urType == KeystoneSignRequest) {
encodeResult = tron_sign_keystone(data, urType, mfp, sizeof(mfp), GetCurrentAccountPublicKey(XPUB_TYPE_TRX),
SOFTWARE_VERSION, seed, GetCurrentAccountSeedLen());
} else {
@@ -203,7 +201,6 @@ void *GuiGetTrxPersonalMessage(void)
void GetTrxPersonalMessageType(void *indata, void *param, uint32_t maxLen)
{
- printf("DEBUG: GetTrxPersonalMessageType param: %p\n", param);
if (param == NULL) {
strcpy_s((char *)indata, maxLen, "raw_message");
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.