rcrowley/freight — Issue #14: freight-cache seems to ignore gpg-agent
Author: haus
Created: 2011-12-07 23:14:24+00:00
State: open

After calling keychain --eval and exporting the GPG_AGENT_INFO, calling freight-cache should ideally use the agent and not need to prompt for my passphrase. However, freight-cache is not using the agent, and will always prompt for the passphrase, unless the key is passphraseless. Output follows.

No GPG_AGENT_INFO to start...

```shell
matthaus@host:~$ env
TERM=xterm
SHELL=/bin/bash
SSH_CLIENT=xx.xx.xx.xx 1413 22
SSH_TTY=/dev/pts/0
USER=matthaus
MAIL=/var/mail/matthaus
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PWD=/home/matthaus
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/matthaus
LOGNAME=matthaus
SSH_CONNECTION=xx.xx.xx.xx 1413 yy.yy.yy.yy 22
_=/usr/bin/env
```

Calling keychain to get the GPG_AGENT_INFO to export.

```shell
matthaus@host:~$ keychain -q --agents gpg --eval
GPG_AGENT_INFO=/tmp/gpg-vZRZAA/S.gpg-agent:17921:1; export GPG_AGENT_INFO;

matthaus@host:~$ GPG_AGENT_INFO=/tmp/gpg-vZRZAA/S.gpg-agent:17921:1; export GPG_AGENT_INFO;
```

Env now has GPG_AGENT_INFO listed.

```shell
matthaus@host:~$ env
GPG_AGENT_INFO=/tmp/gpg-vZRZAA/S.gpg-agent:17921:1
TERM=xterm
SHELL=/bin/bash
SSH_CLIENT=xx.xx.xx.xx 1413 22
SSH_TTY=/dev/pts/0
USER=matthaus
MAIL=/var/mail/matthaus
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PWD=/home/matthaus
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/matthaus
LOGNAME=matthaus
SSH_CONNECTION=xx.xx.xx.xx 1413 yy.yy.yy.yy 22
_=/usr/bin/env
```

Now I expect freight-cache to use the agent to get the key, but it doesn't.

```shell
matthaus@host:~$ freight-cache apt/lenny

You need a passphrase to unlock the secret key for
user: "Key Description"
4096-bit RSA key, ID , created

Enter passphrase:
gpg: Interrupt caught ... exiting
```