Page MenuHome GnuPG

gpg decrypt hangs after entering passphrase
Closed, ResolvedPublic

Description

When trying to decrypt a message on a linuxmint system (17 qiana), after
entering the message and entering the passphrase afterwards gpg hangs:

EXAMPLE 1

$ gpg
gpg: Go ahead and type your message ...
-----BEGIN PGP MESSAGE-----
Version: BCPG v1.46

hQEMA7a1bZ0tb4dbAQf/ZA0HAg/Bmr2Kq1LDSplZdua3yetljID/ahMbf5kSt4xd
KiE69zhUQKpKl1FYgd+cNF6WJ1yPBmB1VoDVMaeuH7QIjdEXH2YES/tJCgLwyZGA
aK7sdMSddttRaHmxfsm3zHeKVBkj0aNCWqp9i7J5L0nvp8lMmtLJaMtZkOwv/Xji
8XA08Z6egQ8u+V/XbDuKnNNO13zu8nq2WbmqrzDsL0E4nVOj2Bxc7oap8aiqAcv9
lc3mhXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7XD7thSHwp9yTuAKTQpiJhTM
jTkNnhqdVsEVkzad3VkIA8teo5eZjtW2CrKNkOzcLtJKAXs5ScWFfvDqLcXDZUCn
bltmtBlu2wlke+GBSQwJy3uhlefWqcL6vSwnwtSiQ1h9LibJdbh74xeUUQAVipZ+
NkOHP70D8u8VH40=

1LMh

-----END PGP MESSAGE-----

You need a passphrase to unlock the secret key for
user: "XXXXX XXXXXXXX <XXXXX.XXXXXXXX@gmx.at>"
2048-bit RSA key, ID 2D6F875B, created 2013-09-03

can't connect to `/run/user/1000/keyring-frTBLA/gpg': No such file or directory
gpg: can't connect to `/run/user/1000/keyring-frTBLA/gpg': connect failed
gpg: encrypted with 2048-bit RSA key, ID 2D6F875B, created 2013-09-03

      "XXXXX XXXXXXXX <XXXXX.XXXXXXXX@gmx.at>"

[waits for input]

EXAMPLE 2

$ GPG_AGENT_INFO="" gpg -d
-----BEGIN PGP MESSAGE-----
Version: BCPG v1.46

hQEMA7a1bZ0tb4dbAQf/ZA0HAg/Bmr2Kq1LDSplZdua3yetljID/ahMbf5kSt4xd
KiE69zhUQKpKl1FYgd+cNF6WJ1yPBmB1VoDVMaeuH7QIjdEXH2YES/tJCgLwyZGA
aK7sdMSddttRaHmxfsm3zHeKVBkj0aNCWqp9i7J5L0nvp8lMmtLJaMtZkOwv/Xji
8XA08Z6egQ8u+V/XbDuKnNNO13zu8nq2WbmqrzDsL0E4nVOj2Bxc7oap8aiqAcv9
lc3mhXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7XD7thSHwp9yTuAKTQpiJhTM
jTkNnhqdVsEVkzad3VkIA8teo5eZjtW2CrKNkOzcLtJKAXs5ScWFfvDqLcXDZUCn
bltmtBlu2wlke+GBSQwJy3uhlefWqcL6vSwnwtSiQ1h9LibJdbh74xeUUQAVipZ+
NkOHP70D8u8VH40=

1LMh

-----END PGP MESSAGE-----

You need a passphrase to unlock the secret key for
user: "XXXXX XXXXXXXX <XXXXX.XXXXXXXX@gmx.at>"
2048-bit RSA key, ID 2D6F875B, created 2013-09-03

gpg: gpg-agent is not available in this session
gpg: encrypted with 2048-bit RSA key, ID 2D6F875B, created 2013-09-03

      "XXXXX XXXXXXXX <XXXXX.XXXXXXXX@gmx.at>"

[waits for input]

EXAMPLE 3

$ strace gpg
[...]
write(7, "Enter passphrase: ", 18Enter passphrase: ) = 18
read(7, "o", 1) = 1
read(7, "w", 1) = 1
read(7, "T", 1) = 1
read(7, "S", 1) = 1
read(7, "r", 1) = 1
read(7, "e", 1) = 1
read(7, "z", 1) = 1
read(7, "+", 1) = 1
read(7, "P", 1) = 1
read(7, "Y", 1) = 1
read(7, "q", 1) = 1
read(7, "0", 1) = 1
read(7, "\n", 1) = 1
ioctl(7, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400
opost isig icanon -echo ...}) = 0
ioctl(7, SNDCTL_TMR_CONTINUE or SNDRV_TIMER_IOCTL_GPARAMS or TCSETSF, {B38400
opost isig icanon echo ...}) = 0
ioctl(7, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400
opost isig icanon echo ...}) = 0
) = 20 \r", 20
getrusage(RUSAGE_SELF, {ru_utime={0, 3062}, ru_stime={0, 5610}, ...}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 8691288}) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 4408}, ru_stime={0, 5610}, ...}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 9987615}) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 4467}, ru_stime={0, 5610}, ...}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 10095119}) = 0
open("/home/fs/.gnupg/random_seed", O_RDONLY) = 8
fcntl(8, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
fstat(8, {st_mode=S_IFREG|0600, st_size=600, ...}) = 0
read(8, "t\3t\21\7\\\225\\\1\365b D\27o\260\350(7\303\251\3670j5PBm9Ek\226"...,

  1. = 600

close(8) = 0
getpid() = 6426
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 10248543}) = 0
open("/dev/urandom", O_RDONLY) = 8
fstat(8, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
select(9, [8], NULL, NULL, {3, 0}) = 1 (in [8], left {2, 999998})
read(8, "\3o4\3534\210\363\276\24\30\30\314/\317\333\302", 16) = 16
getrusage(RUSAGE_SELF, {ru_utime={0, 4568}, ru_stime={0, 5747}, ...}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 10326967}) = 0
lseek(6, 0, SEEK_SET) = 0
read(6,
"\231\1\r\4R&B\33\1\10\0\301\240\242\23\16`\36\17;\376>\321\200\246\303\350\255\331\355\312\27"...,

  1. = 8192

getrusage(RUSAGE_SELF, {ru_utime={0, 21014}, ru_stime={0, 5747}, ...}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 26621368}) = 0
lseek(5, 0, SEEK_SET) = 0
lseek(5, 0, SEEK_SET) = 0
read(5,
"\231\1\r\4R&B\33\1\10\0\301\240\242\23\16`\36\17;\376>\321\200\246\303\350\255\331\355\312\27"...,

  1. = 8192

getrusage(RUSAGE_SELF, {ru_utime={0, 21014}, ru_stime={0, 5747}, ...}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 26720650}) = 0
write(2, "gpg: ", 5gpg: ) = 5
write(2, "encrypted with 2048-bit RSA key,"..., 65encrypted with 2048-bit RSA
key, ID 2D6F875B, created 2013-09-03
) = 65
write(2, " \"XXXXX XXXXXXXX <XXXXX.XXX"..., 47 "XXXXX XXXXXXXX
<XXXXX.XXXXXXXX@gmx.at>"
) = 47
getrusage(RUSAGE_SELF, {ru_utime={0, 21133}, ru_stime={0, 5747}, ...}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 26833646}) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 21133}, ru_stime={0, 5747}, ...}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 26848380}) = 0
read(0,

[waits for input]

If I press Ctrl + D it ends with the following message:
gpg: NOTE: sender requested "for-your-eyes-only"
gpg: data not saved; use option "--output" to save it

I've already found this, but it's without a solution:
http://lists.gnupg.org/pipermail/gnupg-users/2003-October/020555.html
Do you need more information?

Details

Version
gpg (GnuPG) 1.4.16

Event Timeline

fs1 set Version to gpg (GnuPG) 1.4.16.
fs1 added a subscriber: fs1.

You need to close the input if you enter the inpout on the tty. On Unix with
Ctrl-D on Windows with Ctrl-Z. You actually did that:

  If I press Ctrl + D it ends with the following message:
  gpg: NOTE: sender requested "for-your-eyes-only"
  gpg: data not saved; use option "--output" to save it

For-your-eyes-only is a PGP feature; if you want to save the output, weel, use
--output FILENAME.

werner claimed this task.
werner added a project: Not A Bug.

What I am requested to do to see the output on the tty?
I do not understand that I have to close the input since I've already entered
the passphrase...

The passphrase is taken directly from the tty but the input tdata from stdin.
These are different input sources. The passphrase prompt pops up as soon as gpg
needs it.

You won't see the output on the tty becuase the sender used the
--for-your-eyes-only feature. Here is a trick to show it anyway:

  gpg --output -

[Please send firther usage questions to the mailing list and not to the bug
tracker.]