jamessan / vim-gnupg

This script implements transparent editing of gpg encrypted files.
http://www.vim.org/scripts/script.php?script_id=3645
728 stars 73 forks source link

pinentry-curses passphrase prompt flashes and disappears before I can type in passphrase #47

Closed sprater closed 9 years ago

sprater commented 9 years ago

I noticed this started happening a few months ago, after a system upgrade (I'm on RHEL 6).

When I attempt to open an encrypted file in a terminal session, vim-gnupg gets as far as the pinentry-curses prompt box on my terminal, but then immediately exits the pinentry program, and leaves me in an empty buffer, with the message that the file cannot be decrypted.

I can open the file with vim from the command line and supply the passphrase via pinentry-gtk-2 when logged in to an X session, and I can decrypt the file manually with gpg in a terminal session; the pinentry-curses prompt shows as normal, and waits for me to press enter to submit my passphrase, then decrypt the file.

My GPG_TTY environment variable is correctly set when I try to decrypt a file.

So it appears to be some interaction between vim and pinentry-curses, where it is not waiting for pinentry-curses to return?

Let me know if you'd like me to supply debugging output; I did generate a GPGDebugLog, but it did not show anything beyond what I describe above.

thanks in advance.

jamessan commented 9 years ago

What versions of pinentry and vim are you using? Can you provide the log with GPGDebugLevel=3? Have you changed any of the plugin's config variables?

sprater commented 9 years ago

I'm running RedHat Enterprise Linux 6.7; the pinentry and VIM packages are from that distribution. pinentry: 0.7.6 vim: 7.4, with patches 1-207, 209-629

I'll send you a link to the gist with the GPGDebugLevel 3 output. Unfortunately, it's not very enlightening: the problem seems to be that as soon as pinentry-curses screen appears, stdin is closed immediately without giving me a chance to enter the passphrase.

sprater commented 9 years ago

I've done some more playing around, and determined that it's a problem relating to the interaction of the terminal settings, gpg-agent and pinentry-curses.

I've put in place a workaround by setting TERM=vt100 at the beginning of the vim command line; when the terminal is set to vt100, pinentry-curses displays correctly and waits for me to enter the passphrase.

Since this is not a problem with the vim plugin per se, I'm closing this issue.