gpg: allow pinentry UI via "display=" option

This commit is contained in:
Roman Zeyde 2016-05-25 18:52:20 +03:00
parent a6a0c05f57
commit 3c4fb7a17b

View File

@ -114,6 +114,11 @@ def sign_digest(sock, keygrip, digest):
ttyname = subprocess.check_output('tty').strip()
options = ['ttyname={}'.format(ttyname)] # set TTY for passphrase entry
display = os.environ.get('DISPLAY')
if display is not None:
options.append('display={}'.format(display))
for opt in options:
assert _communicate(sock, 'OPTION {}'.format(opt)) == b'OK'