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

From: Iñigo Serna <[email-masked]>
Date: Tue, 08 Mar 2016 11:58:58 +0100

Since a couple of months ago emacs 25.0.x (last tested as 2016/03/08
from git master) can't open encrypted files (using symmetric keys), as
epa can't find secret keys from gpg.

This is the error message I get:
"""
Error while decrypting with "gpg":

gpg: encrypted with 2048-bit RSA key, ID C0ED9C8489B28C43, created 2016-01-12
      "Iñigo Serna (XXX.YY) <[email-masked]>"
gpg: decryption failed: No secret key
"""

I use gpg (not gpg2) so I added '(setq epg-gpg-program "gpg")' to my
configuration as new epa defaults to gpg2 when I've run "emacs -Q -nw".

`epa-list-secret-keys` does not find any keys.

This same configuration works ok with 24.5.1 (from Fedora 23 x86_64), and
even `epa-list-secret-keys` shows the private keys correctly.

#########################################################################

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from 'emacs -Q':

[SEE ABOVE]

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    'bt full' and 'xbacktrace'.
For information about debugging Emacs, please read the file
/opt/emacs/share/emacs/25.1.50/etc/DEBUG.

In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.7)
 of 2016-03-08 built on inigo.katxi.org
Repository revision: 80864c2a04597d31ba453c9af69d35b15c4e1e24
System Description:     Fedora release 23 (Twenty Three)

Configured using:
 'configure --prefix=/usr/ --libdir=/usr/lib64 --sysconfdir=/etc
 --disable-static --prefix=/opt/emacs --with-xwidgets
 --with-x-toolkit=gtk3 CFLAGS=-Os'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3
X11 XWIDGETS

Important settings:
  value of $LANG: en_GB.utf8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
"gpg"
Decrypting /home/inigo/personal/agenda/other.org.gpg...done
epa-file--find-file-not-found-function: Opening input file: Decryption failed, No secret key: C0ED9C8489B28C43
"gpg"

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired dired-loaddefs format-spec
rfc822 mml easymenu mml-sec password-cache gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils epa-file epa derived epg epg-config
term/xterm xterm time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting xwidget-internal move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 91217 6511)
 (symbols 48 19819 0)
 (miscs 40 52 107)
 (strings 32 14550 4887)
 (string-bytes 1 415390)
 (vectors 16 9702)
 (vector-slots 8 371442 10588)
 (floats 8 171 795)
 (intervals 56 222 14)
 (buffers 976 13)
 (heap 1024 34449 1624))