vim-gnupg icon indicating copy to clipboard operation
vim-gnupg copied to clipboard

Report errors from gnupg more clearly

Open ao2 opened this issue 7 years ago • 4 comments

Hi,

when my encryption subkey expires I get a message like this from gnupg.vim:

The recipient "0xXXXXXXXXXXXXXXXX" is not in your public keyring!

Would it be possible to detect that the actual cause of the failure is an expired key and report that more clearly? The current message sounds a little off for this case.

Thanks, Antonio

ao2 avatar Aug 04 '16 13:08 ao2

I'll have to test that scenario to see what information gpg provides. Thanks for the report!

jamessan avatar Aug 04 '16 14:08 jamessan

I updated the title as the issue is more generic.

Today, on a new system, gnupg.vim failed with:

Message could not be decrypted!

with no further details.

Running gpg from the console it turned out I was missing pinentry-tty, gpg returns this message:

gpg: public key decryption failed: No pinentry
gpg: decryption failed: No secret key

Would it be possible for vim-gnupg to propagate such messages to the user?

Thanks, Antonio

ao2 avatar Feb 20 '18 11:02 ao2

Would it be possible for vim-gnupg to propagate such messages to the user?

Right now, not easily. I've been contemplating changing the code to use the (neo)vim's job APIs, which would make it easier to distinguish stderr/stdout and do better error reporting.

However, I would probably want to get the change to use loopback pinentry done first. pinentry-curses (and probably pinentry-tty) really aren't meant to be used in combination with something like Vim, since they fight over the terminal. This would also resolve #32.

jamessan avatar Feb 20 '18 14:02 jamessan

I see, thanks for the info.

ao2 avatar Feb 20 '18 16:02 ao2