Subject: bug#22941: 25.1.50; epa-list-secret-keys does not find gpg private keys

From: Iñigo Serna <[email-masked]>
Date: Mon, 14 Mar 2016 10:13:42 +0100

Hi

Daiki Ueno <[email-masked]> writes:
> That's strange indeed.  Are you able to check what is happening by
> setting (setq epg-debug t) and looking at the " *epg-debug*" buffer
> (note the first whitespace)?  The buffer should contain the actual
> command-line and the interactions between Emacs and the "gpg" command.

You were right, it is using gpg2!

GPG_AGENT_INFO is not set
/usr/bin/gpg2 --no-tty --status-fd 1 --yes --enable-progress-filter --command-fd 0 --output /tmp/epg-output8110Oun --decrypt --/home/inigo/personal/agenda/other.org.gpg
[GNUPG:] PROGRESS /home/inigo/personal ? 0 3518
[GNUPG:] ENC_TO C0ED9C8489B28C43 1 0
[GNUPG:] NO_SECKEY C0ED9C8489B28C43
[GNUPG:] BEGIN_DECRYPTION
[GNUPG:] DECRYPTION_FAILED
[GNUPG:] PROGRESS /home/inigo/personal ? 3518 3518
[GNUPG:] END_DECRYPTION

I tested setting `epg-gpg-program' to something like "xxx", error buffer
displays "xxx" as gpg program in message, but debug shows
"/usr/bin/gpg2" again.

Note I have gpg and gpg2 both installed on my system.
I can't uninstall gpg2 package, but I've tried renaming /usr/bin/gpg2 to
somenthing else; in this case the encrypted file is correctly opened
even without setting `epg-gpg-program' to "gpg".
So I think problem comes that when epa finds gpg2 binary in system it
does not honore `epg-gpg-program' setting.

Thanks,
Iñigo Serna