Add strict parameter to u32_from_BE
This commit is contained in:
@@ -248,9 +248,9 @@ void finalizeParsing(bool direct) {
|
||||
uint32_t id = 0;
|
||||
|
||||
if (txContext.txType == LEGACY) {
|
||||
id = u32_from_BE(txContext.content->v, txContext.content->vLength);
|
||||
id = u32_from_BE(txContext.content->v, txContext.content->vLength, true);
|
||||
} else if (txContext.txType == EIP2930) {
|
||||
id = u32_from_BE(txContext.content->chainID.value, txContext.content->chainID.length);
|
||||
id = u32_from_BE(txContext.content->chainID.value, txContext.content->chainID.length, false);
|
||||
} else {
|
||||
PRINTF("TxType `%u` not supported while checking for chainID\n", txContext.txType);
|
||||
return;
|
||||
@@ -388,7 +388,7 @@ void finalizeParsing(bool direct) {
|
||||
// Prepare chainID field
|
||||
if (genericUI) {
|
||||
if (txContext.txType == LEGACY) {
|
||||
uint32_t id = u32_from_BE(txContext.content->v, txContext.content->vLength);
|
||||
uint32_t id = u32_from_BE(txContext.content->v, txContext.content->vLength, true);
|
||||
u32_to_str((char *) strings.common.chainID, sizeof(strings.common.chainID), id);
|
||||
} else if (txContext.txType == EIP2930) {
|
||||
uint256_t chainID;
|
||||
|
||||
@@ -8,7 +8,7 @@ unsigned int io_seproxyhal_touch_tx_ok(const bagl_element_t *e) {
|
||||
uint8_t signatureLength;
|
||||
cx_ecfp_private_key_t privateKey;
|
||||
uint32_t tx = 0;
|
||||
uint32_t v = u32_from_BE(tmpContent.txContent.v, tmpContent.txContent.vLength);
|
||||
uint32_t v = u32_from_BE(tmpContent.txContent.v, tmpContent.txContent.vLength, true);
|
||||
io_seproxyhal_io_heartbeat();
|
||||
os_perso_derive_node_bip32(CX_CURVE_256K1,
|
||||
tmpCtx.transactionContext.bip32Path,
|
||||
|
||||
@@ -173,9 +173,9 @@ void ux_approve_tx(bool dataPresent) {
|
||||
|
||||
uint32_t id;
|
||||
if (txContext.txType == LEGACY) {
|
||||
id = u32_from_BE(txContext.content->v, txContext.content->vLength);
|
||||
id = u32_from_BE(txContext.content->v, txContext.content->vLength, true);
|
||||
} else if (txContext.txType == EIP2930) {
|
||||
id = u32_from_BE(txContext.content->chainID.value, txContext.content->chainID.length);
|
||||
id = u32_from_BE(txContext.content->chainID.value, txContext.content->chainID.length, false);
|
||||
} else {
|
||||
PRINTF("TxType `%u` not supported while preparing to approve tx\n", txContext.txType);
|
||||
THROW(0x6501);
|
||||
|
||||
Reference in New Issue
Block a user