From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 26 08:09:49 2020 Received: (at 24076-done) by debbugs.gnu.org; 26 Mar 2020 12:09:49 +0000 Received: from localhost ([127.0.0.1]:58170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHRKW-0001ON-UA for submit@debbugs.gnu.org; Thu, 26 Mar 2020 08:09:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHRKV-0001O8-KP for 24076-done@debbugs.gnu.org; Thu, 26 Mar 2020 08:09:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jHRKQ-0008DM-AT; Thu, 26 Mar 2020 08:09:42 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36910 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jHRKP-00040S-Uy; Thu, 26 Mar 2020 08:09:42 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Alex Kost Subject: Re: bug#24076: gnupg [-agent]: when signing [commits], it claims that there is no pinentry - but there is References: <20160726180507.21e5e8e0@scratchpost.org> <87poq016rt.fsf@gnu.org> <20160727115405.704f02ac@scratchpost.org> <878twnz6o4.fsf@gnu.org> <87popy13x6.fsf@gmail.com> <87shuuj7y4.fsf@gnu.org> Date: Thu, 26 Mar 2020 13:09:40 +0100 In-Reply-To: <87shuuj7y4.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 28 Jul 2016 13:52:35 +0200") Message-ID: <87pncz9v23.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24076-done Cc: Danny Milosavljevic , 24076-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi! ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > What about having GnuPG depend on pinentry-tty, and configuring it with: > > --with-pinentry-pgm=3D/path/to/pinentry-tty > > ? That would at least provide a reasonable default. The closure size > of GnuPG would increase from 220 to 243 MiB (+10%). > > Most of the time, people will want to use pinentry-gtk though. > > Another option would be to change =E2=80=98gnupg_module_name=E2=80=99, in= homedir.c, from: > > case GNUPG_MODULE_NAME_PINENTRY: > #ifdef GNUPG_DEFAULT_PINENTRY > return GNUPG_DEFAULT_PINENTRY; > #else > X(bindir, "pinentry"); > #endif > > > to something like: > > case GNUPG_MODULE_NAME_PINENTRY: > X(homedir, ".guix-profile/bin/pinentry); > > =E2=80=A6 in which case GnuPG would default to the user-installed pinentr= y, if > available. Not perfect either, but closer to what other distros do. I (finally!) implemented this second option in commit c7af9d0b5ebaa1fdb08ff5d8a56004998bcd8103. I confirmed that it has the indented effect like this: --8<---------------cut here---------------start------------->8--- ludo@ribbon ~/src/guix$ ./pre-inst-env guix environment --ad-hoc gnupg stra= ce coreutils sed grep -C ludo@ribbon ~/src/guix [env]$ strace -f -o ,,s -s 500 gpg --generate-key gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. gpg: directory '/home/ludo/.gnupg' created gpg: keybox '/home/ludo/.gnupg/pubring.kbx' created Note: Use "gpg --full-generate-key" for a full featured key generation dial= og. GnuPG needs to construct a user ID to identify your key. Real name: Foo Bar Email address: foo@example.org You selected this USER-ID: "Foo Bar " Change (N)ame, (E)mail, or (O)kay/(Q)uit? o We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. gpg: agent_genkey failed: No pinentry Key generation failed: No pinentry --8<---------------cut here---------------end--------------->8--- where the strace log shows: 10 execve("/home/ludo/.gnupg/.guix-profile/bin/pinentry", ["pinentry"]= , 0x7f7aa80035e0 /* 14 vars */) =3D -1 ENOENT (No such file or directory) So now one just needs to install one of the pinentry packages. Thanks, Ludo=E2=80=99.