From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#67012: 29.1;
 epa-sign-file pinentry loopback mode does not work with S/MIME
Date: Thu, 09 Nov 2023 13:21:32 +0200
Message-ID: <83v8abyxxf.fsf@gnu.org>
References: <u4jhvqus0@gentoo.org>
 <handler.67012.B.169951307615474.ack@debbugs.gnu.org>
 <ur0kzp8db_-_@gentoo.org>
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="22999"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 67012@debbugs.gnu.org
To: Ulrich Mueller <ulm@gentoo.org>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 09 12:22:47 2023
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1r137W-0005kc-RT
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Nov 2023 12:22:46 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1r137J-0006AN-2B; Thu, 09 Nov 2023 06:22:33 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1r137H-0006A4-OP
 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 06:22:31 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1r1379-0001fW-84
 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 06:22:31 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1r137m-00053k-9V
 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 06:23:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Eli Zaretskii <eliz@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 09 Nov 2023 11:23:02 +0000
Resent-Message-ID: <handler.67012.B67012.169952894819397@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 67012
X-GNU-PR-Package: emacs
Original-Received: via spool by 67012-submit@debbugs.gnu.org id=B67012.169952894819397
 (code B ref 67012); Thu, 09 Nov 2023 11:23:02 +0000
Original-Received: (at 67012) by debbugs.gnu.org; 9 Nov 2023 11:22:28 +0000
Original-Received: from localhost ([127.0.0.1]:46877 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1r137E-00052m-Hy
 for submit@debbugs.gnu.org; Thu, 09 Nov 2023 06:22:28 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35170)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@gnu.org>) id 1r137B-00052X-PE
 for 67012@debbugs.gnu.org; Thu, 09 Nov 2023 06:22:27 -0500
Original-Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>)
 id 1r136S-0001bU-6u; Thu, 09 Nov 2023 06:21:40 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=OItskvFIFuLWjWUO8JlkCeNmuyk0IfTmz435j1Y7WWk=; b=iowOBPrhq2jp
 /juzpP0v4M0WuQOoHMGWkwTWRqedGMfw1I4oqsUZRkcq7nyNe7zXqGnLnGmqgMcrVmDD0ys274iEo
 i5iUhR2myH2e/hf55TdjIy91hoWzs5HPojk2ESSu4t3Lf1ytjRGuVaszocU/amiRFcK/uwP0/SQ0D
 DVOMuL5S717bPnPplHhLdk2DEXUp0t4cHOs5JFSmsOjAzzAo+9OyKNithegorTIFa4OXsB2Z6RNnb
 YsuR+8K684o3mf7p7XqUAwhaHITUJqtPCToPc8U56QcaBxyRUVAnqZBgSLKunScZAq3ltJRmQBX7G
 pGMO3fOGfu5Kvp8QpkmBpg==;
In-Reply-To: <ur0kzp8db_-_@gentoo.org> (message from Ulrich Mueller on Thu, 09
 Nov 2023 10:46:08 +0100)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:274044
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/274044>

> From: Ulrich Mueller <ulm@gentoo.org>
> Date: Thu, 09 Nov 2023 10:46:08 +0100
> 
> Investigating a little further, I see that gpgsm is invoked like this:
> 
>    /usr/bin/gpgsm --no-tty --status-fd 1 --yes --output hello.txt.p7m --pinentry-mode loopback --sign -u XXXXXXXXXXXXXXXX -- hello.txt
> 
> I believe that the --passphrase-fd option is missing there.
> 
> Trying from the command line, the following works:
> 
>    $ /usr/bin/gpgsm --no-tty --status-fd 1 --yes --output hello.txt.p7m --pinentry-mode loopback --passphrase-fd 0 --sign -u XXXXXXXXXXXXXXXX -- hello.txt
> 
> It expects a passphrase from stdin (without a prompt), and after
> entering that, signing will succeed.
> 
> Then again, when I hack function epg--start to add "--passphrase-fd" "0"
> to args, the error no longer occurs, but now gpgsm hangs (waiting for
> input)? Also Emacs doesn't prompt for a passphrase.

Isn't this one more manifestation of the GnuPG 2.4.1?  See the entry
in etc/PROBLEMS whose heading is "Saving a file encrypted with GnuPG
via EasyPG hangs".

IOW, if you downgrade to an older version of GnuPG, do both problems
go away?

Thanks.