utils: fix params_additional_info return type
What changed, and why it matters
This commit changes the declared return type of a transaction-signing helper function from a transaction-type code (TxType_t) to a simple success/fail boolean (bool). The function body already appears to return true/false, so the change fixes a type mismatch between the function's implementation and its header. In plain terms, the code was telling the rest of the program 'I return a transaction type' while actually returning 'yes/no' answers; this patch makes the two match. That kind of mismatch can confuse the compiler and, in rare cases, lead to wrong decisions about what kind of transaction is being signed, but the diff itself is tiny and only shows the declaration/header change, not the full function body or any callers.
Review the full implementation of params_additional_info and every caller to confirm the function body already returns bool and that all callers now treat the return value as a boolean success indicator rather than as a TxType_t. If callers were using the old TxType_t return value, they must be updated in the same commit or immediately afterward. Run static analysis and targeted tests on transaction signing with additional info to ensure no regression or misinterpretation of return values.
Security signals we found
Return-type mismatch between function declaration/definition and header
Function is in transaction-signing utility code (sign_utils.c/h)
Function handles CBOR transaction parameters and writes output transaction metadata
Error-message out-parameter suggests failure path exists
Patch is partial: only declaration and header are shown, not callers or full body
Evidence from the diff
The function params_additional_info in main/process/sign_utils.c and main/process/sign_utils.h is changed from returning TxType_t to returning bool. The function takes a jade_process_t, CBOR params, a wally_tx, an output TxType_t pointer, and several other output pointers including an error-message pointer. The name and signature suggest it parses additional transaction info from CBOR and writes parsed values through out-parameters, while the bool return indicates success/failure. The prior TxType_t return type was inconsistent with a true/false return pattern and with the errmsg out-parameter. The patch is a type-correctness fix but is only two lines (declaration + header); it does not show whether callers were updated or whether the function body itself was already returning bool values.
Changed components
main/process/sign_utils.cmain/process/sign_utils.hparams_additional_info functionTransaction signing pathInspect captured patch +2 / −2
diff --git a/main/process/sign_utils.c b/main/process/sign_utils.c
index c74eeca..ef4fbdf 100644
--- a/main/process/sign_utils.c
+++ b/main/process/sign_utils.c
@@ -195,7 +195,7 @@ static bool validate_additional_info(const struct wally_tx* tx, const TxType_t t
return true;
}
-TxType_t params_additional_info(jade_process_t* process, CborValue* params, const struct wally_tx* tx, TxType_t* txtype,
+bool params_additional_info(jade_process_t* process, CborValue* params, const struct wally_tx* tx, TxType_t* txtype,
bool* is_partial, asset_summary_t** in_sums, size_t* num_in_sums, asset_summary_t** out_sums, size_t* num_out_sums,
const char** errmsg)
{
diff --git a/main/process/sign_utils.h b/main/process/sign_utils.h
index aa021a3..1324627 100644
--- a/main/process/sign_utils.h
+++ b/main/process/sign_utils.h
@@ -25,7 +25,7 @@ bool params_txn_validate(network_t network_id, bool for_liquid, const struct wal
bool params_trusted_commitments(
jade_process_t* process, const CborValue* params, const struct wally_tx* tx, commitment_t** data);
-TxType_t params_additional_info(jade_process_t* process, CborValue* params, const struct wally_tx* tx, TxType_t* txtype,
+bool params_additional_info(jade_process_t* process, CborValue* params, const struct wally_tx* tx, TxType_t* txtype,
bool* is_partial, asset_summary_t** in_sums, size_t* num_in_sums, asset_summary_t** out_sums, size_t* num_out_sums,
const char** errmsg);
Why this scored 26/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.