using verify over stdin

Justin Karneges justin-psi at
Wed Nov 6 02:22:01 CET 2002

> > So how do you read the passphrase "on-demand" ?  Or is this just not
> > possible?
> >
> > I don't want to prompt the user unless the status says "NEED_PASSPHRASE".
> Use --command-fd.  When you get status NEED_PASSPHRASE, send the
> passphrase on the command-fd.

Hmm, unless I'm doing something else wrong, this appears not to work.

Here is an sample command I send from my application:

gpg --batch --enable-special-filenames --status-fd 12 --command-fd 9 --armor 

Next I pass the encrypted block across stdin.

I then get NEED_PASSPHRASE and BAD_PASSPHRASE immediately on status-fd.  The 
pipe for command-fd is available (it is the exact same code as passphrase, I 
just changed the flag to "--command-fd" instead), but it seems like gpg does 
not wait for me to write to it.  I tried putting the passphrase into the pipe 
before sending the encrypted block, but no good.  Is there something else I 
should know?


More information about the Gnupg-devel mailing list