--passphrase-fd with a pipe handle under Win32

Maxim Masiutin max@ritlabs.com
Sun Apr 22 01:17:02 2001


Hello!

  I'm writing a program that launches GnuPG in --batch mode, it
  creates pipes via CreatePipe() Win32 API function and uses these
  pipes as stdin/stdout/stderr handles to pass data to GnuPG and get the
  result back.

  However, I can't manage to transfer a passphrase via passphrase-fd
  using pipes. If I pass a pipe handle as a parameter of
  --passphrase-fd, GnuPG alyaws reports

gpg: no default secret key: bad passphrase
gpg: [stdin]: sign+encrypt failed: bad passphrase  
  
  I found a workaround: to specify the passphrase via stdin,
  delimiting the passphrase from data by LF character.
  --passphrase-fd 0 is using in that case. I don't like this solution
  much because the passphrase is mixed with data to be signed. It
  introduces the potential risk of passphrase to be exposed.

  Did anyone spawn GnuPG under Win32?

-- 
Maxim Masiutin
Vice President, Ritlabs S.R.L. 
http://www.ritlabs.com/