all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#67012: 29.1; epa-sign-file pinentry loopback mode does not work with S/MIME
@ 2023-11-09  6:56 Ulrich Mueller
       [not found] ` <handler.67012.B.169951307615474.ack@debbugs.gnu.org>
  2023-11-15 14:02 ` Eli Zaretskii
  0 siblings, 2 replies; 21+ messages in thread
From: Ulrich Mueller @ 2023-11-09  6:56 UTC (permalink / raw)
  To: 67012

I was originally trying to sign e-mail messages with S/MIME using
mml-secure-sign-smime followed by message-send, which fails when I
customize epg-pinentry-mode as loopback.

The problem also occurs with epa-sign-file, which is easier to reproduce
(because it doesn't need as much configuration). So I am reporting the
bug for this command.

To reproduce, emacs -Q, then execute in the *scratch* buffer:

   (write-region "hello\n" nil "hello.txt")
   (require 'epa)

   (let ((epg-pinentry-mode 'loopback)
         (epa-protocol 'CMS))
     (epa-sign-file
      "hello.txt"
      (epa-select-keys (epg-make-context epa-protocol) "Key:" nil t)
      'normal))

This asks interactively to select a key. After doing so, it fails with
the following error (shown in an "*Error* (EPA Info)" buffer):

   Error while signing with "/usr/bin/gpgsm":

   gpgsm: ignoring gpg-agent inquiry 'PASSPHRASE'
   gpgsm: error creating signature: No passphrase given <GPG Agent>

Debugger *Backtrace* (key IDs x-ed out):

   Debugger entered--Lisp error: (epg-error "Sign failed" "")
     signal(epg-error ("Sign failed" ""))
     epa-sign-file("hello.txt" (#s(epg-key :owner-trust nil :sub-key-list (#s(epg-sub-key :validity nil :capability (encrypt sign) :secret-p nil :algorithm 1 :length 4096 :id "XXXXXXXXXXXXXXXX" :creation-time 20231107 :expiration-time 20251106 :fingerprint "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")) :user-id-list (#s(epg-user-id :validity nil :string (("CN" . "Ulrich Müller") ("OU" . "Institut fuer Kernphysik") ("O" . "Johannes Gutenberg-Universitaet Mainz") ("L" . "Mainz") ("ST" . "Rheinland-Pfalz") ("C" . "DE")) :signature-list nil) #s(epg-user-id :validity nil :string "<ulm@uni-mainz.de>" :signature-list nil)))) normal)
     (let ((epg-pinentry-mode 'loopback) (epa-protocol 'CMS)) (epa-sign-file "hello.txt" (epa-select-keys (epg-make-context epa-protocol) "Key:" nil t) 'normal))
     (progn (let ((epg-pinentry-mode 'loopback) (epa-protocol 'CMS)) (epa-sign-file "hello.txt" (epa-select-keys (epg-make-context epa-protocol) "Key:" nil t) 'normal)))
     eval((progn (let ((epg-pinentry-mode 'loopback) (epa-protocol 'CMS)) (epa-sign-file "hello.txt" (epa-select-keys (epg-make-context epa-protocol) "Key:" nil t) 'normal))) t)
     elisp--eval-last-sexp(t)
     eval-last-sexp(t)
     eval-print-last-sexp(nil)
     funcall-interactively(eval-print-last-sexp nil)
     call-interactively(eval-print-last-sexp nil nil)
     command-execute(eval-print-last-sexp)

When I change epg-pinentry-mode to ask or epa-protocol to OpenPGP in
the let-binding, things work as expected. In other words, only the
combination of S/MIME and pinentry loopback fails.

   |          | OpenPGP | CMS   |
   |----------+---------+-------|
   | ask      | works   | works |
   | loopback | works   | fails |

I use pinentry-gnome3, in case this should matter:

   $ readlink /usr/bin/pinentry
   pinentry-gnome3


In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.0) of 2023-10-24 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101009
System Description: Gentoo Linux

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --datarootdir=/usr/share
 --disable-silent-rules --docdir=/usr/share/doc/emacs-29.1-r5
 --htmldir=/usr/share/doc/emacs-29.1-r5/html --libdir=/usr/lib64
 --program-suffix=-emacs-29 --includedir=/usr/include/emacs-29
 --infodir=/usr/share/info/emacs-29 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --with-pdumper --enable-acl
 --with-dbus --with-modules --with-gameuser=:gamestat --with-libgmp
 --with-gpm --without-native-compilation --without-json
 --without-kerberos --without-kerberos5 --with-lcms2 --with-xml2
 --without-mailutils --without-selinux --with-small-ja-dic
 --without-sqlite3 --with-gnutls --without-libsystemd --with-threads
 --without-tree-sitter --without-wide-int --with-sound=alsa --with-zlib
 --with-x --without-pgtk --without-ns --without-gconf --with-gsettings
 --without-toolkit-scroll-bars --with-xpm --with-xft --with-cairo
 --with-harfbuzz --with-libotf --with-m17n-flt --with-x-toolkit=lucid
 --with-xaw3d --with-gif --with-jpeg --with-png --with-rsvg --with-tiff
 --without-webp --with-imagemagick --with-dumping=pdumper
 'CFLAGS=-march=native -ggdb -O2 -pipe' 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG LCMS2 LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF X11 XAW3D XDBE XIM XINPUT2
XPM LUCID ZLIB

Important settings:
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: POSIX
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-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
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug org-element org-persist org-id
org-refile avl-tree generator oc-basic ol-eww eww xdg url-queue mm-url
ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015
mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku
url-file svg dom browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie generate-lisp-file url-domsuf
url-util url-parse auth-source cl-seq eieio eieio-core cl-macs json map
url-vars gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud
nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int
gnus-range message sendmail mailcap yank-media puny rfc822 mml mml-sec
password-cache mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util mail-utils range mm-util mail-prsvr wid-edit
ol-docview doc-view filenotify jka-compr image-mode exif dired
dired-loaddefs ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi
org-link-doi org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-src ob-comint org-pcomplete pcomplete comint ansi-osc ansi-color
ring org-list org-footnote org-faces org-entities noutline outline icons
ob-emacs-lisp ob-core ob-eval org-cycle org-table ol rx org-fold
org-fold-core org-keys oc org-loaddefs cal-menu calendar cal-loaddefs
org-version org-compat org-macs format-spec misearch multi-isearch
epa-file thingatpt shortdoc text-property-search cl-extra help-fns
radix-tree cl-print byte-opt gv bytecomp byte-compile debug backtrace
help-mode find-func time-date subr-x cl-loaddefs cl-lib epa derived epg
rfc6068 epg-config rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine 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
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 251336 23421)
 (symbols 48 19880 0)
 (strings 32 72160 3511)
 (string-bytes 1 2156491)
 (vectors 16 36926)
 (vector-slots 8 414217 18678)
 (floats 8 337 164)
 (intervals 56 2847 255)
 (buffers 976 16))





^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-11-25 16:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09  6:56 bug#67012: 29.1; epa-sign-file pinentry loopback mode does not work with S/MIME Ulrich Mueller
     [not found] ` <handler.67012.B.169951307615474.ack@debbugs.gnu.org>
2023-11-09  9:46   ` Ulrich Mueller
2023-11-09 11:21     ` Eli Zaretskii
2023-11-09 11:43       ` Ulrich Mueller
2023-11-15 14:02 ` Eli Zaretskii
2023-11-15 15:07   ` Michael Albinus
2023-11-15 15:32     ` Michael Albinus
2023-11-15 16:48     ` Eli Zaretskii
2023-11-15 17:13       ` Michael Albinus
2023-11-16  9:54       ` Ulrich Mueller
2023-11-17 11:40         ` Ulrich Mueller
2023-11-19  5:43           ` Eli Zaretskii
2023-11-19 11:13             ` Ulrich Mueller
2023-11-25  9:53               ` Eli Zaretskii
2023-11-25 11:16                 ` Ulrich Mueller
2023-11-25 11:40                   ` Michael Albinus
2023-11-25 12:17                     ` Ulrich Mueller
2023-11-25 14:59                       ` Ulrich Mueller
2023-11-25 15:44                         ` Michael Albinus
2023-11-25 16:32                           ` Ulrich Mueller
2023-11-25 12:27                   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.