unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Alex Kost <alezost@gmail.com>
Cc: 24076-done@debbugs.gnu.org
Subject: bug#24076: gnupg [-agent]: when signing [commits], it claims that there is no pinentry - but there is
Date: Thu, 26 Mar 2020 13:09:40 +0100	[thread overview]
Message-ID: <87pncz9v23.fsf@gnu.org> (raw)
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")

Hi!

ludo@gnu.org (Ludovic Courtès) skribis:

> What about having GnuPG depend on pinentry-tty, and configuring it with:
>
>   --with-pinentry-pgm=/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 ‘gnupg_module_name’, 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);
>
> … in which case GnuPG would default to the user-installed pinentry, 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 strace 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 dialog.

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 <foo@example.org>"

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 */) = -1 ENOENT (No such file or directory)

So now one just needs to install one of the pinentry packages.

Thanks,
Ludo’.

  parent reply	other threads:[~2020-03-26 12:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 16:05 bug#24076: gnupg [-agent]: when signing [commits], it claims that there is no pinentry - but there is Danny Milosavljevic
2016-07-26 20:30 ` Ludovic Courtès
2016-07-27  9:54   ` Danny Milosavljevic
2016-07-27 11:01     ` Ludovic Courtès
2016-07-28  9:56       ` Alex Kost
2016-07-28 11:52         ` Ludovic Courtès
2016-07-28 12:04           ` Danny Milosavljevic
2016-07-28 17:58             ` Alex Kost
2020-03-26 12:09           ` Ludovic Courtès [this message]
2020-03-27 20:02             ` Leo Famulari
2016-10-14  6:45 ` Federico Beffa
2016-10-14 13:16   ` Ludovic Courtès
2019-07-22 11:44 ` Robert Vollmert
2020-03-27 22:48 ` bug#24076: [PATCH] gnu: GnuPG: Really use ~/.guix-profile/bin/pinentry by default Leo Famulari
2020-03-29 14:57   ` Ludovic Courtès
2020-03-29 19:27     ` Leo Famulari
2021-04-22 21:49 ` bug#24076: gnupg [-agent]: when signing [commits], it claims that there is no pinentry - but there is Alexandre Hannud Abdo

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87pncz9v23.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=24076-done@debbugs.gnu.org \
    --cc=alezost@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).