follow up to mantis bug #814
authorMarkus Warg <mw@it-sls.de>
Mon, 29 Mar 2010 10:48:45 +0000 (12:48 +0200)
committerMarkus Warg <mw@it-sls.de>
Mon, 29 Mar 2010 10:48:45 +0000 (12:48 +0200)
fix issue with potentially too big key blocks

www/gpg.php

index 894f298..526bcad 100644 (file)
@@ -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)