mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-23 13:51:00 +00:00
parent
fd16bbfc8e
commit
9255507529
@ -98,13 +98,15 @@ def main():
|
|||||||
raise ValueError("32 bytes password expected")
|
raise ValueError("32 bytes password expected")
|
||||||
|
|
||||||
bip32_path = [10, 0]
|
bip32_path = [10, 0]
|
||||||
|
sys.stderr.write('Generated password is {}\n'.format(passw))
|
||||||
passw_encrypted = client.encrypt_keyvalue(bip32_path, label, passw, False, True)
|
passw_encrypted = client.encrypt_keyvalue(bip32_path, label, passw, False, True)
|
||||||
|
sys.stderr.write('Encrypted password is {}\n'.format(passw_encrypted))
|
||||||
|
|
||||||
data = {'label': label,
|
data = {'label': label,
|
||||||
'bip32_path': bip32_path,
|
'bip32_path': bip32_path,
|
||||||
'password_encrypted_hex': binascii.hexlify(passw_encrypted)}
|
'password_encrypted_hex': binascii.hexlify(passw_encrypted).decode('ascii')}
|
||||||
|
|
||||||
json.dump(data, open(passw_file, 'wb'))
|
json.dump(data, open(passw_file, 'w'))
|
||||||
|
|
||||||
# Let's load password
|
# Let's load password
|
||||||
data = json.load(open(passw_file, 'r'))
|
data = json.load(open(passw_file, 'r'))
|
||||||
@ -115,6 +117,7 @@ def main():
|
|||||||
binascii.unhexlify(data['password_encrypted_hex']),
|
binascii.unhexlify(data['password_encrypted_hex']),
|
||||||
False, True)
|
False, True)
|
||||||
|
|
||||||
|
sys.stderr.write('Submitting password {}\n'.format(passw))
|
||||||
print(passw)
|
print(passw)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user