mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
Removed algorithm switching
This commit is contained in:
parent
1ae4ab42f8
commit
d0bc74ff21
12
cmd.py
12
cmd.py
@ -9,7 +9,6 @@ from bitkeylib.debuglink import DebugLink
|
|||||||
|
|
||||||
def parse_args(commands):
|
def parse_args(commands):
|
||||||
parser = argparse.ArgumentParser(description='Commandline tool for Bitkey devices.')
|
parser = argparse.ArgumentParser(description='Commandline tool for Bitkey devices.')
|
||||||
parser.add_argument('-a', '--algorithm', dest='algorithm', choices=['bip32', 'electrum'], default='bip32', help='Key derivation algorithm')
|
|
||||||
parser.add_argument('-t', '--transport', dest='transport', choices=['usb', 'serial', 'pipe', 'socket'], default='serial', help="Transport used for talking with the device")
|
parser.add_argument('-t', '--transport', dest='transport', choices=['usb', 'serial', 'pipe', 'socket'], default='serial', help="Transport used for talking with the device")
|
||||||
parser.add_argument('-p', '--path', dest='path', default='/dev/ttyAMA0', help="Path used by the transport (usually serial port)")
|
parser.add_argument('-p', '--path', dest='path', default='/dev/ttyAMA0', help="Path used by the transport (usually serial port)")
|
||||||
parser.add_argument('-dt', '--debuglink-transport', dest='debuglink_transport', choices=['usb', 'serial', 'pipe', 'socket'], default='socket', help="Debuglink transport")
|
parser.add_argument('-dt', '--debuglink-transport', dest='debuglink_transport', choices=['usb', 'serial', 'pipe', 'socket'], default='socket', help="Debuglink transport")
|
||||||
@ -132,15 +131,8 @@ def main():
|
|||||||
debuglink = DebugLink(debuglink_transport)
|
debuglink = DebugLink(debuglink_transport)
|
||||||
else:
|
else:
|
||||||
debuglink = None
|
debuglink = None
|
||||||
|
|
||||||
if args.algorithm == 'electrum':
|
client = BitkeyClient(transport, debuglink=debuglink)
|
||||||
algo = proto.ELECTRUM
|
|
||||||
elif args.algorithm == 'bip32':
|
|
||||||
algo = proto.BIP32
|
|
||||||
else:
|
|
||||||
raise Exception("Unknown algorithm")
|
|
||||||
|
|
||||||
client = BitkeyClient(transport, debuglink=debuglink, algo=algo)
|
|
||||||
client.setup_debuglink(button=True, otp_correct=True, pin_correct=True)
|
client.setup_debuglink(button=True, otp_correct=True, pin_correct=True)
|
||||||
cmds = Commands(client)
|
cmds = Commands(client)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user