Page MenuHome GnuPG

--decrypt from stdin works inconsistently
Closed, ResolvedPublic

Description

Release: gpg (GnuPG) 1.4.1

Environment

Athlon XP 2500, Gentoo Linux, 2.6.12-gentoo-r10

Description

pasting a message to decrypt works inconsistently using gpg -d. The following command works without any modification:

echo "...copied text" | gpg -d
[passphrase requested and entered]
[key information displayed]
[decrypted text output to stdout]

as opposed to:

gpg -d
copied text pasted here to stdin
[passphrase requested and entered]
[key information displayed]
blank line displayed after key information and cursor waits
[Ctrl-D] pressed (trial and error :))
[decrypted text output to stdout]

I believe that once the passphrase has been entered, -d|--decrypt should immediately display text on stdout. Ctrl-D should not be required (as it would be when encrypting from stdin). JM2C

How To Repeat

echo "...copied text" | gpg -d
vs
gpg -d
[paste copied text]

Fix

Re program to not require a ctrl D after passphrase

Event Timeline

dshaw added a subscriber: dshaw.

This is not a bug. The EOF is required to terminate stdin
just like any file or pipe. If it didn't, then handling
large files would be impossible. GPG prompts for the
passphrase early on - but could continue reading gigabytes
of data before EOF.