1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

ethereum: fix get_address for very short paths

This commit is contained in:
Jan Pochyla 2018-07-10 14:53:39 +02:00
parent 28455a8789
commit 2f6386e041

View File

@ -17,7 +17,10 @@ async def ethereum_get_address(ctx, msg):
address = sha3_256(public_key[1:]).digest(True)[12:] # Keccak
if msg.show_display:
network = networks.by_slip44(address_n[1] & 0x7fffffff)
if len(address_n) > 1: # path has slip44 network identifier
network = networks.by_slip44(address_n[1] & 0x7fffffff)
else:
network = None
hex_addr = _ethereum_address_hex(address, network)
while True: