From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matthew Carter Newsgroups: gmane.emacs.devel Subject: Re: Using epg with gpg-agent Date: Mon, 18 Jun 2018 00:18:52 -0400 Organization: Ahungry (http://ahungry.com) Message-ID: <878t7c9177.fsf@ahungry.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529295455 24055 195.159.176.226 (18 Jun 2018 04:17:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Jun 2018 04:17:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 18 06:17:31 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fUlbe-00068Y-8F for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2018 06:17:30 +0200 Original-Received: from localhost ([::1]:32814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUldl-0002ki-BX for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2018 00:19:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUlcW-00023O-UN for emacs-devel@gnu.org; Mon, 18 Jun 2018 00:18:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUlcT-0000mB-RT for emacs-devel@gnu.org; Mon, 18 Jun 2018 00:18:24 -0400 Original-Received: from ahungry.com ([69.164.215.200]:39124 helo=mail.ahungry.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUlcT-0000lV-NL; Mon, 18 Jun 2018 00:18:21 -0400 Original-Received: from localhost (ahungry.com [127.0.0.1]) by mail.ahungry.com (Postfix) with ESMTP id 63F994214; Mon, 18 Jun 2018 00:18:21 -0400 (EDT) X-Virus-Scanned: amavisd-new at ahungry.com Original-Received: from mail.ahungry.com ([127.0.0.1]) by localhost (mail.ahungry.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3pQZSQLNV3NX; Mon, 18 Jun 2018 00:18:20 -0400 (EDT) Original-Received: from archPad (99-40-9-245.lightspeed.livnmi.sbcglobal.net [99.40.9.245]) by mail.ahungry.com (Postfix) with ESMTPSA id 9A9ED41F9; Mon, 18 Jun 2018 00:18:20 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Sun, 17 Jun 2018 18:20:08 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 69.164.215.200 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226446 Archived-At: Richard Stallman writes: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > Does anyone know how to make the Emacs encryption commands such as > epa-decrypt-region work with gpg-agent on a text console? > If I start gpg-agent in the usual way before running Emacs, > then when I try to decrypt, gpg-agent and Emacs both try to > read from the terminal so the passphrase always gets garbled. I use a setup where all my Emacs based decryption (epa) commands are from the (text/tty Emacs) password input prompt in Emacs, and sent to gpg-agent. This works for me over SSH, tty1-6, or in an X session terminal emulator (no call out to the GUI password input prompt). More recent versions of Emacs/gpg-agent required me to add the loopback option, as well as the Emacs options - a couple years ago it worked with just the allow-emacs-pinentry setting and nothing else: My relevant settings are as follows: In ~/.gnupg/gpg-agent.conf: allow-emacs-pinentry allow-loopback-pinentry On the Emacs side: (setq epa-pinentry-mode 'loopback) (pinentry-start) ; This was disabled recently in Emacs 26+ and has to be explicitly called I know I ran into many garbled text issues when trying to combine ncurses input on the gpg-agent with Emacs functions. -- Matthew Carter (m@ahungry.com) http://ahungry.com