gpg-agent with preset passphrase

Richard richard2005 at att.net
Mon Aug 1 01:37:42 CEST 2005


Hi, I'm trying to provide gpg-agent with passphrase when the machine
starts up. The machine has no X installed so pinentry is not available.
gpg-preset-passphrase sounds like an ideal tool for this purpose. But I
got some problem. Here is what I did(gpg-agent is from 1.9, while gpg is
from 1.4):

gpg-agent --daemon -v --allow-preset-passphrase --log-file /tmp/gpg
--debug-level expert
gpg-preset-passphrase --preset 456966036038140A30H816963A69260A9C4C18BA

Here is one suspicion: when I type passphrase, it is not hidden but in
CLEAR TEXT! Did I miss something?

Then I decrypt with the following command and got:

gpg --use-agent --decrypt --batch filename
gpg: Invalid passphrase; please try again ...
gpg: problem with the agent - disabling agent use
gpg: can't query passphrase in batch mode
gpg: Invalid passphrase; please try again ...
gpg: can't query passphrase in batch mode
gpg: encrypted with ELG-E key, ID 48E397E9
gpg: encrypted with 4096-bit ELG-E key, ID CE4C18BA, created 2005-07-15
"richard2005 at att.net"
gpg: public key decryption failed: bad passphrase
gpg: decryption failed: secret key not available

The log does appear that the passphrase was successfully stored, and
when gpg was asked to decrypt the file, it indeed found the cached
passphrase, but somehow it did nothing, and then came back and cleared
the passphrase... Anyone has any idea? Thanks, Richard

2005-07-31 19:23:26 gpg-agent[1287] handler 0x3c00d200 for fd 0 started
gpg-agent[1287.0x3c020000] DBG: -> OK Pleased to meet you
gpg-agent[1287.0x3c020000] DBG: <- OPTION ttyname=/dev/ttyp0
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION ttytype=xterm
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION lc-ctype=C
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION lc-messages=C
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- PRESET_PASSPHRASE
456966036038140A30H816963A69260A9C4C18BA -1 secretword
2005-07-31 19:23:26 gpg-agent[1287] DBG: agent_put_cache
`456966036038140A30H816963A69260A9C4C18BA' requested ttl=-1 mode=1
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- [EOF]
2005-07-31 19:23:26 gpg-agent[1287] handler 0x3c00d200 for fd 0 terminated
2005-07-31 19:23:33 gpg-agent[1287] handler 0x3c00d200 for fd 0 started
gpg-agent[1287.0x3c020000] DBG: -> OK Pleased to meet you
gpg-agent[1287.0x3c020000] DBG: <- OPTION ttyname=/dev/ttyp0
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION ttytype=xterm
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION lc-ctype=C
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION lc-messages=C
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- GET_PASSPHRASE
456966036038140A30H816963A69260A9C4C18BA X X You+need+a+passphrase+to+unl
ock+the+secret+key+for+user:%0A"richard2005 at att.net"%0A4096-bit+ELG-E+key,+ID+CE4C18BA,+created+2005-07-15+(main+k
ey+ID+F8B5E914)%0A
2005-07-31 19:23:33 gpg-agent[1287] DBG: agent_get_cache
`456966036038140A30H816963A69260A9C4C18BA'...
2005-07-31 19:23:33 gpg-agent[1287] DBG: ... hit
gpg-agent[1287.0x3c020000] DBG: -> [Confidential data not shown]
gpg-agent[1287.0x3c020000] DBG: <- [EOF]
2005-07-31 19:23:33 gpg-agent[1287] handler 0x3c00d200 for fd 0 terminated
2005-07-31 19:23:33 gpg-agent[1287] handler 0x3c00d200 for fd 0 started
gpg-agent[1287.0x3c020000] DBG: -> OK Pleased to meet you
gpg-agent[1287.0x3c020000] DBG: <- OPTION ttyname=/dev/ttyp0
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION ttytype=xterm
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION lc-ctype=C
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION lc-messages=C
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- CLEAR_PASSPHRASE
456966036038140A30H816963A69260A9C4C18BA
2005-07-31 19:23:33 gpg-agent[1287] DBG: agent_put_cache
`456966036038140A30H816963A69260A9C4C18BA' requested ttl=0 mode=3
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- [EOF]
2005-07-31 19:23:33 gpg-agent[1287] handler 0x3c00d200 for fd 0 terminated
2005-07-31 19:23:33 gpg-agent[1287] handler 0x3c00d200 for fd 0 started
gpg-agent[1287.0x3c020000] DBG: -> OK Pleased to meet you
gpg-agent[1287.0x3c020000] DBG: <- OPTION ttyname=/dev/ttyp0
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION ttytype=xterm
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION lc-ctype=C
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- OPTION lc-messages=C
gpg-agent[1287.0x3c020000] DBG: -> OK
gpg-agent[1287.0x3c020000] DBG: <- GET_PASSPHRASE
456966036038140A30H816963A69260A9C4C18BA Invalid+passphrase;+please+try+a
gain X
You+need+a+passphrase+to+unlock+the+secret+key+for+user:%0A"richard2005 at att.net"%0A4096-bit+ELG-E+key,+ID+C
E4C18BA,+created+2005-07-15+(main+key+ID+F8B5E914)%0A
2005-07-31 19:23:33 gpg-agent[1287] DBG: agent_get_cache
`456966036038140A30H816963A69260A9C4C18BA'...
2005-07-31 19:23:33 gpg-agent[1287] DBG: ... miss
2005-07-31 19:23:33 gpg-agent[1287] starting a new PIN Entry
2005-07-31 19:23:33 gpg-agent[1287] can't connect to the PIN entry
module: connect failed
2005-07-31 19:23:33 gpg-agent[1287] command get_passphrase failed: No
pinentry
gpg-agent[1287.0x3c020000] DBG: -> ERR 67108949 No pinentry <GPG Agent>
gpg-agent[1287.0x3c020000] DBG: <- [EOF]
2005-07-31 19:23:33 gpg-agent[1287] handler 0x3c00d200 for fd 0 terminated




More information about the Gnupg-users mailing list