From b8f46d9c412213e02e52555937ce505278b2fac6 Mon Sep 17 00:00:00 2001 From: Wytze van der Raay Date: Thu, 29 Aug 2013 10:03:50 +0000 Subject: [PATCH] Fix for https://bugs.cacert.org/view.php?id=1017 "Chrome certificate enrollement" --- pages/account/6.php | 186 +++++++++++++++++++------------------------- 1 file changed, 78 insertions(+), 108 deletions(-) diff --git a/pages/account/6.php b/pages/account/6.php index ae72730..0054b7a 100644 --- a/pages/account/6.php +++ b/pages/account/6.php @@ -14,12 +14,15 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ ?> -"._("Installing your certificate")."\n"; - echo "

"._("You are about to install a certificate, if you are using mozilla/netscape based browsers you will not be informed that the certificate was installed successfully, you can go into the options dialog box, security and manage certificates to view if it was installed correctly however.")."

\n"; - echo "

"._("Click here")." "._("to install your certificate.")."

\n"; - showfooter(); - exit; - } - } else { - showheader(_("My CAcert.org Account!")); -?> -

+ $cert = `/usr/bin/openssl x509 -in $crtname $outform`; -

+ header("Content-Type: application/pkix-cert"); + header("Content-Length: ".strlen($cert)); - - - -

-"> -
+ $fname = sanitizeFilename($row['CN']); + if ($fname=="") $fname="certificate"; + header("Content-Disposition: attachment; filename=\"${fname}.${extension}\""); -

+ echo $cert; + exit; - - -

-
+} else { + showheader(_("My CAcert.org Account!"), _("Install your certificate")); + echo ''; + + // Allow to directly copy and paste the cert in PEM format + $crtname=escapeshellarg($row['crt_name']); + $cert = `/usr/bin/openssl x509 -in $crtname -outform PEM`; + echo "
$cert
"; + ?>
- + 0) @@ -213,4 +183,4 @@