unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31603: 27.0.50; pinentry loopback disappeared
@ 2018-05-26  8:46 adrian.lanz
  2018-05-26 11:14 ` Basil L. Contovounesios
  0 siblings, 1 reply; 6+ messages in thread
From: adrian.lanz @ 2018-05-26  8:46 UTC (permalink / raw)
  To: 31603

With 'allow-loopback-pinentry' in gpg-agent.conf and (setq
epa-pinentry-mode 'loopback) in .emacs, I enjoy reliable pass-phrase
prompting and entering in the Emacs minibuffer for quite some time (at
least since September 2016).

Now unexpectedly, pinentry-curses started to pop-up for pass-phrase
prompting. I suspect commit 302e500087fd4cc1c5f37ec87c98e828b22aaa05
being the cause. I did not find a way to get pinentry-loopback back and
working.


Remark 1: The default graphical mode pinentry (X11 or similar) is
available as expected.

Remark 2: Text mode pinentry-curses is very unreliable (under my
configuration). Several attempts are often needed to get the pass-phrase
accepted. When pinentry-curses is automatically called to find-file a
*.gpg file, mangled parts of the pass-phrase are inserted as clear text
on top of the Emacs buffer into which the file is loaded. Mangled
pass-phrase parts may also otherwise passed to Emacs (seems as key
strokes with unpredictable effects).

[This bug report is, however, not intended towards pinentry-curses, but
pinentry-loopback. On the other hand, pinentry-curses seems the
fall-back of pinentry-loopback (and graphical mode pinentry).]

Use case: I access the system (at work) also on a daily basis from
outside - through VPN/SSH and in terminal/text mode, so that a
functioning text mode pinentry is a must (e.g. encrypted .authinfo.gpg
for Emacs/Gnus).

Workaround: I detected https://wiki.gnupg.org/AgentForwarding as an
intermediate solution - graphical pinentry, and external access with a
linux laptop, GnuPG configured.



Ubuntu 16.04.4 LTS (Stable)

GNU Emacs 27.0.50 (Snapshot)
[http://ppa.launchpad.net/ubuntu-elisp/ppa/ubuntu xenial main]





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#31603: 27.0.50; pinentry loopback disappeared
  2018-05-26  8:46 bug#31603: 27.0.50; pinentry loopback disappeared adrian.lanz
@ 2018-05-26 11:14 ` Basil L. Contovounesios
  2018-05-26 12:49   ` adrian.lanz
  0 siblings, 1 reply; 6+ messages in thread
From: Basil L. Contovounesios @ 2018-05-26 11:14 UTC (permalink / raw)
  To: adrian.lanz; +Cc: 31603

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

<adrian.lanz@wsl.ch> writes:

> With 'allow-loopback-pinentry' in gpg-agent.conf and (setq
> epa-pinentry-mode 'loopback) in .emacs, I enjoy reliable pass-phrase
> prompting and entering in the Emacs minibuffer for quite some time (at
> least since September 2016).
>
> Now unexpectedly, pinentry-curses started to pop-up for pass-phrase
> prompting. I suspect commit 302e500087fd4cc1c5f37ec87c98e828b22aaa05
> being the cause. I did not find a way to get pinentry-loopback back and
> working.

Have you tried replacing (setq epa-pinentry-mode 'loopback) with
(setq epg-pinentry-mode 'loopback)?  If doing this solves your issue,
then I think the problem with the referenced commit [1: 302e500087] is
that it uses define-obsolete-variable-alias (see docstring) in epa.el
after epg-pinentry-mode has already been defined in epg-config.el.

[1: 302e500087]: 2018-05-23 07:53:58 -0400
  Move epa-pinentry-mode to epg-config (Bug#26298)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=302e500087fd4cc1c5f37ec87c98e828b22aaa05

In other words, should we do the following?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Place-epg-pinentry-mode-varalias-before-defcustom.patch --]
[-- Type: text/x-diff, Size: 1295 bytes --]

From e0577acadc471ffe64fb31a2a3ea457046cf1944 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Sat, 26 May 2018 12:09:15 +0100
Subject: [PATCH] Place epg-pinentry-mode varalias before defcustom

* lisp/epa.el (epa-pinentry-mode):
Move obsolete varalias from here...
* lisp/epg-config.el (epg-pinentry-mode): ...to here. (bug#31603)
---
 lisp/epa.el        | 3 ---
 lisp/epg-config.el | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/epa.el b/lisp/epa.el
index 16621659a6..c3938e90a7 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -56,9 +56,6 @@ epa-info-window-height
   :type 'integer
   :group 'epa)
 
-(define-obsolete-variable-alias
-  'epa-pinentry-mode 'epg-pinentry-mode "27.1")
-
 (defgroup epa-faces nil
   "Faces for epa-mode."
   :version "23.1"
diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index 9d9bd7101e..98f458d996 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -69,6 +69,8 @@ epg-passphrase-coding-system
   "Coding system to use with messages from `epg-gpg-program'."
   :type 'symbol)
 
+(define-obsolete-variable-alias
+  'epa-pinentry-mode 'epg-pinentry-mode "27.1")
 
 ;; In the doc string below, we say "symbol `error'" to avoid producing
 ;; a hyperlink for `error' the function.
-- 
2.17.0


[-- Attachment #3: Type: text/plain, Size: 11 bytes --]


-- 
Basil

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#31603: 27.0.50; pinentry loopback disappeared
  2018-05-26 11:14 ` Basil L. Contovounesios
@ 2018-05-26 12:49   ` adrian.lanz
  2018-05-26 16:04     ` Noam Postavsky
  0 siblings, 1 reply; 6+ messages in thread
From: adrian.lanz @ 2018-05-26 12:49 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 31603

On Sam 26 Mai 2018 (12:14:13 +0100) Basil L. Contovounesios writes:

> Have you tried replacing (setq epa-pinentry-mode 'loopback) with
> (setq epg-pinentry-mode 'loopback)?  If doing this solves your issue,
> then I think the problem with the referenced commit [1: 302e500087] is
> that it uses define-obsolete-variable-alias (see docstring) in epa.el
> after epg-pinentry-mode has already been defined in epg-config.el.

This was actually the first thing I tried (and I just tried it again to
be sure): pinentry-loopback still fails.







^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#31603: 27.0.50; pinentry loopback disappeared
  2018-05-26 12:49   ` adrian.lanz
@ 2018-05-26 16:04     ` Noam Postavsky
  2018-05-27 16:41       ` adrian.lanz
  0 siblings, 1 reply; 6+ messages in thread
From: Noam Postavsky @ 2018-05-26 16:04 UTC (permalink / raw)
  To: adrian.lanz; +Cc: Basil L. Contovounesios, 31603

> On Sam 26 Mai 2018 (12:14:13 +0100) Basil L. Contovounesios writes:
>
>> then I think the problem with the referenced commit [1: 302e500087] is
>> that it uses define-obsolete-variable-alias (see docstring) in epa.el
>> after epg-pinentry-mode has already been defined in epg-config.el.

Oh, you're right

    emacs -Q --eval "(setq epa-loopback-mode 'loopback)" -l epa

Then <f1> v epa-loopback-mode RET shows that it has been reset to nil.


adrian.lanz@wsl.ch writes:

> This was actually the first thing I tried (and I just tried it again to
> be sure): pinentry-loopback still fails.

Well, it's at least part of the problem.  Can you double check that
epa-loopback-mode has the right value?  When I apply Basil's patch, add
'allow-loopback-pinentry' to ~/.gnupg/gpg-agent.conf and (setq
epa-loopback-mode 'loopback), then M-x epa-sign-file does give me a
prompt in the minibuffer, as expected.

Could you also double check that reverting 302e500087 fixes your
problem?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#31603: 27.0.50; pinentry loopback disappeared
  2018-05-26 16:04     ` Noam Postavsky
@ 2018-05-27 16:41       ` adrian.lanz
  2018-05-27 18:21         ` Noam Postavsky
  0 siblings, 1 reply; 6+ messages in thread
From: adrian.lanz @ 2018-05-27 16:41 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Basil L. Contovounesios, 31603

On Sa 26 Mai 2018 (12:04:46 -0400) Noam Postavsky writes:

>> On Sam 26 Mai 2018 (12:14:13 +0100) Basil L. Contovounesios writes:
>>
>>> then I think the problem with the referenced commit [1: 302e500087] is
>>> that it uses define-obsolete-variable-alias (see docstring) in epa.el
>>> after epg-pinentry-mode has already been defined in epg-config.el.
>
> Oh, you're right
>
>     emacs -Q --eval "(setq epa-loopback-mode 'loopback)" -l epa
>
> Then <f1> v epa-loopback-mode RET shows that it has been reset to nil.
>
>
> adrian.lanz@wsl.ch writes:
>
>> This was actually the first thing I tried (and I just tried it again to
>> be sure): pinentry-loopback still fails.
>
> Well, it's at least part of the problem.  Can you double check that
> epa-loopback-mode has the right value?  When I apply Basil's patch, add
> 'allow-loopback-pinentry' to ~/.gnupg/gpg-agent.conf and (setq
> epa-loopback-mode 'loopback), then M-x epa-sign-file does give me a

(The variable name is epa-pinentry-mode, not epa-loopback-mode.)

> prompt in the minibuffer, as expected.

I confirm setting (setq epg-pinentry-mode 'loopback) in .emacs init file
solves the problem (I get again the minibuffer prompt).

The <contovob <at> tcd.ie> proposed patch leads to minibuffer passphrase
prompts, even with only the old (now obsoleted) variable (setq
epa-pinentry-mode 'loopback) present in the .emacs init file. In other
words, with this patch, users do not have to change the configuration
right away.

Thanks!





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#31603: 27.0.50; pinentry loopback disappeared
  2018-05-27 16:41       ` adrian.lanz
@ 2018-05-27 18:21         ` Noam Postavsky
  0 siblings, 0 replies; 6+ messages in thread
From: Noam Postavsky @ 2018-05-27 18:21 UTC (permalink / raw)
  To: adrian.lanz; +Cc: Basil L. Contovounesios, 31603

tags 31603 fixed
close 31603 27.1
quit

adrian.lanz@wsl.ch writes:

> (The variable name is epa-pinentry-mode, not epa-loopback-mode.)

Oops, that's what I get for typing from memory instead of copying
straight from the working example.

> I confirm setting (setq epg-pinentry-mode 'loopback) in .emacs init file
> solves the problem (I get again the minibuffer prompt).
>
> The <contovob <at> tcd.ie> proposed patch leads to minibuffer passphrase
> prompts, even with only the old (now obsoleted) variable (setq
> epa-pinentry-mode 'loopback) present in the .emacs init file. In other
> words, with this patch, users do not have to change the configuration
> right away.

Thanks for testing, I've pushed to master.

[1: 584f05cb11]: 2018-05-27 14:14:35 -0400
  Place epg-pinentry-mode varalias before defcustom
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=584f05cb11a8010f31beaf07c9ef4180b70d1d66





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-27 18:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-26  8:46 bug#31603: 27.0.50; pinentry loopback disappeared adrian.lanz
2018-05-26 11:14 ` Basil L. Contovounesios
2018-05-26 12:49   ` adrian.lanz
2018-05-26 16:04     ` Noam Postavsky
2018-05-27 16:41       ` adrian.lanz
2018-05-27 18:21         ` Noam Postavsky

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).