trezor: support new passphrase entry mechanism

- passphrase can be prompted also when wallet is running (thus added to the wallet listener)
- device/host decision is now made on the host
This commit is contained in:
Dusan Klinec
2020-04-11 12:43:21 +02:00
parent 38612c1285
commit 86d21a34ba
15 changed files with 732 additions and 133 deletions

View File

@@ -490,19 +490,24 @@ Rectangle {
walletCreatedFromDevice(success);
}
function onWalletPassphraseNeeded(){
function onWalletPassphraseNeeded(on_device){
splash.close()
console.log(">>> wallet passphrase needed: ");
passwordDialog.onAcceptedPassphraseCallback = function() {
walletManager.onPassphraseEntered(passwordDialog.password);
devicePassphraseDialog.onAcceptedCallback = function(passphrase) {
walletManager.onPassphraseEntered(passphrase, false, false);
creatingWalletDeviceSplash();
}
passwordDialog.onRejectedPassphraseCallback = function() {
walletManager.onPassphraseEntered("", true);
devicePassphraseDialog.onWalletEntryCallback = function() {
walletManager.onPassphraseEntered("", true, false);
creatingWalletDeviceSplash();
}
passwordDialog.openPassphraseDialog()
devicePassphraseDialog.onRejectedCallback = function() {
walletManager.onPassphraseEntered("", false, true);
creatingWalletDeviceSplash();
}
devicePassphraseDialog.open(on_device)
}
function onDeviceButtonRequest(code){