Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Jens Lechtenboerger <jens.lechtenboerger@fsfe.org>
To: <tomas@tuxteam.de>
Cc: help-gnu-emacs@gnu.org, info-gnus-english@gnu.org
Subject: Re: Passphrase caching for GnuPG in Emacs?
Date: Mon, 09 Nov 2015 14:55:40 +0100	[thread overview]
Message-ID: <87si4fwa3n.fsf@informationelle-selbstbestimmung-im-internet.de> (raw)
In-Reply-To: <20151109084539.GB12671@tuxteam.de> (tomas@tuxteam.de's message of "Mon, 9 Nov 2015 09:45:39 +0100")

On 2015-11-09, at 09:45, tomas@tuxteam.de wrote:

> On Sun, Nov 08, 2015 at 05:00:56PM +0100, Jens Lechtenboerger wrote:
>> Hi there,
>>
>> I plan to refactor the code used for GnuPG in the Message mode of
>> Emacs [...]
>
>> If I’m not mistaken (please let me know if I’m wrong), with GnuPG
>> 2.x (and gpgsm) passphrases cannot be cached within Emacs as
>> gpg-agent is started automatically and tries to invoke a pinentry
>> program.
>
> Just a question: how do you plan to handle this pinentry?

Actually, that’s not me, but GnuPG.  And I just realized that I’m
mistaken, pinentry in Emacs is possible but not recommended, see
below.

> The last time I gave gpg 2 a try, a crude GTK dialog appeared from
> nowhere (disrupting my command line workflow). I just ran away,
> screaming.
>
> It seems there's a command-line pinentry these days. From Emacs,
> my dream would be that it's Emacs which handles user interaction.

What you describe is the default for GUIs, I guess.

If I use the option
pinentry-program /usr/local/bin/pinentry-curses
in gpg-agent.conf and start Emacs within a terminal (option -nw),
then the passphrase needs to be entered within the terminal window,
whose contents get replaced by pinentry-curses while entering the
passphrase.  Would that be good enough for you?

Moreover, as mentioned above there is Emacs support in pinentry,
which can be enabled by configure options at compile time.

From the pinentry info pages:
   “Having Emacs get the passphrase is convenient, however, it is a
significant security risk.  Emacs keeps all key presses buffered.  (You
can see the recent key presses by typing 'C-h l' ('view-lossage') in
emacs.)  Further, Emacs is a huge program, which doesn't provide any
process isolation to speak of.  As such, having it handle the passphrase
adds a huge chunk of code to the user's trusted computing base.  Because
of this concern, Emacs doesn't enable this by default (the user has to
run '(pinentry-start)', e.g., from his or her '.emacs' file,
explicitly).”

Out of curiosity: Are you customizing any of the 8 variables related
to passphrase caching that I mentioned in my earlier message?

Best wishes
Jens

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

  parent reply	other threads:[~2015-11-09 13:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-08 16:00 Jens Lechtenboerger
2015-11-09  8:45 ` tomas
2015-11-09 13:47   ` Stefan Monnier
2015-11-09 13:45     ` tomas
2015-11-09 13:55   ` Jens Lechtenboerger [this message]
2015-11-09 13:50     ` tomas
2015-11-11  8:15     ` Kevin Brubeck Unhammer
2015-11-12 16:43       ` Jens Lechtenboerger
2015-11-13  8:24         ` Kevin Brubeck Unhammer
2015-12-22 21:58           ` Greg Bell
2015-12-23 14:00             ` Peter Münster
2016-01-05 15:40 ` Teemu Likonen
2016-01-05 15:58   ` Jens Lechtenboerger
2016-01-05 18:16     ` Jude DaShiell
2016-01-05 19:06       ` Teemu Likonen

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

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

  git send-email \
    --in-reply-to=87si4fwa3n.fsf@informationelle-selbstbestimmung-im-internet.de \
    --to=jens.lechtenboerger@fsfe.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=info-gnus-english@gnu.org \
    --cc=tomas@tuxteam.de \
    /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.
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 NNTP newsgroup(s).