[horde] GNUPG - Windows - Horde Framework Problems & LittleFix

LRM lrm at ionline.com.br
Thu Sep 9 12:44:16 PDT 2004


Thanks for the info Chuck, and yes, sorry for the hardcore "what the hell",
didn't mean to be "bad" ;-)

The other problem i'm facing now is when checking the passphrase.

The problem is happening when the framework try to copy the public key to a
temp file to make the encrypt message test.

I've noticed that this piece of code on the Crypt/pgp.php, function
_callGPG, calls gpg.exe with a command line and starts sending lines of my
public key to its stdin, so it can write it to a temp binary file. Well,
gpg.exe its just not writing a single line of text to the temp file,
resulting on the failure to check the passphrase properly later. The code is
perfect and simple so its not the problem here as i´ll explain later.

        if ($mode == 'w') {
            $fp = popen($cmdline, 'w');
            if (is_array($input)) {
                foreach ($input as $line) {

                    fputs($fp, $line . "\n");

                }
            } else {
                fputs($fp, $input);
            }
        } elseif ($mode == 'r') { .....

That loop that invokes "fputs" is passing the public key lines perfectly to
the "fputs" command as ive debugged. But, for some weird reason, the
"gpg.exe" is not getting it, thus not writing anything to the output file
(it creates the file but 0byte), and making the whole passphrase check thing
fail later, of course.

So what i´m doing now is running the command lines manually, specially the
one that does this public key grabbing and writing to a temp file, which is,
in my case:


D:\GnuPG\gpg.exe --no-tty --no-secmem-warning --no-options --no-default-keyr
ing --quiet --yes --homedir
D:\PHP\uploadtemp/1fju8q0b --allow-secret-key-import --fast-import --keyring
D:\PHP\uploadtemp/1fju8q0b\hor5D0.tmp

This way gpg.exe blocks the command prompt waiting for data, so it can
detect a public key text and write it to the temp keyring file, but, when
doing manually, it only writes (or detects) the public key when i paste it
twice to the command prompt, not once.

So i guess solving this little problem would solve everything from now on to
the passphrase test.

Since i´m getting bald over this pulling my hair out, have you or the list
community members any idea why gpg.exe is behaving that way, not detecting
the public key on the first paste but only after u paste it twice to its
stdin?

Thanks a lot again

LRM




----- Original Message ----- 
From: "Chuck Hagenbuch" <chuck at horde.org>
To: <horde at lists.horde.org>
Sent: Thursday, September 09, 2004 3:52 PM
Subject: Re: [horde] GNUPG - Windows - Horde Framework Problems & LittleFix


> Quoting LRM <lrm at ionline.com.br>:
>
> > So heres a little workaround for those trying to generate the keys on
> > a Windows environment, and i would like to ask what the hell is that
> > 'LANG= ;' thing doing on the beginning of the command line, before
> > the .exe name itself... So i can understand what that was supposed to
> > do and prolly patch it properly..
>
> Setting an environment variable named "LANG". Please try to keep your
language
> relatively professional on the lists, thanks.
>
> -chuck
>
> --
> "But she goes not abroad in search of monsters to destroy." - John
> Quincy Adams
> -- 
> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org




More information about the horde mailing list