[horde] Patch for framework's Crypt/pgp.php - Makes PGP work with latest GnuPG on Windows based systems

LRM lrm at ionline.com.br
Sat Sep 11 21:56:31 PDT 2004


Greetings!

Here's a small patch for the Horde framework's Crypt/pgp.php

It makes PGP work on Windows-based systems with the latest GnuPG for Win32.

A *nix like command line was being passed that's not supported on Windows
systems. It was two commands in one, first setting an env var LANG and then
executing gpg. Since I guess the LANG env var isn't needed on Windows for
Horde's purposes, the fix involves checking for Windows OS and disable
setting that var.

Surprisingly, the gpg.exe's stdin on Windows had problems receiving a block
of data with "\x0d\x0a" codes, so it was failing to detect public keys to
properly verify the passphrase, for example. A check has been added for both
Windows OS and "\x0d\x0a" presence, rebuilding the string again to feed
gpg.exe's stdin with a proper line-by-line stream.

So the code remains intact, only two checks added for these specific Windows
cases.

Hope this helps for now those who were trying to use Horde's PGP on Windows
systems, and if someone knows a better/faster/etc way to do this, let us
know. :-]


LRM


-------------- next part --------------
A non-text attachment was scrubbed...
Name: framework_crypt_pgp.php_windows.patch
Type: application/octet-stream
Size: 1505 bytes
Desc: not available
Url : http://lists.horde.org/archives/horde/attachments/20040912/3a4c6171/framework_crypt_pgp.php_windows-0002.obj


More information about the horde mailing list