Bypass plugins/hw_wallet/qt.py bug when setting initial devices password

This commit is contained in:
djb 2017-03-14 17:16:36 +01:00
parent e63bf6ce02
commit 2b9282a00e
No known key found for this signature in database
GPG Key ID: 75D4B1A518B37477
1 changed files with 5 additions and 5 deletions

View File

@ -89,10 +89,10 @@ class DigitalBitbox_Client():
return pbkdf2.PBKDF2(key, 'Digital Bitbox', iterations = 20480, macmodule = hmac, digestmodule = hashlib.sha512).read(64).encode('hex')
def backup_password_dialog(self, confirm=False):
def backup_password_dialog(self):
msg = _("Enter the password used when the backup was created:")
while True:
password = self.handler.get_passphrase(msg, confirm)
password = self.handler.get_passphrase(msg, False)
if password is None:
return None
if len(password) < 4:
@ -103,9 +103,9 @@ class DigitalBitbox_Client():
return str(password)
def password_dialog(self, msg, confirm=False):
def password_dialog(self, msg):
while True:
password = self.handler.get_passphrase(msg, confirm)
password = self.handler.get_passphrase(msg, False)
if password is None:
return False
if len(password) < 4:
@ -126,7 +126,7 @@ class DigitalBitbox_Client():
"Enter a new password below.\r\n\r\n REMEMBER THE PASSWORD!\r\n\r\n" \
"You cannot access your coins or a backup without the password.\r\n" \
"A backup is saved automatically when generating a new wallet.")
if self.password_dialog(msg, True):
if self.password_dialog(msg):
reply = self.hid_send_plain('{"password":"' + self.password + '"}')
else:
return False