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: Thu, 17 May 2018 19:41:15 -0400 Message-ID: <87po1tj1es.fsf@gmail.com> References: <87h92cp9dh.fsf@wilson.bronger.org> <87k1sqoz6f.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1526600415 17115 195.159.176.226 (17 May 2018 23:40:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 May 2018 23:40:15 +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 Fri May 18 01:40:11 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 1fJSVE-0004Ic-K7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 May 2018 01:40:08 +0200 Original-Received: from localhost ([::1]:35498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJSXK-0004ua-4O for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 May 2018 19:42:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJSXC-0004sL-34 for bug-gnu-emacs@gnu.org; Thu, 17 May 2018 19:42:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJSX6-0003GN-Vy for bug-gnu-emacs@gnu.org; Thu, 17 May 2018 19:42:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59303) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJSX6-0003GD-PZ for bug-gnu-emacs@gnu.org; Thu, 17 May 2018 19:42:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fJSX4-00063V-3a; Thu, 17 May 2018 19:42: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: Thu, 17 May 2018 23:42: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.152660048523231 (code B ref 26298); Thu, 17 May 2018 23:42:02 +0000 Original-Received: (at 26298) by debbugs.gnu.org; 17 May 2018 23:41:25 +0000 Original-Received: from localhost ([127.0.0.1]:38966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJSWT-00062c-Ag for submit@debbugs.gnu.org; Thu, 17 May 2018 19:41:25 -0400 Original-Received: from mail-it0-f41.google.com ([209.85.214.41]:50637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJSWR-00062Q-Hh for 26298@debbugs.gnu.org; Thu, 17 May 2018 19:41:24 -0400 Original-Received: by mail-it0-f41.google.com with SMTP id p3-v6so11043240itc.0 for <26298@debbugs.gnu.org>; Thu, 17 May 2018 16:41:23 -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=8suAt9NbGQy6xh6sZGzuyP3p1fW/gjXw9NEFk+O0o8A=; b=WxAoW5763xYm8CzifiEwhtyG+aRLs9lyZrNpEpwx/6oO5ZguXYTntEO+B2tOPaEqry OEaXKrnz0cz7BK8HSqB8x08upAW2LCS1ww4dXEvRBOAuCrFUnf54GhcOsp9pxlDeBPUH yXg0fulO/Mkl5oYwcPut5tnczV1KSE00WjKcDHX1hEQkq2CspQJqDPeiJmu2VmlSlgNC D4rV3Be8y7vyexzMjO4R4eEwBvYak+3Iy7rmUROTVVraGJnFnUZUt/YFKa6+BGIdP8Ru diKan1Nuyaad84nbNEz/incQOvAhMGUvgjypbi11DdoSCwXV35XtJNFvqwgH6EYA1HGT Kcjw== 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=8suAt9NbGQy6xh6sZGzuyP3p1fW/gjXw9NEFk+O0o8A=; b=JIpwm3lUq3fVf7olnzxcKJy8LP0TA2KnS6Zzc9CiruZQJCO9ovAWtJrmN9BTqG4vEG l0L977ZlXKID9QsZZ5pnv6wOY7e+IlesogNy7BmNM6Ak3af1bfMQDD1otyQCa7pNhPXA AWRaSyVF4F7GUALsiocGP/TszvrJdqv+bAJZ2WvUqrDuo0Cr4LwA79cXN+q0AkdKAAvk 4wDHqy/5oe25EXGfYeA92Mf4LpZ1ujtz9SlsXsa/ni/2RF+gLUSXff1KKPA7iG9QCLPX FD7nqbvR6bFnxfgglMq7mrm0Z7EDpODCWMLurUBevCJPoxChM5PX0wqF1/enSSsyuuDh DeQw== X-Gm-Message-State: ALKqPwcuv1by8mEFOoPPNY+bhr36aEaO2c7Nzv4AGCPCPigprfkJoC9M N0kT2S+voHLCAeUtipWEEGE= X-Google-Smtp-Source: AB8JxZprvUX0fSPTUk8GlXDjE/d98Hqy3PlIxB6eVVXPxfWw4dbvgBEdyIZYM5UJ7Lo1frc2xjMNiQ== X-Received: by 2002:a24:f34d:: with SMTP id t13-v6mr4594694iti.123.1526600478042; Thu, 17 May 2018 16:41:18 -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 l202-v6sm4085713itb.26.2018.05.17.16.41.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 May 2018 16:41:16 -0700 (PDT) In-Reply-To: <87k1sqoz6f.fsf@gmail.com> (Noam Postavsky's message of "Sun, 29 Apr 2018 10:38:32 -0400") 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:146246 Archived-At: --=-=-= Content-Type: text/plain Noam Postavsky writes: > 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). Here's a more complete patch. I will push to master in a few days. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Move-epa-pinentry-mode-to-epg-config-Bug-26298.patch Content-Description: patch >From 034448c4d8e1adf85ef599e8612cdb1386433b09 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 29 Apr 2018 10:32:03 -0400 Subject: [PATCH v2] 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. * etc/NEWS: Announce name change. * lisp/epa-file.el (epa-file-insert-file-contents) (epa-file-write-region): * lisp/epa.el(epa-decrypt-file, epa-sign-file) (epa-encrypt-file, epa-decrypt-region) (epa-sign-region, epa-encrypt-region): Don't change epg-context-pinentry-mode from the default. --- etc/NEWS | 3 +++ lisp/epa-file.el | 2 -- lisp/epa.el | 30 ++---------------------------- lisp/epg-config.el | 22 ++++++++++++++++++++++ lisp/epg.el | 2 +- 5 files changed, 28 insertions(+), 31 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index c7ffb17ad3..4a4c8f2de4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -442,6 +442,9 @@ are formatted as MIME digests. *** 'message-forward-included-headers' has changed its default to exclude most headers when forwarding. +** 'epa-pinentry-mode' is renamed to 'epg-pinentry-mode', +It now applies to epg functions as well as epa functions. + * New Modes and Packages in Emacs 27.1 +++ diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 1de2f9ba2d..866a4ae03a 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -147,7 +147,6 @@ epa-file-insert-file-contents context (cons #'epa-progress-callback-function (format "Decrypting %s" file))) - (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (unwind-protect (progn (if replace @@ -236,7 +235,6 @@ epa-file-write-region (cons #'epa-progress-callback-function (format "Encrypting %s" file))) (setf (epg-context-armor context) epa-armor) - (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (condition-case error (setq string (epg-encrypt-string diff --git a/lisp/epa.el b/lisp/epa.el index a375cd6170..b9e7cbbb94 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." @@ -695,7 +676,6 @@ epa-decrypt-file #'epa-progress-callback-function (format "Decrypting %s..." (file-name-nondirectory decrypt-file)))) - (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (message "Decrypting %s..." (file-name-nondirectory decrypt-file)) (condition-case error (epg-decrypt-file context decrypt-file plain-file) @@ -791,7 +771,6 @@ epa-sign-file #'epa-progress-callback-function (format "Signing %s..." (file-name-nondirectory file)))) - (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (message "Signing %s..." (file-name-nondirectory file)) (condition-case error (epg-sign-file context file signature mode) @@ -822,7 +801,6 @@ epa-encrypt-file #'epa-progress-callback-function (format "Encrypting %s..." (file-name-nondirectory file)))) - (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (message "Encrypting %s..." (file-name-nondirectory file)) (condition-case error (epg-encrypt-file context file recipients cipher) @@ -865,7 +843,6 @@ epa-decrypt-region (cons #'epa-progress-callback-function "Decrypting...")) - (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (message "Decrypting...") (condition-case error (setq plain (epg-decrypt-string context (buffer-substring start end))) @@ -1070,7 +1047,6 @@ epa-sign-region (cons #'epa-progress-callback-function "Signing...")) - (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (message "Signing...") (condition-case error (setq signature (epg-sign-string context @@ -1159,7 +1135,6 @@ epa-encrypt-region (cons #'epa-progress-callback-function "Encrypting...")) - (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (message "Encrypting...") (condition-case error (setq cipher (epg-encrypt-string context @@ -1328,7 +1303,6 @@ epa-insert-keys ;; (cons ;; #'epa-progress-callback-function ;; "Signing keys...")) -;; (setf (epg-context-pinentry-mode context) epa-pinentry-mode) ;; (message "Signing keys...") ;; (epg-sign-keys context keys local) ;; (message "Signing keys...done"))) 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 e6b4af2b36..f79f2046de 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -207,7 +207,7 @@ 'epg-error output-file result operation - pinentry-mode + (pinentry-mode epg-pinentry-mode) (error-output "") error-buffer) -- 2.11.0 --=-=-=--