using --status-fd

Sven-S. Porst ssssp@gmx.net
Sun Jan 20 19:38:01 2002


>If I understand your problem, you don't know how to handle GPG
>questions? With the --command-fd switch you can use a file descriptor
>to send the answers. For example:

Not quite. I am actually happy using the --status-fd and --command-fd
options and answering the questions for passphrases etc. The thing that
isn't clear to me is when I have to enter the _message_ I want to sign/
encrypt if it isn't coming from a file as it is in your example. 

In your example, say we don't give the file foo, then it seems the
message to be signed has to be written after the GOOD_PASSPHRASE message

|gpg --status-fd=2 --command-fd=0 --sign 
|
|[GNUPG:] GET_HIDDEN passphrase.enter
|>> bar
|[GNUPG:] GOOD_PASSPHRASE
|>>message
|>>^D

.. so in this case I could trigger dumping the message to command-fd and
sending ^D when receiving GOOD_PASSPHRASE. If, however, I am encrypting
the message only, the appearance of BEGIN_ENCRYPTION seems to be a good
time to dump the message. And worst of all, when I am signing and
encrypting, it _seems_ that dumping the message after receiving
GOOD_PASSPHRASE is a good idea - but it isn't because after sending
GOOD_PASSPHRASE, gpg may still send a '[GNUPG:] GET_BOOL
untrusted_key.override' message if I am encrypting to unsigned keys - so
I don't see a reliable condition that I can use to trigger the dumping of
the message and closing the input. 

I had expected to see some kind of GET_MESSAGE command on status-fd as a
trigger but that doesn't seem to exist so I suspect my approach may be
completely wrong. I hope the problem I have is more clear this time.

Cheers
    
            Sven
    
-- 
Sven-S. Porst . PGP: 0x0085ABA3 . http://homepage.mac.com/ssp
                               Does anybody remember laughter?