unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ulrich Mueller <ulm@gentoo.org>,
	Michael Albinus <michael.albinus@gmx.de>
Cc: 67012@debbugs.gnu.org
Subject: bug#67012: 29.1; epa-sign-file pinentry loopback mode does not work with S/MIME
Date: Wed, 15 Nov 2023 16:02:21 +0200	[thread overview]
Message-ID: <83jzqjqfma.fsf@gnu.org> (raw)
In-Reply-To: <u4jhvqus0@gentoo.org> (message from Ulrich Mueller on Thu, 09 Nov 2023 07:56:47 +0100)

> From: Ulrich Mueller <ulm@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@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?





  parent reply	other threads:[~2023-11-15 14:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83jzqjqfma.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=67012@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).