Skip to content

Commit 82d89b3

Browse files
authored
fix: adjust benfen to blind signing & bootloader version upgrade (#249)
* adjust benfen to blind signing * bootloader version upgrade
1 parent 65d16a4 commit 82d89b3

File tree

2 files changed

+3
-71
lines changed

2 files changed

+3
-71
lines changed

core/embed/bootloader/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#define VERSION_MAJOR 2
2-
#define VERSION_MINOR 6
2+
#define VERSION_MINOR 7
33
#define VERSION_PATCH 0
44
#define VERSION_BUILD 0
55
#define VERSION_UINT32 \
66
(VERSION_MAJOR | (VERSION_MINOR << 8) | (VERSION_PATCH << 16) | \
77
(VERSION_BUILD << 24))
88

99
#define FIX_VERSION_MAJOR 2
10-
#define FIX_VERSION_MINOR 6
10+
#define FIX_VERSION_MINOR 7
1111
#define FIX_VERSION_PATCH 0
1212
#define FIX_VERSION_BUILD 0
1313

core/src/apps/benfen/sign_tx.py

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
from . import ICON, PRIMARY_COLOR
1515
from .helper import INTENT_BYTES, benfen_address_from_pubkey, try_convert_to_bfc_address
16-
from .layout import require_confirm_fee, require_show_overview
17-
from .tx_parser import TransactionParser
1816

1917

2018
async def process_transaction(
@@ -23,76 +21,10 @@ async def process_transaction(
2321
tx_bytes: bytes,
2422
coin_type: bytes,
2523
) -> bytes:
26-
parser = TransactionParser()
27-
2824
intent = tx_bytes[:3]
2925
if INTENT_BYTES != intent:
3026
raise wire.DataError("Invalid raw tx")
31-
32-
if coin_type:
33-
try:
34-
if not all(c < 128 for c in coin_type):
35-
await confirm_blind_sign_common(ctx, address, tx_bytes)
36-
return blake2b(data=tx_bytes, outlen=32).digest()
37-
currency_symbol = coin_type.decode("ascii")
38-
if currency_symbol and "::" in currency_symbol:
39-
currency_symbol = currency_symbol.split("::")[-1]
40-
ALLOWED_TOKENS = {
41-
"BJPY",
42-
"BUSD",
43-
"LONG",
44-
"BF_USDC",
45-
"BF_USDT",
46-
"BFC",
47-
"BAUD",
48-
"BCAD",
49-
"BEUR",
50-
"BIDR",
51-
"BINR",
52-
"BKRW",
53-
"BMXN",
54-
}
55-
if currency_symbol not in ALLOWED_TOKENS:
56-
currency_symbol = "UNKNOWN"
57-
except UnicodeDecodeError:
58-
await confirm_blind_sign_common(ctx, address, tx_bytes)
59-
return blake2b(data=tx_bytes, outlen=32).digest()
60-
else:
61-
await confirm_blind_sign_common(ctx, address, tx_bytes)
62-
return blake2b(data=tx_bytes, outlen=32).digest()
63-
64-
parsed_tx = parser.parse_tx(tx_bytes)
65-
if parsed_tx is None:
66-
await confirm_blind_sign_common(ctx, address, tx_bytes)
67-
return blake2b(data=tx_bytes, outlen=32).digest()
68-
69-
is_valid = validate_transaction(parsed_tx)
70-
71-
if is_valid:
72-
(
73-
amount_raw,
74-
recipient_bfc,
75-
sender_bfc,
76-
max_gas_fee,
77-
) = parse_transaction(parsed_tx)
78-
show_details = await require_show_overview(
79-
ctx,
80-
recipient_bfc,
81-
amount_raw,
82-
currency_symbol,
83-
)
84-
if show_details:
85-
await require_confirm_fee(
86-
ctx,
87-
from_address=sender_bfc,
88-
to_address=recipient_bfc,
89-
value=amount_raw,
90-
gas_price=max_gas_fee,
91-
gas_budget=max_gas_fee,
92-
currency_symbol=currency_symbol,
93-
)
94-
else:
95-
await confirm_blind_sign_common(ctx, address, tx_bytes)
27+
await confirm_blind_sign_common(ctx, address, tx_bytes)
9628
return blake2b(data=tx_bytes, outlen=32).digest()
9729

9830

0 commit comments

Comments
 (0)