Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 203871 - app-crypt/pinentry-0.7.3: hangs when used with keychain-2.6.6
Summary: app-crypt/pinentry-0.7.3: hangs when used with keychain-2.6.6
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Sven Wegener
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-31 10:41 UTC by jergendutch
Modified: 2010-05-12 14:22 UTC (History)
13 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for keychain 2.7.0 (keychain-2.7.0-fix-pinentry.patch,952 bytes, patch)
2010-04-11 21:38 UTC, Frédéric Barthelery
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jergendutch 2007-12-31 10:41:24 UTC
I have the following in my .bashrc file:
keychain XXXXX123 id_rsa

The ssh key loads fine. I am prompted for my passphrase.
When keychain comes to load the gpg key, it just hangs. I get no passphrase entry dialog.

Looking at the process list, I see pinentry has been started, but strace says it is doing nothing.

The only was to resolve the situation is to killall -9 pinentry (without -9 it does nothing), and THEN I am prompted to enter my passphrase.

Reproducible: Always




If I remove the ssh part from the .bashrc keychain line I get the same result.
Comment 1 Sven Wegener gentoo-dev 2008-01-03 18:10:29 UTC
Works for me. Which pinentry do you use? There are several available based on USE flag and pinentry being a symlink to one them.
Comment 2 jergendutch 2008-01-04 08:46:04 UTC
Apparently I use pinentry-gtk-2, and today I need two killall -9 pinentry commands to get it working, not just one.

[ebuild   R   ] app-crypt/pinentry-0.7.3  USE="gtk ncurses -caps -qt3" 0 kB 
Comment 3 jergendutch 2008-01-04 15:10:34 UTC
Just to be clear: it only hangs when the gpg key is not cached or if the cache time has expired (I'm not sure how to make it not expire).

Changing the symlink to pinentry-curses does not help.
Comment 4 Sven Wegener gentoo-dev 2008-01-06 20:38:54 UTC
Which version of gnupg do you use? I'm having gpg-agent problems with app-crypt/gnupg-2.0.8.
Comment 5 jergendutch 2008-01-07 07:43:00 UTC
app-crypt/gnupg-2.0.7
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2008-01-09 13:57:13 UTC
keychain-2.6.8 works correctly, please try it out.
Comment 7 Alon Bar-Lev (RETIRED) gentoo-dev 2008-01-10 16:59:18 UTC
Please reopen if you have further issues with this one.
Comment 8 jergendutch 2008-01-14 16:15:08 UTC
It worked for a while, but now I have the same problem again.
I think the gpg passphrase expiry is causing the problem - how can I turn it off to test this?
Comment 9 Alon Bar-Lev (RETIRED) gentoo-dev 2008-01-14 17:26:49 UTC
Please provide sequence for me to reproduce this.
Comment 10 jergendutch 2008-01-15 13:43:41 UTC
$ tail -n 4 .bashrc
keychain id_rsa GPG1111 

source $HOME/.keychain/$(hostname)-sh
source $HOME/.keychain/$(hostname)-sh-gpg

I am then using gnome-terminal. It prompts me for my password. It works.
I open a new tab. It works.
A few days later it stops working..
Comment 11 Alon Bar-Lev (RETIRED) gentoo-dev 2008-01-15 13:49:04 UTC
DAYS?!?!?!

Please try to play with small values with these variables of ~/.gnupg/gpg-agent.conf
default-cache-ttl
default-cache-ttl-ssh
max-cache-ttl
max-passphrase-days

And reproduce this in shorter times.
Comment 12 jergendutch 2008-01-16 08:02:16 UTC
I have removed all ttl options from my config file for the moment, and killed ssh-agent and gpg-agent.

I closed all terminals, and opened one. I was prompted for my ssh passphrase and my gpg passphrase. I then closed the terminal.

I opened another terminal, was not prompted for anything, then typed:
 gpg -d file.txt
and I was prompted for my gpg passphrase again.
Comment 13 jergendutch 2008-01-16 14:16:42 UTC
I rebooted a few hours ago. Already, I see this:
 * Adding 1 gpg key(s)...
(hang)

If I type
 killall -9 pinentry ;  killall -9 pinentry
then it will prompt me.

But keychain doesn't seem to work with gpg very well. ssh keys work fine.
Comment 14 Alon Bar-Lev (RETIRED) gentoo-dev 2008-03-27 18:28:23 UTC
Please try to reproduce using latest versions.
Comment 15 jergendutch 2008-03-28 08:32:54 UTC
days -> ~4 hours.

Will do.
Comment 16 Sven Wegener gentoo-dev 2008-06-07 20:09:21 UTC
Please report back when this still happens.
Comment 17 Boris Fersing (RETIRED) gentoo-dev 2009-12-17 10:37:42 UTC
Hi,

I've exactly the same problem with gnupg-2.0.13, pinentry-0.7.6 and keychain-2.7.0 .

I'm using pinentry-curses
Comment 18 Arie Peterson 2010-02-07 17:12:04 UTC
(In reply to comment #16)
> Please report back when this still happens.
> 

I have whatseems to be the same problem.

Using keychain to cache ssh keys works fine, but when keychain tries to add my gpg key, it hangs. Issuing a 'killall -9 pinentry' lets it continue; it then gives an apparently curses-based password input dialog, and all is well.

This is with versions:

app-crypt/gnupg-2.0.14
app-crypt/pinentry-0.7.5
net-misc/keychain-2.7.0

.
Comment 19 Philip Kovacs 2010-02-12 01:45:47 UTC
I was running gnupg-2.0.11 with keychain and pinentry-curses with no problems.

On my x86 machine, the upgrade to gnupg-2.0.14 introduces a pinentry error when keychain runs:

Error: Problem adding gpg key (is pinentry installed?) ...

Masking off gnupg-2.0.14 and running gnupg-2.0.11 fixes the issue.

Comment 20 Arie Peterson 2010-02-12 13:25:33 UTC
Downgrading to gnupg-2.0.11 solves the problem for me as well.
Comment 21 Armando Di Cianno 2010-02-12 17:59:19 UTC
I have this problem as well; I'm using curses pinentry.  I launch keychain and source the generated files from ~/.bashrc, as most do.  This problem started for me within the last few weeks.

keychain-2.7.0
gnupg-2.0.14

On a completely fresh reboot, first time terminal use, I enter my ssh passphrases, and then it pauses.  I killall -9 pinentry, and /then/ the curses dialogue starts, I enter it, and things seem to progress normally.

A very nasty sideeffect is that if you Control-C at the pause, then pinentry is still running in the background.  One you get a few of those running, loadavg goes through the roof.

Downgraded to 2.0.11 (.12 and .13 ~key'd); things now work as they used to.

As opposed to some on here, this problem always happens, and allows happens immediately for me -- no waiting at all.

Comment 22 Frédéric Barthelery 2010-04-11 21:36:37 UTC
I think the bug is due to not settings the GPG_TTY environment variable before calling gpg.
Comment 23 Frédéric Barthelery 2010-04-11 21:38:18 UTC
Created attachment 227437 [details, diff]
Patch for keychain 2.7.0

I have added the GPG_TTY environment variable before calling gpg.  it seems to fix the bug.
Comment 24 Koen Smets 2010-04-14 15:14:07 UTC
(In reply to comment #23)
> Created an attachment (id=227437) [details]
> Patch for keychain 1.7.0
> 
> I have added the GPG_TTY environment variable before calling gpg.  it seems to
> fix the bug.
> 

After patching keychain, the bug is also fixed on my system (gnupg-2.0.14, pinentry-0.7.6 and keychain-2.7.0). Thanks!
Comment 25 Daniel Robbins 2010-04-14 15:22:11 UTC
I have committed this fix to funtoo github for keychain and it will be in version 2.7.1 when released. Thanks! :) 
Comment 26 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-04-29 21:04:01 UTC
(In reply to comment #25)
> I have committed this fix to funtoo github for keychain and it will be in
> version 2.7.1 when released. Thanks! :) 
> 

Daniel, Is there an ETA on this future release? I keep checking the homepage in hopes to grab a release instead of patching.
Comment 27 Daniel Robbins 2010-04-29 21:35:53 UTC
I will try to get a maintenance release out in early May.

-Daniel
Comment 28 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-05-12 14:22:06 UTC
(In reply to comment #27)
> I will try to get a maintenance release out in early May.
> 
> -Daniel
> 

Thanks, A new Gentoo bug was opened for the bump. Bug 319419 which I am working on now. Closing this bug.