From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#26298: 26.0.50; Gnus fails to sign mail with PGP Date: Sun, 29 Apr 2018 10:38:32 -0400 Message-ID: <87k1sqoz6f.fsf@gmail.com> References: <87h92cp9dh.fsf@wilson.bronger.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1525012633 22344 195.159.176.226 (29 Apr 2018 14:37:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 29 Apr 2018 14:37:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Joseph Mingrone , 26298@debbugs.gnu.org, Torsten Bronger To: Toon Claes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 29 16:37:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fCnRq-0005fI-Q5 for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Apr 2018 16:37:07 +0200 Original-Received: from localhost ([::1]:55784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fCnTx-0002jU-Mc for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Apr 2018 10:39:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fCnTn-0002dL-7T for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2018 10:39:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fCnTk-0000wO-3S for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2018 10:39:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fCnTj-0000wE-Sm for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2018 10:39:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fCnTi-0006q5-F7; Sun, 29 Apr 2018 10:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Sun, 29 Apr 2018 14:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26298 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 26298-submit@debbugs.gnu.org id=B26298.152501272226263 (code B ref 26298); Sun, 29 Apr 2018 14:39:02 +0000 Original-Received: (at 26298) by debbugs.gnu.org; 29 Apr 2018 14:38:42 +0000 Original-Received: from localhost ([127.0.0.1]:43001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fCnTO-0006pU-BI for submit@debbugs.gnu.org; Sun, 29 Apr 2018 10:38:42 -0400 Original-Received: from mail-io0-f174.google.com ([209.85.223.174]:45231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fCnTN-0006pF-3s for 26298@debbugs.gnu.org; Sun, 29 Apr 2018 10:38:41 -0400 Original-Received: by mail-io0-f174.google.com with SMTP id c9-v6so1215823iob.12 for <26298@debbugs.gnu.org>; Sun, 29 Apr 2018 07:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xs8/1l89nrvvLH8xFxmfjq0jRnMeCFHyhYXExrE0a18=; b=Qsw5RnMO/7GtxAi/H8MMcpB8P56FCXi7kZbAugX6SuitstoZLSsEA+0gY9OD+NAPXm OHpvciV+T/ePW4H2Ozie22jv2y5QTgg7cpY0yF9WnjRMdcPFGYnh9r+VKcR0aMXZTyn1 qZYSUS5e1AFNQszK30WarUMFD4gTYsVY0FDb3EJbdLZpzYZJk78VzUsCp0FriYiN94F4 qGe41XC629CI1D0XIgMoqQ6wUG92iEL0N16zFb6Yl1H/YvFIJXLgrb8vzXBtNv8vdSgl oqTYF6Vv/AoFt+QpveRs7iQE/GHJWEYr9KT7IzsF5aeHgaaa1HgdDdRhpt9bV4F3PDgN dbKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=xs8/1l89nrvvLH8xFxmfjq0jRnMeCFHyhYXExrE0a18=; b=g1ke/mU2eKaurJYzqPni8gvsgGn7mSYNUejl4rHDcIqCvE2egG9DVutRgvTPmUFYQn 1aiDL6+0EoUrS0XB0NRuJ9xnSUT320kiCiFTU3PHmsFz2LslCMOclhVDV32R+S6L5mag YH2L/otUhd8cL4TJXCGW61WGwHv7JyZ/KYuz/VawjJ2kRNEO43r5CJ+lPvw8P/wzmv6B dj6QJ1ERUD6rebLeQwsAp/XTa5AMVbO57FRKEGske20nfPbfpkFh0W9chIR+lExIG7Gx LISjjhTi+TXhyo0vNwmvJ8nX/DCksyw6ydLnhUjJsDX7IeKM2TqI6UDqYm5rq0fhSHYY qJTg== X-Gm-Message-State: ALQs6tBwWgTKXpLFI9l5pxTH5+oFfExa6SoovbclWx0yUXVenjw2wN02 51YI2LmaovgaaNnWLLVpqENOOg== X-Google-Smtp-Source: AB8JxZp6DFig2q6CYY0b6JuDJVhogR+hxZzYZtr9a8/hUs9wZ5Sl8/EXsIqvHCA8LI3E7lzZo+BXQQ== X-Received: by 2002:a6b:bc02:: with SMTP id m2-v6mr9456085iof.2.1525012715476; Sun, 29 Apr 2018 07:38:35 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id n142-v6sm2549371itn.38.2018.04.29.07.38.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Apr 2018 07:38:34 -0700 (PDT) In-Reply-To: (Toon Claes's message of "Mon, 14 Aug 2017 23:19:26 +0200 (CEST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:145820 Archived-At: --=-=-= Content-Type: text/plain Toon Claes writes: > If I add the following line to `mml-secure-epg-sign', I can successfully > sign my email: > > #+begin_src emacs-lisp :tangle yes > (setf (epg-context-pinentry-mode context) 'loopback) > #+end_src > > Now I also understand why `epa-sign-file' works, I have set > `(setq epa-pinentry-mode 'loopback)' in my init.el. > > But, I could use some advice on building a proper fix that would work > for everyone. We could do something similar like as epa.el does, and add > yet another defcustom, but doesn't feel very DRY. > So I hope someone can chime in to give some advice. So perhaps the best solution is simply rename epa-pinentry-mode to epg-pinentry-mode, and use it is as the default epg-context-pinentry-mode value (see attached). --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=v1-0001-Move-epa-pinentry-mode-to-epg-config-Bug-26298.patch Content-Description: patch >From 937c2cf8a751bbc7581a0ca187f4cac023e607b3 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 29 Apr 2018 10:32:03 -0400 Subject: [PATCH v1] Move epa-pinentry-mode to epg-config (Bug#26298) * lisp/epa.el (epa-pinentry-mode): Make into obsolete alias for... * lisp/epg-config.el (epg-pinentry-mode): ...this new user option. * lisp/epg.el (epg-context): Use it as the default value for pinentry-mode. --- lisp/epa.el | 23 ++--------------------- lisp/epg-config.el | 22 ++++++++++++++++++++++ lisp/epg.el | 2 +- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/lisp/epa.el b/lisp/epa.el index 5c237bca9b..e03933af30 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -56,27 +56,8 @@ epa-info-window-height :type 'integer :group 'epa) -;; In the doc string below, we say "symbol `error'" to avoid producing -;; a hyperlink for `error' the function. -(defcustom epa-pinentry-mode nil - "The pinentry mode. - -GnuPG 2.1 or later has an option to control the behavior of -Pinentry invocation. The value should be the symbol `error', -`ask', `cancel', or `loopback'. See the GnuPG manual for the -meanings. - -In epa commands, a particularly useful mode is `loopback', which -redirects all Pinentry queries to the caller, so Emacs can query -passphrase through the minibuffer, instead of external Pinentry -program." - :type '(choice (const nil) - (const ask) - (const cancel) - (const error) - (const loopback)) - :group 'epa - :version "25.1") +(define-obsolete-variable-alias + 'epa-entry-mode 'epg-entry-mode "27.1") (defgroup epa-faces nil "Faces for epa-mode." diff --git a/lisp/epg-config.el b/lisp/epg-config.el index d30ebea2d6..ea57adc12f 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el @@ -74,6 +74,28 @@ epg-passphrase-coding-system :group 'epg :type 'symbol) + +;; In the doc string below, we say "symbol `error'" to avoid producing +;; a hyperlink for `error' the function. +(defcustom epg-pinentry-mode nil + "The pinentry mode. + +GnuPG 2.1 or later has an option to control the behavior of +Pinentry invocation. The value should be the symbol `error', +`ask', `cancel', or `loopback'. See the GnuPG manual for the +meanings. + +A particularly useful mode is `loopback', which redirects all +Pinentry queries to the caller, so Emacs can query passphrase +through the minibuffer, instead of external Pinentry program." + :type '(choice (const nil) + (const ask) + (const cancel) + (const error) + (const loopback)) + :group 'epa + :version "27.1") + (defcustom epg-debug nil "If non-nil, debug output goes to the \" *epg-debug*\" buffer. Note that the buffer name starts with a space." diff --git a/lisp/epg.el b/lisp/epg.el index dc0e2df583..c42520e3db 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -211,7 +211,7 @@ epg--gv-nreverse output-file result operation - pinentry-mode + (pinentry-mode epg-pinentry-mode) (error-output "") error-buffer) -- 2.11.0 --=-=-=--