1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-16 04:29:08 +00:00

src/apps/wallet: fix ed25519 pubkey prefix

This commit is contained in:
Pavol Rusnak 2018-03-07 14:22:35 +01:00
parent ffe151459b
commit 3971f4bf13
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -20,15 +20,18 @@ async def get_public_key(ctx, msg):
coin = coins.by_name(coin_name)
node_xpub = node.serialize_public(coin.xpub_magic)
pubkey = node.public_key()
if pubkey[0] == 1:
pubkey = b'\x00' + pubkey[1:]
node_type = HDNodeType(
depth=node.depth(),
child_num=node.child_num(),
fingerprint=node.fingerprint(),
chain_code=node.chain_code(),
public_key=node.public_key())
public_key=pubkey)
if msg.show_display:
await _show_pubkey(ctx, node.public_key())
await _show_pubkey(ctx, pubkey)
return PublicKey(node=node_type, xpub=node_xpub)