From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Andrew L. Moore" Newsgroups: gmane.emacs.devel Subject: Re: GnuPG passphrase in Emacs minibuffer Date: Sun, 21 Aug 2022 03:57:47 -0400 Message-ID: <38b86f6e-f3ec-ffe3-d8da-929a13a8e4c2@gmail.com> References: <83pmgucf3r.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32545"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 21 09:59:12 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oPfrU-0008LJ-AO for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Aug 2022 09:59:12 +0200 Original-Received: from localhost ([::1]:53262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPfrT-0003y4-8L for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Aug 2022 03:59:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPfqB-0003HG-Rx for emacs-devel@gnu.org; Sun, 21 Aug 2022 03:57:53 -0400 Original-Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:40950) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPfqA-0002CW-Au; Sun, 21 Aug 2022 03:57:51 -0400 Original-Received: by mail-qk1-x72a.google.com with SMTP id f4so5976855qkl.7; Sun, 21 Aug 2022 00:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=HVgLZsUu0C3qwGOz9JU1qvsd3hO2vV8TmBcPE8zVh4E=; b=ZOuJ52/FiiLjl/aiPsXaoDUkMhelj6kDNrezZJbMwH10u8eekpUSPTozEMg6R8yOKd +MCMCyu5XpSRTVtc1vEKnT1opSRqlpdpOULUbYXCX0Y9ip1Et7sklvg5/aXnt+52OE/E cGv/o4tLk1u5gGIBIiEN2w7QfhegBotZtZq4yek0o97zMLG6C60RrwMyEs/LlZCMFMpr 8ocq2EzmFj+wl5Qpl3vHBwDS13qzoLfw8FBKgMH/F8B9dlROEX7VQ57gJC03OXGDcUy6 zWLzYAQPfFXIBNoG3DzK0giVnOx6TelQ8spXgaSYR3Azw3Rf2a4qdxwdwB1tGwMuCz0U +5+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=HVgLZsUu0C3qwGOz9JU1qvsd3hO2vV8TmBcPE8zVh4E=; b=Wow8HxaGfnCSM7ZpJZ2mSJzXXSmlpjSX0LBNupQIhYv6oaj9WnVN22L1nEC9J2nhCp PVxo8OtijdaOJVNrSkhtROCqt2bzO2GgWDS/5M6bpb9PAkItDIgiDvAGBJQVYoVjkfWl GC7E2hqHD/mXe0hkdXk7OpISQPSAN5LDM/Sh+b2Ac+XSa5Yf8H/e1qZ0k7Ez3SjZ+mEi 6o1wNX+88/tuzOL0LoCIvF2qpKZuULeCUdRh9K6uOcRjNCgihFEVm51Qoln1/Yu87fwM FU/k1C7NjxbLFfa9A6XTskwbra4PXYNkj0Ho8Kxycja6qT7niCbQBXwemKxnRRtS8MQn k/1A== X-Gm-Message-State: ACgBeo2oeR5FjWh67cpFuRidFvEuTV+5LKp8SISBB8/j5vo892PpaIQs i0GjTe0jWdg4bAnvnn9vx76Gao4C5jo= X-Google-Smtp-Source: AA6agR4xIVPcbSUD+EZ1Bb5M4wxIGe59SD4d7O1oyjqaLkfCQLIxqt60nHsXXRTDnRkBOl3mSoff7w== X-Received: by 2002:ae9:e402:0:b0:6a7:86a3:752e with SMTP id q2-20020ae9e402000000b006a786a3752emr9698179qkc.300.1661068668852; Sun, 21 Aug 2022 00:57:48 -0700 (PDT) Original-Received: from [192.168.0.173] (c-24-125-236-19.hsd1.ga.comcast.net. [24.125.236.19]) by smtp.gmail.com with ESMTPSA id u3-20020a37ab03000000b006bac157ec19sm7695327qke.123.2022.08.21.00.57.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Aug 2022 00:57:48 -0700 (PDT) Content-Language: en-US In-Reply-To: <83pmgucf3r.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=slewsys@gmail.com; helo=mail-qk1-x72a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293681 Archived-At: On 8/21/22 01:58, Eli Zaretskii wrote: >> Date: Sun, 21 Aug 2022 00:44:25 -0400 >> From: "Andrew L. Moore" >> >> To allow a GnuPG passphrase in the Emacs minibuffer, I use the external >> Emacs package pinentry.el in loopback mode*: >> >> (setq epg-pinentry-mode 'loopback) >> >> Unfortunately, this doesn't work on Debain-based systems without >> upgrading the pinentry source (use: git://git.gnupg.org/pinentry.git). >> >> But it turns out that pinentry.el may not be required any more. It is >> enough to add to the file ~/.gnupg/gpg.conf the line: >> >> pinentry-mode loopback >> >> and to ~/.gnupg/gpg-agent.conf: >> >> allow-loopback-pinentry >> >> Restart gpg-agent and that's it. The most obvious difference is that >> pinentry.el provides a more informative prompt, e.g., >> >> [[1399721]@slewsys.org] Please enter the passphrase to unlock the >> OpenPGP secret key: >> "Andrew L. Moore " >> 255-bit EDDSA key, ID 0x0AB16F2E536D3DB5, >> created 2021-11-01.: >> >> versus when GnuPG runs PINEntry in loopback mode: >> >> Enter passphrase: > > This is in Emacs NEWS that shipped with Emacs 26, no? The Emacs 26 etc/NEWS article about removing pinentry.el appears to be incomplete. I only see mentioned that: allow-emacs-pinentry should be removed from ~/.gnupg/gpg-agent.conf. This is necessary but insufficient. And reference to the variable `epg-pinentry-mode' affects only EasyPG, not other contexts like signing commits with Magit. To allow Magit and other packages to enter a GnuPG passphrase in the Emacs minibuffer, the critical step is to add to ~/.gnupg/gpg.conf: pinentry-mode loopback This works for EasyPG as well, without having to set the epg-pinentry-mode variable.