summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Warg <mw@it-sls.de>2010-03-29 12:48:45 +0200
committerMarkus Warg <mw@it-sls.de>2010-03-29 12:48:45 +0200
commita84f4ce8db95ec6edf552d6d372e24a9cbf09d5a (patch)
tree5e9bfac1670d82ab8b9d979e128a0a2be3474347
parent6c2e9fb5dc29c53e2daa980272789b79827f6a22 (diff)
downloadcacert-a84f4ce8db95ec6edf552d6d372e24a9cbf09d5a.tar.gz
cacert-a84f4ce8db95ec6edf552d6d372e24a9cbf09d5a.tar.xz
cacert-a84f4ce8db95ec6edf552d6d372e24a9cbf09d5a.zip
follow up to mantis bug #814
fix issue with potentially too big key blocks
-rw-r--r--www/gpg.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/www/gpg.php b/www/gpg.php
index 894f298..526bcad 100644
--- a/www/gpg.php
+++ b/www/gpg.php
@@ -83,7 +83,15 @@ function verifyEmail($email)
if($oldid == "0" && $CSR != "")
{
$debugkey = $gpgkey = clean_gpgcsr($CSR);
- $debugpg = $gpg = trim(`echo "$gpgkey"|gpg --with-colons --homedir /tmp 2>&1`);
+ #$debugpg = $gpg = trim(`echo "$gpgkey"|gpg --with-colons --homedir /tmp 2>&1`);
+
+ $tnam = tempnam('/tmp/', '__gpg');
+ $fp = fopen($tnam, 'w');
+ fwrite($fp, $gpgkey);
+ fclose($fp);
+ $debugpg = $gpg = trim(`gpg --with-colons --homedir /tmp 2>&1 < $tnam`);
+ unlink($tnam);
+
$lines = "";
$gpgarr = explode("\n", $gpg);
foreach($gpgarr as $line)