trezor: split pinentry tool into a separate file

This commit is contained in:
Roman Zeyde
2018-02-27 11:17:53 +02:00
parent 55a899f929
commit 08d81c992c
3 changed files with 8 additions and 3 deletions

View File

@@ -16,9 +16,7 @@ log = logging.getLogger(__name__)
def _message_box(label, sp=subprocess):
"""Launch an external process for PIN/passphrase entry GUI."""
cmd = ('import sys, pymsgbox; '
'sys.stdout.write(pymsgbox.password(sys.stdin.read()))')
args = [sys.executable, '-c', cmd]
args = [sys.executable, '-m', 'libagent.device.ui.simple']
p = sp.Popen(args=args, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
out, err = p.communicate(label.encode('ascii'))
exitcode = p.wait()

View File

@@ -0,0 +1 @@
"""UIs for PIN/passphrase entry."""

View File

@@ -0,0 +1,6 @@
"""Simple, cross-platform UI for entering a PIN/passhprase."""
import sys
import pymsgbox
sys.stdout.write(pymsgbox.password(sys.stdin.read()))