From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joakim Jalap Newsgroups: gmane.emacs.help Subject: Re: Password prompt inside Emacs with epg-gpg-program -> "gpg2"? Date: Mon, 08 Feb 2016 18:00:54 +0100 Message-ID: <874mdj2l2x.fsf@joakim-desk.jockej.lan> References: <87h9hjxnwc.fsf@web.de> <87bn7rnsqc.fsf@iki.fi> <874mdjxlcx.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454950931 978 80.91.229.3 (8 Feb 2016 17:02:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Feb 2016 17:02:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 08 18:02:01 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aSpCI-00033l-78 for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Feb 2016 18:01:58 +0100 Original-Received: from localhost ([::1]:46807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpCH-0001EL-Lt for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Feb 2016 12:01:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpBX-0000SB-GN for help-gnu-emacs@gnu.org; Mon, 08 Feb 2016 12:01:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSpBR-00064s-Od for help-gnu-emacs@gnu.org; Mon, 08 Feb 2016 12:01:11 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:54601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpBR-00064P-It for help-gnu-emacs@gnu.org; Mon, 08 Feb 2016 12:01:05 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aSpBM-0001uy-MH for help-gnu-emacs@gnu.org; Mon, 08 Feb 2016 18:01:00 +0100 Original-Received: from h-202-248.a328.priv.bahnhof.se ([5.150.202.248]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Feb 2016 18:01:00 +0100 Original-Received: from joakim.jalap by h-202-248.a328.priv.bahnhof.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Feb 2016 18:01:00 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: h-202-248.a328.priv.bahnhof.se User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:Xh8hmdhIKNDZKo6id8njFinVEc4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109048 Archived-At: Michael Heerdegen writes: > Teemu Likonen writes: > >> The present and the future of GPG (version 2.x and above) is to use >> gpg-agent and pinentry. I think there's no way to escape that. And it's >> better. But it seems that there are pinentry implementation(s) for >> Emacs. There is one in GNU Elpa [...] > > Ok, thanks. (BTW, part of the problem is that when I get the X popup, > Emacs is in an unresponsive state. And I need Emacs to get the > password. So I need to run a second Emacs instance, or get the password > before calling Gnus.) > > I tried pinentry.el from Gnu Elpa. What do I need to add exactly to > "~/.gnupg/gpg-agent.conf"? Just "allow-emacs-pinentry" as the package's > doc tells doesn't work. > > I could figure it out myself I guess, but I decided to CC the author and > hope we can improve the package's doc instead. FWIW, this is what I have in my config regarding Gnupg: **** GPG So, this was a bit of a pain to get working, but now it works. For some inexplicable reason, pinentry-emacs isn't built by default on either FreeBSD or Arch, so one has to build it from source, and add =--enable-pinentry-emacs=. Then add "allow-pinentry-emacs" to =~/.gnupg/gpg-agent.conf=. Then one simply does: #+BEGIN_SRC emacs-lisp (require 'pinentry) (pinentry-start) (setenv "INSIDE_EMACS" "YES") #+END_SRC I also have the cache time set to some ridiculously high value so I don't have to enter my password all the time, but I guess that's another story. > > Thanks, > > Michael. Hope it helps :) Joakim