GNU bug report logs -
#67012
29.1; epa-sign-file pinentry loopback mode does not work with S/MIME
Previous Next
Full log
View this message in rfc822 format
> From: Ulrich Mueller <ulm <at> gentoo.org>
> Date: Thu, 09 Nov 2023 07:56:47 +0100
>
> 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 <at> 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
Michael, could you please look into this?
This bug report was last modified 1 year and 260 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.