Fix prompt for symmetric encryption passphrase
This commit is contained in:
@@ -40,7 +40,7 @@ class UI:
|
||||
binary=self.pin_entry_binary,
|
||||
options=self.options_getter())
|
||||
|
||||
def get_passphrase(self):
|
||||
def get_passphrase(self, prompt='Passphrase:'):
|
||||
"""Ask the user for passphrase."""
|
||||
passphrase = None
|
||||
if self.cached_passphrase_ack:
|
||||
@@ -48,7 +48,7 @@ class UI:
|
||||
if passphrase is None:
|
||||
passphrase = interact(
|
||||
title='{} passphrase'.format(self.device_name),
|
||||
prompt='Passphrase:',
|
||||
prompt=prompt,
|
||||
description=None,
|
||||
binary=self.passphrase_entry_binary,
|
||||
options=self.options_getter())
|
||||
|
||||
@@ -118,8 +118,8 @@ class Handler:
|
||||
|
||||
def handle_get_passphrase(self, conn, _):
|
||||
"""Allow simple GPG symmetric encryption (using a passphrase)."""
|
||||
p1 = self.client.device.ui.get_passphrase('Symmetric encryption')
|
||||
p2 = self.client.device.ui.get_passphrase('Re-enter encryption')
|
||||
p1 = self.client.device.ui.get_passphrase('Symmetric encryption:')
|
||||
p2 = self.client.device.ui.get_passphrase('Re-enter encryption:')
|
||||
if p1 == p2:
|
||||
result = b'D ' + util.assuan_serialize(p1.encode('ascii'))
|
||||
keyring.sendline(conn, result, confidential=True)
|
||||
|
||||
Reference in New Issue
Block a user