Source code taken from cacert-20121211.tar.bz2
authorMichael Tänzer <neo@nhng.de>
Tue, 11 Dec 2012 22:57:48 +0000 (23:57 +0100)
committerMichael Tänzer <neo@nhng.de>
Tue, 11 Dec 2012 22:57:48 +0000 (23:57 +0100)
20 files changed:
includes/account.php
includes/account_stuff.php
includes/lib/check_weak_key.php [new file with mode: 0644]
includes/lib/general.php
pages/account/0.php
pages/account/13.php
pages/account/24.php
pages/account/27.php
pages/account/33.php
pages/account/40.php
pages/account/49.php
pages/index/0.php
pages/index/11.php
pages/index/13.php
pages/index/21.php
pages/wot/4.php
www/api/ccsr.php
www/cap.php
www/policy/PrivacyPolicy.html
www/wot.php

index f84eb63..8125602 100644 (file)
@@ -17,6 +17,7 @@
 */
        require_once("../includes/loggedin.php");
        require_once("../includes/lib/l10n.php");
+       require_once('lib/check_weak_key.php');
 
        loadem("account");
 
                        exit;
                }
                $row = mysql_fetch_assoc($res);
-               $body  = sprintf(_("Hi %s,"),$_SESSION['profile']['fname'])."\n";
-               $body .= _("You are receiving this email because you or someone else")."\n";
-               $body .= _("has changed the default email on your account.")."\n\n";
+               $body  = sprintf(_("Hi %s,"),$_SESSION['profile']['fname'])."\n\n";
+               $body .= _("You are receiving this email because you or someone else ".
+                               "has changed the default email on your account.")."\n\n";
 
                $body .= _("Best regards")."\n"._("CAcert.org Support!");
 
                                                where `id`='".$_SESSION['profile']['id']."'");
                                echo '<h3>', _("Pass Phrase Changed Successfully"), '</h3>', "\n";
                                echo _("Your Pass Phrase has been updated and your primary email account has been notified of the change.");
-                               $body  = sprintf(_("Hi %s,"),$_SESSION['profile']['fname'])."\n";
-                               $body .= _("You are receiving this email because you or someone else")."\n";
-                               $body .= _("has changed the password on your account.")."\n";
+                               $body  = sprintf(_("Hi %s,"),$_SESSION['profile']['fname'])."\n\n";
+                               $body .= _("You are receiving this email because you or someone else ".
+                                               "has changed the password on your account.")."\n\n";
 
                                $body .= _("Best regards")."\n"._("CAcert.org Support!");
 
                        printf(_("The password for %s has been updated successfully in the system."), sanitizeHTML($row['email']));
 
 
-                       $body  = sprintf(_("Hi %s,"),$row['fname'])."\n";
-                       $body .= _("You are receiving this email because a CAcert administrator")."\n";
-                       $body .= _("has changed the password on your account.")."\n";
+                       $body  = sprintf(_("Hi %s,"),$row['fname'])."\n\n";
+                       $body .= _("You are receiving this email because a CAcert administrator ".
+                                       "has changed the password on your account.")."\n\n";
 
                        $body .= _("Best regards")."\n"._("CAcert.org Support!");
 
index 794266a..148a0ac 100644 (file)
@@ -284,361 +284,3 @@ function hideall() {
 </body>             
 </html><?
        }
-       
-       /**
-        * Produces a log entry with the error message with log level E_USER_WARN
-        * and a random ID an returns a message that can be displayed to the user
-        * including the generated ID
-        * 
-        * @param $errormessage string
-        *              The error message that should be logged
-        * @return string containing the generated ID that can be displayed to the
-        *              user
-        */
-       function failWithId($errormessage) {
-               $errorId = rand();
-               trigger_error("$errormessage. ID: $errorId", E_USER_WARNING);
-               return sprintf(_("Something went wrong when processing your request. ".
-                               "Please contact %s for help and provide them with the ".
-                               "following ID: %d"),
-                       "<a href='mailto:support@cacert.org?subject=System%20Error%20-%20".
-                               "ID%3A%20$errorId'>support@cacert.org</a>",
-                       $errorId);
-       }
-       
-       /**
-        * Checks whether the given CSR contains a vulnerable key
-        * 
-        * @param $csr string
-        *              The CSR to be checked
-        * @param $encoding string [optional]
-        *              The encoding the CSR is in (for the "-inform" parameter of OpenSSL,
-        *              currently only "PEM" (default) or "DER" allowed)
-        * @return string containing the reason if the key is considered weak,
-        *              empty string otherwise
-        */
-       function checkWeakKeyCSR($csr, $encoding = "PEM")
-       {
-               // non-PEM-encodings may be binary so don't use echo
-               $descriptorspec = array(
-                       0 => array("pipe", "r"), // STDIN for child
-                       1 => array("pipe", "w"), // STDOUT for child
-               );
-               $encoding = escapeshellarg($encoding);
-               $proc = proc_open("openssl req -inform $encoding -text -noout",
-                       $descriptorspec, $pipes);
-               
-               if (is_resource($proc))
-               {
-                       fwrite($pipes[0], $csr);
-                       fclose($pipes[0]);
-                       
-                       $csrText = ""; 
-                       while (!feof($pipes[1]))
-                       {
-                               $csrText .= fread($pipes[1], 8192);
-                       }
-                       fclose($pipes[1]);
-                       
-                       if (($status = proc_close($proc)) !== 0 || $csrText === "")
-                       {
-                               return _("I didn't receive a valid Certificate Request, hit ".
-                               "the back button and try again.");
-                       }
-               } else {
-                       return failWithId("checkWeakKeyCSR(): Failed to start OpenSSL");
-               }
-               
-               
-               return checkWeakKeyText($csrText);
-       }
-       
-       /**
-        * Checks whether the given X509 certificate contains a vulnerable key
-        * 
-        * @param $cert string
-        *              The X509 certificate to be checked
-        * @param $encoding string [optional]
-        *              The encoding the certificate is in (for the "-inform" parameter of
-        *              OpenSSL, currently only "PEM" (default), "DER" or "NET" allowed)
-        * @return string containing the reason if the key is considered weak,
-        *              empty string otherwise
-        */
-       function checkWeakKeyX509($cert, $encoding = "PEM")
-       {
-               // non-PEM-encodings may be binary so don't use echo
-               $descriptorspec = array(
-                       0 => array("pipe", "r"), // STDIN for child
-                       1 => array("pipe", "w"), // STDOUT for child
-               );
-               $encoding = escapeshellarg($encoding);
-               $proc = proc_open("openssl x509 -inform $encoding -text -noout",
-                       $descriptorspec, $pipes);
-               
-               if (is_resource($proc))
-               {
-                       fwrite($pipes[0], $cert);
-                       fclose($pipes[0]);
-                       
-                       $certText = ""; 
-                       while (!feof($pipes[1]))
-                       {
-                               $certText .= fread($pipes[1], 8192);
-                       }
-                       fclose($pipes[1]);
-                       
-                       if (($status = proc_close($proc)) !== 0 || $certText === "")
-                       {
-                               return _("I didn't receive a valid Certificate Request, hit ".
-                               "the back button and try again.");
-                       }
-               } else {
-                       return failWithId("checkWeakKeyCSR(): Failed to start OpenSSL");
-               }
-               
-               
-               return checkWeakKeyText($certText);
-       }
-       
-       /**
-        * Checks whether the given SPKAC contains a vulnerable key
-        * 
-        * @param $spkac string
-        *              The SPKAC to be checked
-        * @param $spkacname string [optional]
-        *              The name of the variable that contains the SPKAC. The default is
-        *              "SPKAC"
-        * @return string containing the reason if the key is considered weak,
-        *              empty string otherwise
-        */
-       function checkWeakKeySPKAC($spkac, $spkacname = "SPKAC")
-       {
-               /* Check for the debian OpenSSL vulnerability */
-               
-               $spkac = escapeshellarg($spkac);
-               $spkacname = escapeshellarg($spkacname);
-               $spkacText = `echo $spkac | openssl spkac -spkac $spkacname`;
-               if ($spkacText === null) {
-                       return _("I didn't receive a valid Certificate Request, hit the ".
-                               "back button and try again.");
-               }
-               
-               return checkWeakKeyText($spkacText);
-       }
-       
-       /**
-        * Checks whether the given text representation of a CSR or a SPKAC contains
-        * a weak key
-        * 
-        * @param $text string
-        *              The text representation of a key as output by the
-        *              "openssl <foo> -text -noout" commands
-        * @return string containing the reason if the key is considered weak,
-        *              empty string otherwise
-        */
-       function checkWeakKeyText($text)
-       {
-               /* Which public key algorithm? */
-               if (!preg_match('/^\s*Public Key Algorithm: ([^\s]+)$/m', $text,
-                               $algorithm))
-               {
-                       return failWithId("checkWeakKeyText(): Couldn't extract the ".
-                                       "public key algorithm used");
-               } else {
-                       $algorithm = $algorithm[1];
-               }
-               
-               
-               if ($algorithm === "rsaEncryption")
-               {
-                       if (!preg_match('/^\s*RSA Public Key: \((\d+) bit\)$/m', $text,
-                                       $keysize))
-                       {
-                               return failWithId("checkWeakKeyText(): Couldn't parse the RSA ".
-                                               "key size");
-                       } else {
-                               $keysize = intval($keysize[1]);
-                       }
-                       
-                       if ($keysize < 1024)
-                       {
-                               return sprintf(_("The keys that you use are very small ".
-                                               "and therefore insecure. Please generate stronger ".
-                                               "keys. More information about this issue can be ".
-                                               "found in %sthe wiki%s"),
-                                       "<a href='//wiki.cacert.org/WeakKeys#SmallKey'>",
-                                       "</a>");
-                       } elseif ($keysize < 2048) {
-                               // not critical but log so we have some statistics about
-                               // affected users
-                               trigger_error("checkWeakKeyText(): Certificate for small ".
-                                               "key (< 2048 bit) requested", E_USER_NOTICE);
-                       }
-                       
-                       
-                       $debianVuln = checkDebianVulnerability($text, $keysize);
-                       if ($debianVuln === true)
-                       {
-                               return sprintf(_("The keys you use have very likely been ".
-                                               "generated with a vulnerable version of OpenSSL which ".
-                                               "was distributed by debian. Please generate new keys. ".
-                                               "More information about this issue can be found in ".
-                                               "%sthe wiki%s"),
-                                       "<a href='//wiki.cacert.org/WeakKeys#DebianVulnerability'>",
-                                       "</a>");
-                       } elseif ($debianVuln === false) {
-                               // not vulnerable => do nothing
-                       } else {
-                               return failWithId("checkWeakKeyText(): Something went wrong in".
-                                       "checkDebianVulnerability()");
-                       }
-                       
-                       if (!preg_match('/^\s*Exponent: (\d+) \(0x[0-9a-fA-F]+\)$/m', $text,
-                                       $exponent))
-                       {
-                               return failWithId("checkWeakKeyText(): Couldn't parse the RSA ".
-                                               "exponent");
-                       } else {
-                               $exponent = $exponent[1]; // exponent might be very big =>
-                                       //handle as string using bc*()  
-                               
-                               if (bccomp($exponent, "3") === 0)
-                               {
-                                       return sprintf(_("The keys you use might be insecure. ".
-                                                       "Although there is currently no known attack for ".
-                                                       "reasonable encryption schemes, we're being ".
-                                                       "cautious and don't allow certificates for such ".
-                                                       "keys. Please generate stronger keys. More ".
-                                                       "information about this issue can be found in ".
-                                                       "%sthe wiki%s"),
-                                               "<a href='//wiki.cacert.org/WeakKeys#SmallExponent'>",
-                                               "</a>");
-                               } elseif (!(bccomp($exponent, "65537") >= 0 &&
-                                               (bccomp($exponent, "100000") === -1 ||
-                                                       // speed things up if way smaller than 2^256
-                                               bccomp($exponent, bcpow("2", "256")) === -1) )) {
-                                       // 65537 <= exponent < 2^256 recommended by NIST
-                                       // not critical but log so we have some statistics about
-                                       // affected users
-                                       trigger_error("checkWeakKeyText(): Certificate for ".
-                                                       "unsuitable exponent '$exponent' requested",
-                                                       E_USER_NOTICE);
-                               }
-                       }
-               }
-               
-               /* No weakness found */
-               return "";
-       }
-       
-       /**
-        * Reimplement the functionality of the openssl-vulnkey tool
-        * 
-        * @param $text string
-        *              The text representation of a key as output by the
-        *              "openssl <foo> -text -noout" commands
-        * @param $keysize int [optional]
-        *              If the key size is already known it can be provided so it doesn't
-        *              have to be parsed again. This also skips the check whether the key
-        *              is an RSA key => use wisely
-        * @return TRUE if key is vulnerable, FALSE otherwise, NULL in case of error
-        */
-       function checkDebianVulnerability($text, $keysize = 0)
-       {
-               $keysize = intval($keysize);
-               
-               if ($keysize === 0)
-               {
-                       /* Which public key algorithm? */
-                       if (!preg_match('/^\s*Public Key Algorithm: ([^\s]+)$/m', $text,
-                               $algorithm))
-                       {
-                               trigger_error("checkDebianVulnerability(): Couldn't extract ".
-                                       "the public key algorithm used", E_USER_WARNING);
-                               return null;
-                       } else {
-                               $algorithm = $algorithm[1];
-                       }
-                       
-                       if ($algorithm !== "rsaEncryption") return false;
-                       
-                       /* Extract public key size */
-                       if (!preg_match('/^\s*RSA Public Key: \((\d+) bit\)$/m', $text,
-                               $keysize))
-                       {
-                               trigger_error("checkDebianVulnerability(): Couldn't parse the ".
-                                       "RSA key size", E_USER_WARNING);
-                               return null;
-                       } else {
-                               $keysize = intval($keysize[1]);
-                       }
-               }
-               
-               // $keysize has been made sure to contain an int
-               $blacklist = "/usr/share/openssl-blacklist/blacklist.RSA-$keysize";
-               if (!(is_file($blacklist) && is_readable($blacklist)))
-               {
-                       if (in_array($keysize, array(512, 1024, 2048, 4096)))
-                       {
-                               trigger_error("checkDebianVulnerability(): Blacklist for ".
-                                               "$keysize bit keys not accessible. Expected at ".
-                                               "$blacklist", E_USER_ERROR);
-                               return null;
-                       }
-                       
-                       trigger_error("checkDebianVulnerability(): $blacklist is not ".
-                               "readable. Unsupported key size?", E_USER_WARNING);
-                       return false;
-               }
-               
-               
-               /* Extract RSA modulus */
-               if (!preg_match('/^\s*Modulus \(\d+ bit\):\n'.
-                               '((?:\s*[0-9a-f][0-9a-f]:(?:\n)?)+[0-9a-f][0-9a-f])$/m',
-                       $text, $modulus))
-               {
-                       trigger_error("checkDebianVulnerability(): Couldn't extract the ".
-                               "RSA modulus", E_USER_WARNING);
-                       return null;
-               } else {
-                       $modulus = $modulus[1];
-                       // strip whitespace and colon leftovers
-                       $modulus = str_replace(array(" ", "\t", "\n", ":"), "", $modulus);
-                       
-                       // when using "openssl xxx -text" first byte was 00 in all my test
-                       // cases but 00 not present in the "openssl xxx -modulus" output
-                       if ($modulus[0] === "0" && $modulus[1] === "0")
-                       {
-                               $modulus = substr($modulus, 2);
-                       } else {
-                               trigger_error("checkDebianVulnerability(): First byte is not ".
-                                       "zero", E_USER_NOTICE);
-                       }
-                       
-                       $modulus = strtoupper($modulus);
-               }
-               
-               
-               /* calculate checksum and look it up in the blacklist */
-               $checksum = substr(sha1("Modulus=$modulus\n"), 20);
-               
-               // $checksum and $blacklist should be safe, but just to make sure
-               $checksum = escapeshellarg($checksum);
-               $blacklist = escapeshellarg($blacklist);
-               exec("grep $checksum $blacklist", $dummy, $debianVuln);
-               if ($debianVuln === 0) // grep returned something => it is on the list
-               {
-                       return true;
-               } elseif ($debianVuln === 1) { // grep returned nothing
-                       return false;
-               } else {
-                       trigger_error("checkDebianVulnerability(): Something went wrong ".
-                               "when looking up the key with checksum $checksum in the ".
-                               "blacklist $blacklist", E_USER_ERROR);
-                       return null;
-               }
-               
-               // Should not get here
-               return null;
-       }
-?>
diff --git a/includes/lib/check_weak_key.php b/includes/lib/check_weak_key.php
new file mode 100644 (file)
index 0000000..ca13ba2
--- /dev/null
@@ -0,0 +1,323 @@
+<?php /*
+    LibreSSL - CAcert web application
+    Copyright (C) 2004-2011  CAcert Inc.
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; version 2 of the License.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    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
+*/
+
+// failWithId()
+require_once 'general.php';
+
+
+/**
+* Checks whether the given CSR contains a vulnerable key
+*
+* @param $csr string
+*              The CSR to be checked
+* @param $encoding string [optional]
+*              The encoding the CSR is in (for the "-inform" parameter of OpenSSL,
+*              currently only "PEM" (default) or "DER" allowed)
+* @return string containing the reason if the key is considered weak,
+*              empty string otherwise
+*/
+function checkWeakKeyCSR($csr, $encoding = "PEM")
+{
+       $encoding = escapeshellarg($encoding);
+       $status = runCommand("openssl req -inform $encoding -text -noout",
+                            $csr, $csrText);
+       if ($status === true) {
+               return failWithId("checkWeakKeyCSR(): Failed to start OpenSSL");
+       }
+       
+       if ($status !== 0 || $csrText === "") {
+               return _("I didn't receive a valid Certificate Request. Hit ".
+                       "the back button and try again.");
+       }
+       
+       return checkWeakKeyText($csrText);
+}
+
+/**
+ * Checks whether the given X509 certificate contains a vulnerable key
+ *
+ * @param $cert string
+ *             The X509 certificate to be checked
+ * @param $encoding string [optional]
+ *             The encoding the certificate is in (for the "-inform" parameter of
+ *             OpenSSL, currently only "PEM" (default), "DER" or "NET" allowed)
+ * @return string containing the reason if the key is considered weak,
+ *             empty string otherwise
+ */
+function checkWeakKeyX509($cert, $encoding = "PEM")
+{
+       $encoding = escapeshellarg($encoding);
+       $status = runCommand("openssl x509 -inform $encoding -text -noout",
+                            $cert, $certText);
+       if ($status === true) {
+               return failWithId("checkWeakKeyX509(): Failed to start OpenSSL");
+       }
+       
+       if ($status !== 0 || $certText === "") {
+               return _("I didn't receive a valid Certificate Request. Hit ".
+                       "the back button and try again.");
+       }
+       
+       return checkWeakKeyText($certText);
+}
+
+/**
+ * Checks whether the given SPKAC contains a vulnerable key
+ *
+ * @param $spkac string
+ *             The SPKAC to be checked
+ * @param $spkacname string [optional]
+ *             The name of the variable that contains the SPKAC. The default is
+ *             "SPKAC"
+ * @return string containing the reason if the key is considered weak,
+ *             empty string otherwise
+ */
+function checkWeakKeySPKAC($spkac, $spkacname = "SPKAC")
+{
+       $spkacname = escapeshellarg($spkacname);
+       $status = runCommand("openssl spkac -spkac $spkacname", $spkac, $spkacText);
+       if ($status === true) {
+               return failWithId("checkWeakKeySPKAC(): Failed to start OpenSSL");
+       }
+       
+       if ($status !== 0 || $spkacText === "") {
+               return _("I didn't receive a valid Certificate Request. Hit the ".
+                       "back button and try again.");
+       }
+       
+       return checkWeakKeyText($spkacText);
+}
+
+/**
+ * Checks whether the given text representation of a CSR or a SPKAC contains
+ * a weak key
+ *
+ * @param $text string
+ *             The text representation of a key as output by the
+ *             "openssl <foo> -text -noout" commands
+ * @return string containing the reason if the key is considered weak,
+ *             empty string otherwise
+ */
+function checkWeakKeyText($text)
+{
+       /* Which public key algorithm? */
+       if (!preg_match('/^\s*Public Key Algorithm: ([^\s]+)$/m', $text,
+       $algorithm))
+       {
+               return failWithId("checkWeakKeyText(): Couldn't extract the ".
+                                       "public key algorithm used.\nData:\n$text");
+       } else {
+               $algorithm = $algorithm[1];
+       }
+
+
+       if ($algorithm === "rsaEncryption")
+       {
+               if (!preg_match('/^\s*RSA Public Key: \((\d+) bit\)$/m', $text,
+               $keysize))
+               {
+                       return failWithId("checkWeakKeyText(): Couldn't parse the RSA ".
+                                               "key size.\nData:\n$text");
+               } else {
+                       $keysize = intval($keysize[1]);
+               }
+                       
+               if ($keysize < 1024)
+               {
+                       return sprintf(_("The keys that you use are very small ".
+                                               "and therefore insecure. Please generate stronger ".
+                                               "keys. More information about this issue can be ".
+                                               "found in %sthe wiki%s"),
+                                       "<a href='//wiki.cacert.org/WeakKeys#SmallKey'>",
+                                       "</a>");
+               } elseif ($keysize < 2048) {
+                       // not critical but log so we have some statistics about
+                       // affected users
+                       trigger_error("checkWeakKeyText(): Certificate for small ".
+                                               "key (< 2048 bit) requested", E_USER_NOTICE);
+               }
+                       
+                       
+               $debianVuln = checkDebianVulnerability($text, $keysize);
+               if ($debianVuln === true)
+               {
+                       return sprintf(_("The keys you use have very likely been ".
+                                               "generated with a vulnerable version of OpenSSL which ".
+                                               "was distributed by debian. Please generate new keys. ".
+                                               "More information about this issue can be found in ".
+                                               "%sthe wiki%s"),
+                                       "<a href='//wiki.cacert.org/WeakKeys#DebianVulnerability'>",
+                                       "</a>");
+               } elseif ($debianVuln === false) {
+                       // not vulnerable => do nothing
+               } else {
+                       return failWithId("checkWeakKeyText(): Something went wrong in".
+                                       "checkDebianVulnerability().\nKeysize: $keysize\n".
+                                       "Data:\n$text");
+               }
+                       
+               if (!preg_match('/^\s*Exponent: (\d+) \(0x[0-9a-fA-F]+\)$/m', $text,
+               $exponent))
+               {
+                       return failWithId("checkWeakKeyText(): Couldn't parse the RSA ".
+                                               "exponent.\nData:\n$text");
+               } else {
+                       $exponent = $exponent[1]; // exponent might be very big =>
+                       //handle as string using bc*()
+
+                       if (bccomp($exponent, "3") === 0)
+                       {
+                               return sprintf(_("The keys you use might be insecure. ".
+                                                       "Although there is currently no known attack for ".
+                                                       "reasonable encryption schemes, we're being ".
+                                                       "cautious and don't allow certificates for such ".
+                                                       "keys. Please generate stronger keys. More ".
+                                                       "information about this issue can be found in ".
+                                                       "%sthe wiki%s"),
+                                               "<a href='//wiki.cacert.org/WeakKeys#SmallExponent'>",
+                                               "</a>");
+                       } elseif (!(bccomp($exponent, "65537") >= 0 &&
+                       (bccomp($exponent, "100000") === -1 ||
+                       // speed things up if way smaller than 2^256
+                       bccomp($exponent, bcpow("2", "256")) === -1) )) {
+                               // 65537 <= exponent < 2^256 recommended by NIST
+                               // not critical but log so we have some statistics about
+                               // affected users
+                               trigger_error("checkWeakKeyText(): Certificate for ".
+                                                       "unsuitable exponent '$exponent' requested",
+                               E_USER_NOTICE);
+                       }
+               }
+       }
+
+       /* No weakness found */
+       return "";
+}
+
+/**
+ * Reimplement the functionality of the openssl-vulnkey tool
+ *
+ * @param $text string
+ *             The text representation of a key as output by the
+ *             "openssl <foo> -text -noout" commands
+ * @param $keysize int [optional]
+ *             If the key size is already known it can be provided so it doesn't
+ *             have to be parsed again. This also skips the check whether the key
+ *             is an RSA key => use wisely
+ * @return TRUE if key is vulnerable, FALSE otherwise, NULL in case of error
+ */
+function checkDebianVulnerability($text, $keysize = 0)
+{
+       $keysize = intval($keysize);
+
+       if ($keysize === 0)
+       {
+               /* Which public key algorithm? */
+               if (!preg_match('/^\s*Public Key Algorithm: ([^\s]+)$/m', $text,
+               $algorithm))
+               {
+                       trigger_error("checkDebianVulnerability(): Couldn't extract ".
+                                       "the public key algorithm used.\nData:\n$text",
+                                       E_USER_WARNING);
+                       return null;
+               } else {
+                       $algorithm = $algorithm[1];
+               }
+                       
+               if ($algorithm !== "rsaEncryption") return false;
+                       
+               /* Extract public key size */
+               if (!preg_match('/^\s*RSA Public Key: \((\d+) bit\)$/m', $text,
+               $keysize))
+               {
+                       trigger_error("checkDebianVulnerability(): Couldn't parse the ".
+                                       "RSA key size.\nData:\n$text", E_USER_WARNING);
+                       return null;
+               } else {
+                       $keysize = intval($keysize[1]);
+               }
+       }
+
+       // $keysize has been made sure to contain an int
+       $blacklist = "/usr/share/openssl-blacklist/blacklist.RSA-$keysize";
+       if (!(is_file($blacklist) && is_readable($blacklist)))
+       {
+               if (in_array($keysize, array(512, 1024, 2048, 4096)))
+               {
+                       trigger_error("checkDebianVulnerability(): Blacklist for ".
+                                               "$keysize bit keys not accessible. Expected at ".
+                                               "$blacklist", E_USER_ERROR);
+                       return null;
+               }
+                       
+               trigger_error("checkDebianVulnerability(): $blacklist is not ".
+                               "readable. Unsupported key size?", E_USER_WARNING);
+               return false;
+       }
+
+
+       /* Extract RSA modulus */
+       if (!preg_match('/^\s*Modulus \(\d+ bit\):\n'.
+                               '((?:\s*[0-9a-f][0-9a-f]:(?:\n)?)+[0-9a-f][0-9a-f])$/m',
+       $text, $modulus))
+       {
+               trigger_error("checkDebianVulnerability(): Couldn't extract the ".
+                               "RSA modulus.\nData:\n$text", E_USER_WARNING);
+               return null;
+       } else {
+               $modulus = $modulus[1];
+               // strip whitespace and colon leftovers
+               $modulus = str_replace(array(" ", "\t", "\n", ":"), "", $modulus);
+                       
+               // when using "openssl xxx -text" first byte was 00 in all my test
+               // cases but 00 not present in the "openssl xxx -modulus" output
+               if ($modulus[0] === "0" && $modulus[1] === "0")
+               {
+                       $modulus = substr($modulus, 2);
+               } else {
+                       trigger_error("checkDebianVulnerability(): First byte is not ".
+                                       "zero", E_USER_NOTICE);
+               }
+                       
+               $modulus = strtoupper($modulus);
+       }
+
+
+       /* calculate checksum and look it up in the blacklist */
+       $checksum = substr(sha1("Modulus=$modulus\n"), 20);
+
+       // $checksum and $blacklist should be safe, but just to make sure
+       $checksum = escapeshellarg($checksum);
+       $blacklist = escapeshellarg($blacklist);
+       $debianVuln = runCommand("grep $checksum $blacklist");
+       if ($debianVuln === 0) // grep returned something => it is on the list
+       {
+               return true;
+       } elseif ($debianVuln === 1) {
+               // grep returned nothing
+               return false;
+       } else {
+               trigger_error("checkDebianVulnerability(): Something went wrong ".
+                               "when looking up the key with checksum $checksum in the ".
+                               "blacklist $blacklist", E_USER_ERROR);
+               return null;
+       }
+
+       // Should not get here
+       return null;
+}
index 25d2561..d91b24e 100644 (file)
@@ -47,4 +47,86 @@ function get_user_id_from_cert($serial, $issuer_cn)
        return -1;
 }
 
-?>
+/**
+ * Produces a log entry with the error message with log level E_USER_WARN
+ * and a random ID an returns a message that can be displayed to the user
+ * including the generated ID
+ *
+ * @param $errormessage string
+ *             The error message that should be logged
+ * @return string containing the generated ID that can be displayed to the
+ *             user
+ */
+function failWithId($errormessage) {
+       $errorId = rand();
+       trigger_error("$errormessage. ID: $errorId", E_USER_WARNING);
+       return sprintf(_("Something went wrong when processing your request. ".
+                               "Please contact %s for help and provide them with the ".
+                               "following ID: %d"),
+                       "<a href='mailto:support@cacert.org?subject=System%20Error%20-%20".
+                               "ID%3A%20$errorId'>support@cacert.org</a>",
+       $errorId);
+}
+
+
+/**
+ * Runs a command on the shell and return it's exit code and output
+ * 
+ * @param string $command
+ *             The command to run. Make sure that you escapeshellarg() any non-constant
+ *             parts as this is executed on a shell!
+ * @param string|bool $input
+ *             The input that is passed to the command via STDIN, if true the real
+ *             STDIN is passed through
+ * @param string|bool $output
+ *             The output the command wrote to STDOUT (this is passed as reference),
+ *             if true the output will be written to the real STDOUT. Output is ignored
+ *             by default
+ * @param string|bool $errors
+ *             The output the command wrote to STDERR (this is passed as reference),
+ *             if true (default) the output will be written to the real STDERR
+ * 
+ * @return int|bool
+ *             The exit code of the command, true if the execution of the command
+ *             failed (true because then
+ *             <code>if (runCommand('echo "foo"')) handle_error();</code> will work)
+ */
+function runCommand($command, $input = "", &$output = null, &$errors = true) {
+       $descriptorspec = array();
+       
+       if ($input !== true) {
+               $descriptorspec[0] = array("pipe", "r"); // STDIN for child
+       }
+       
+       if ($output !== true) {
+               $descriptorspec[1] = array("pipe", "w"); // STDOUT for child
+       }
+       
+       if ($errors !== true) {
+               $descriptorspec[2] = array("pipe", "w"); // STDERR for child
+       }
+       
+       $proc = proc_open($command, $descriptorspec, $pipes);
+       
+       if (is_resource($proc))
+       {
+               if ($input !== true) {
+                       fwrite($pipes[0], $input);
+                       fclose($pipes[0]);
+               }
+               
+               if ($output !== true) {
+                       $output = stream_get_contents($pipes[1]);
+               }
+               
+               if ($errors !== true) {
+                       $errors = stream_get_contents($pipes[2]);
+               }
+               
+               return proc_close($proc);
+               
+       } else {
+               return true;
+       }
+}
+
index 84b581e..b9b150c 100644 (file)
@@ -29,5 +29,4 @@
 <p><?=_("Once you have verified your company you will see these menu options. They allow you to issue as many certificates as you like without proving individual email accounts as you like, further more you are able to get your company details on the certificate.")?></p>
 <h4><?=_("CAcert Web of Trust")?></h4>
 <p><?=_("The Web of Trust system CAcert uses is similar to that many involved with GPG/PGP use, they hold face to face meetings to verify each others photo identities match their GPG/PGP key information. CAcert differs however in that we have modified things to work within the PKI framework, for you to gain trust in the system you must first locate someone already trusted. The trust person depending how many people they've trusted or meet before will determine how many points they can issue to you (the number of points they can issue is listed in the locate assurer section). Once you've met up you can show your ID and you will need to fill out a CAP form which the person assuring your details must retain for verification reasons.")?></p>
-<p><b><?=_("The former TTP (Trusted Third Party) System has been stopped, and is currently not available.")?></b></p>
-<? // "You can also get trust points via the Trust Third Party system where you go to a lawyer, bank manager, accountant, or public notary/juctise of the peace and they via your ID and fill in the TTP form to state they have viewed your ID documents and it appears authentic and true. More information on the TTP system can be found in the TTP sub-menu</p> ?>
+<p><b><?=sprintf(_("For information about the TTP-assisted-assurance program please read %s"),"<a href='//wiki.cacert.org/TTP/TTPuser'>https://wiki.cacert.org/TTP/TTPuser</a>","<a href='//wiki.cacert.org/TTP/TTPAL'>https://wiki.cacert.org/TTP/TTPAL</a>")?></b></p>
index e8dad73..c2b7cc5 100644 (file)
        $day = intval(substr($user['dob'], 8, 2));
 
        $body  = sprintf(_("Hi %s,"),$user['fname'])."\n\n";
-       $body .= _("You receive this automatic mail since you yourself or")."\n";
-       $body .= _("someone else looked up your secret questions and answers")."\n";
-       $body .= _("for a forgotten password.")."\n\n";
-       $body .= _("If it was you who looked up or changed that data, or clicked")."\n";
-       $body .= _("through the menu in your account, everything is in best order and")."\n";
-       $body .= _("you can ignore this mail.")."\n\n";
-       $body .= _("But if you received this mail without a recognisable reason,")."\n";
-       $body .= _("there is a danger that an unauthorised person accessed your")."\n";
-       $body .= _("account, and you should promptly change your password and your")."\n";
-       $body .= _("secret questions and answers.")."\n\n";
+       $body .= _("You receive this automatic mail since you yourself or someone ".
+                       "else looked up your secret questions and answers for a forgotten ".
+                       "password.\n\n".
+                       "If it was you who looked up or changed that data, or clicked ".
+                       "through the menu in your account, everything is in best order ".
+                       "and you can ignore this mail.\n\n".
+                       "But if you received this mail without a recognisable reason, ".
+                       "there is a danger that an unauthorised person accessed your ".
+                       "account, and you should promptly change your password and your ".
+                       "secret questions and answers.")."\n\n";
 
-       $body .= _("With kind regards,")."\n\n"._("CAcert Support");
+       $body .= _("Best regards")."\n"._("CAcert Support");
 
        sendmail($user['email'], "[CAcert.org] "._("Email Notification"), $body, "support@cacert.org", "", "", "CAcert Support");
 ?>
index 7f56023..14a47c0 100644 (file)
   </tr>
   <tr>
     <td class="DataTD"><?=_("Country")?>:</td>
-    <td class="DataTD"><input type="text" name="C" value="" size="5">(2 letter <a href="http://www.iso.org/iso/english_country_names_and_code_elements">ISO code</a>)</td>
+    <td class="DataTD"><input type="text" name="C" value="" size="5">
+        <?php printf(_('(2 letter %s ISO code %s )'),
+            '<a href="http://www.iso.org/iso/home/standards/country_codes/iso-3166-1_decoding_table.htm">',
+            '</a>')?>
+    </td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Comments")?>:</td>
index 9524620..a1086d4 100644 (file)
   </tr>
   <tr>
     <td class="DataTD"><?=_("Country")?>:</td>
-    <td class="DataTD"><input type="text" name="C" value="<?=($row['C'])?>" size="5"> (2 letter <a href="http://www.iso.org/iso/english_country_names_and_code_elements">ISO code</a>)</td>
+    <td class="DataTD"><input type="text" name="C" value="<?=($row['C'])?>" size="5">
+        <?php printf(_('(2 letter %s ISO code %s )'),
+            '<a href="http://www.iso.org/iso/home/standards/country_codes/iso-3166-1_decoding_table.htm">',
+            '</a>')?>
+    </td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Comments")?>:</td>
index 376a8b9..9e2f67a 100644 (file)
@@ -51,7 +51,7 @@
 <? } ?>
   <tr>
     <td class="DataTD"><?=_("Comments")?>:</td>
-    <td class="DataTD"><input type="text" name="comments" size=27 maxlength=20 value=""></td>
+    <td class="DataTD"><textarea name="comments" cols="30" rows="5"></textarea></td>
   </tr>
   <tr>
     <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Add")?>"></td>
index b1a7fdb..4877d79 100644 (file)
@@ -65,21 +65,14 @@ if(!array_key_exists('secrethash',$_SESSION['_config'])) $_SESSION['_config']['s
 </form>
 
 <p><b><?=_("Security Issues")?></b></p>
-<p><? sprintf(_("Please use any of the following ways to report security ".
+<p><?=sprintf(_("Please use any of the following ways to report security ".
        "issues: You can use the above contact form for sensitive information. ".
        "You can email us to %s. You can file a bugreport on %s and mark it as ".
        "private."),
        "<a href='mailto:support@cacert.org'>support@cacert.org</a>",
        "<a href='https://bugs.cacert.org/'>bugs.cacert.org</a>")?></p>
 
-<p><b><?=_("Snail Mail")?></b></p>
-<p><?=_("Alternatively you can get in contact with us via the following methods:")?></p>
 
-<p><?=_("Postal Address:")?><br>
-CAcert Inc.<br>
-P.O. Box 4107<br>
-Denistone East NSW 2112<br>
-Australia</p>
 
 <script type="text/javascript">
 <!--
index 688b9a4..0218fa0 100644 (file)
@@ -34,7 +34,7 @@
                if(mysql_num_rows($res) >= 1) { ?>
 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
   <tr>
-    <td colspan="5" class="title"><?=_("Select Specific Account Details")?></td>
+    <td colspan="5" class="title"><?=_("Select Specific User Account Details")?></td>
   </tr>
 <?
        while($row = mysql_fetch_assoc($res))
                        $row = mysql_fetch_assoc($res);
                        $_GET['userid'] = intval($row['id']);
                } else {
-                       printf(_("No personal domains found matching %s"), sanitizeHTML($domain));
+                       ?><table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+                               <tr>
+                               <td colspan="5" class="title"><?printf(_("No personal domains found matching %s"), sanitizeHTML($domain));?></td>
+                       </tr>
+               </table><br><br><?
                }
 
                $query = "select `orgid`,`domain`,`id` from `orgdomains` where `domain` like '$domainsearch' or `id`='$domain' limit 100";
@@ -66,7 +70,7 @@
                if(mysql_num_rows($res) >= 1) { ?>
 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
   <tr>
-    <td colspan="5" class="title"><?=_("Select Specific Account Details")?></td>
+    <td colspan="5" class="title"><?=_("Select Specific Organisation Account Details")?></td>
   </tr>
 <?
        while($row = mysql_fetch_assoc($res))
                        $row = mysql_fetch_assoc($res);
                        $_GET['userid'] = intval($row['id']);
                } else {
-                       printf(_("No organisational domains found matching %s"), sanitizeHTML($domain));
+                       ?><table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+                               <tr>
+                               <td colspan="5" class="title"><?printf(_("No organisational domains found matching %s"), sanitizeHTML($domain));?></td>
+                       </tr>
+               </table><br><br><?
                }
        }
 
index d1d3fef..81ab2b1 100644 (file)
 
 <ul>
 <li>Account Name: CAcert Inc</li>
+<li>SWIFT: WPACAU2S</li>
 <li>BSB: 032073</li>
 <li>Account No.: 180264</li>
 </ul>
 
 <?=_("If you want to participate in CAcert.org, have a look")?> <a href="http://wiki.cacert.org/wiki/HelpingCAcert"><?=_("here")?></a> <?=_("and")?> <a href="http://wiki.cacert.org/wiki/SystemTasks"><?=_("here")?></a>.
 
-<!--
-<h3><?=_("For CAcert Association Members")?></h3>
-
-<b><?=_("Have you paid your CAcert Association membership fees for the year?")?></b>
-<p><?=_("If not then select this PayPal button to pay your US$10 membership fee for the year.")?></p>
-<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_s-xclick">
-<input type="image" src="/images/payment2.png" border="0" name="submit" alt="Make payments with PayPal">
-<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
-">
-</form>
-<p><?=_("If you are located in Australia, you can use bank transfer instead and pay the equivalent of US$10 in AU$.")?></p>
-
-<p><?=_("Please also include Your name in the transaction so we know who it came from or send an email to robert at cacert dot org with the details:")?></p>
-
-<ul>
-<li>Account Name: CAcert Inc</li>
-<li>BSB: 032073</li>
-<li>Account No.: 180264</li>
-</ul>
-<br/><br/>
--->
-
-
-<!--
-<h3><?=_("Introduction")?></h3>
-
-<p><?=_("It's been a long time coming, but the wait was worthwhile, finally you are able to get security at the right price... Free!")?></p>
-
-<p><?=_("For years we've all been charged high amounts of money to pay for security that doesn't and shouldn't cost the earth.")?></p>
-
-<p><?=_("The primary goals are:")?>
-<ul>
-<li><?=_("Inclusion into mainstream browsers!")?></li>
-<li><?=_("To provide a trust mechanism to go with the security aspects of encryption.")?></li>
-</ul>
-
-<p><?=sprintf(_("For general documentation and help please see our %s site"), "<a href='http://wiki.CAcert.org'>"._("Wiki Documentation")."</a>")?>.</p>
--->
-
-
index 60c8941..01eca3a 100644 (file)
@@ -65,16 +65,7 @@ if(!array_key_exists('secrethash',$_SESSION['_config'])) $_SESSION['_config']['s
 </form>
 
 <p><b><?=_("Security Issues")?></b></p>
-<p><?=_("Please use any of the following ways to report security issues: You can use the above contact form for sensitive information. You can email us to support@cacert.org. You can file a bugreport on <a href='https://bugs.cacert.org/'>bugs.cacert.org</a> and mark it as private.")?></p>
-
-<p><b><?=_("Snail Mail")?></b></p>
-<p><?=_("Alternatively you can get in contact with us via the following methods:")?></p>
-
-<p><?=_("Postal Address:")?><br>
-CAcert Inc.<br>
-P.O. Box 4107<br>
-Denistone East NSW 2112<br>
-Australia</p>
+<p><?=sprintf(_("Please use any of the following ways to report security issues: You can use the above contact form for sensitive information. You can email us to support@cacert.org. You can file a bugreport on %s and mark it as private."),"<a href='https://bugs.cacert.org/'>bugs.cacert.org</a>")?></p>
 
 <script type="text/javascript">
 <!--
index f2ea173..612422f 100644 (file)
@@ -35,8 +35,9 @@ printf(_("CAcert Inc. is a non-profit association which is legally able to accep
 
 <pre>
 Account Name: CAcert Inc
-BSB: 032073
-Account No.: 180264
+SWIFT:        WPACAU2S
+BSB:          032073
+Account No.:  180264
 </pre>
 
 <p><?=_("ANY amount will be appreciated - the more funding CAcert receives, the sooner it can achieve the goals of the community.")?></p>
index 4d2599c..0521f67 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */ ?>
-
+<? /*
+page called from the following pages 
+ a. https://wiki.cacert.org/Price [^]
+ b. https://wiki.cacert.org/CacertMembership/DE [^]
+ c. https://wiki.cacert.org/CacertMembership [^]
+ d. https://wiki.cacert.org/CAcertInc [^]
+ e. https://wiki.cacert.org/Brain/CAcertInc [^] 
+ */ ?>
 <h3><?=_("For CAcert Association Members")?></h3>
 
 <b><?=_("Have you paid your CAcert Association membership fees for the year?")?></b>
@@ -40,6 +47,7 @@
 
 <ul>
 <li>Account Name: CAcert Inc</li>
+<li>SWIFT: WPACAU2S</li>
 <li>BSB: 032073</li>
 <li>Account No.: 180264</li>
 </ul>
index 0da72da..04997ba 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */ ?>
-<span style="background-color: #FF8080; font-size: 150%">
-Note that the <strong>TTP</strong> programme is effectively <strong>Frozen</strong><br>
-Until a subsidiary policy under AP is written, it is against AP rules.<br>
-</span>
-&nbsp;<br>
+
 <h3><?=_("Trusted Third Parties")?></h3>
 
-<p><?=_("A trusted 3rd party is simply someone in your country that is responsible for witnessing signatures and ID documents. This role is covered by many different titles such as public notary, justice of the peace and so on. Other people are allowed to be authoritative in this area as well, such as bank managers, accountants and lawyers.")?></p>
+<p><?=_("The Trusted Third Party (TTP) programme is intended to be used in areas without many CAcert Assurers.")?></p>
+
+<p><?=_("A Trusted Third Party (TTP) is simply someone in your country that is responsible for witnessing signatures and ID documents. This role is covered by many different titles such as public notary, justice of the peace and so on.")?></p>
+
+<p><?=_("With the TTP programme you can potentially gain assurance up to a maximum of 100 assurance points.")?></p>
+
+<p><?=_("Currently CAcert has only developed the TTP programme to the level that you can gain 70 assurance points by TTP assurances.") ?></p>
+
+<p><?=_("We are working to develop a process that will fill the gap of the missing 30 assurance points to allow you to get the maximum 100 assurance points.")?> </p>
+
+<p><?=_("In the meanwhile you would need to close this gap with face to face assurances with CAcert Assurers. Think not only travelling to populated countries, but also remember that assurers may occasionally visit your country or area.")?></p>
 
-<p><?=_("You can become a CAcert Assurer by seeking out trusted 3rd parties. You will also need to download and print out a copy of the TTP Form (found under 'CAP/TTP Forms') and fill in your sections. You will need to produce a photo copy of your ID, which the person assuring you will inspect against the originals. Once they are satisfied the documents appear to be genuine they need to sign the back of the photo copies, and fill in their sections of the TTP document. Once you have had your ID verified by 2 different people, pop the copies + forms in an envelope and post them to:")?></p>
+<p><?=sprintf(_("If you are interested in the TTP programme, read the pages %s for the basic way how the TTP programme works for you, and %s whether the TTP programme affects the country where you are located."),"<a href='//wiki.cacert.org/TTP/TTPuser'>https://wiki.cacert.org/TTP/TTPuser</a>","<a href='//wiki.cacert.org/TTP/TTPAL'>https://wiki.cacert.org/TTP/TTPAL</a>")?> </p>
 
-<p>CAcert Inc.<br>
-P.O. Box 4107<br>
-Denistone East NSW 2112<br>
-Australia</p>
+<p><?=sprintf(_("If you want to take part in the TTP programme, send an email to %s with your name, the main email address of your CAcert account and the country that you want to see the TTP. CAcert will then send you the needed forms and guide you through the process."),"<a href='mailto:support@cacert.org'>support@cacert.org</a>")?></p>
index a4ec71e..7efdf8d 100644 (file)
@@ -15,6 +15,9 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
+
+require_once '../../includes/lib/check_weak_key.php';
+
        $username = mysql_real_escape_string($_REQUEST['username']);
        $password = mysql_real_escape_string($_REQUEST['password']);
 
index 73380e1..dc283fb 100644 (file)
@@ -48,7 +48,7 @@
                        $this->SetFont('Arial','I',8);
                        if($_SESSION['_config']['language'] == "ja")
                                $this->SetFont('SJIS','I',8);
-                       $this->Cell(0,0,'CAcert Inc. - P.O. Box 4107 - Denistone East NSW 2112 - Australia - http://www.CAcert.org',0,0,'C');
+                       $this->Cell(0,0,'CAcert Inc. - PO Box 66 - Oatley NSW 2223 -  Australia - http://www.CAcert.org',0,0,'C');
                        $this->Ln(3);
                        $this->SetFont('Arial','',6);
                        if($_SESSION['_config']['language'] == "ja")
index 6670e92..8aa0837 100644 (file)
@@ -105,8 +105,8 @@ Governmental warrants and civil supoenas will be processed through the dispute r
 <p>If you need to contact us in writing, address your mail to:</p>
 <p>
 CAcert Inc.<br>
-P.O. Box 4107<br>
-Denistone East NSW 2112<br>
+PO Box 66 <br>
+Oatley NSW 2223<br>
 Australia
 </p>
 
index 2878534..c6c0568 100644 (file)
@@ -333,12 +333,16 @@ $iecho= "c";
 
                if(($drow['total'] + $newpoints) >= 100 && $newpoints > 0)
                {
-//                     $body .= _("You now have over 100 points and can start assuring others.")."\n\n";
-                       $body .= _("You have at least 100 Assurance Points, if you want to become an assurer try the")." ";
-                       $body .= _("Assurer Challenge")." ( https://cats.cacert.org )\n\n";
-                       $body .= _("To make it easier for others in your area to find you, it's helpful to list yourself as an assurer (this is voluntary), as well as a physical location where you live or work the most. You can flag your account to be listed, and add a comment to the display by going to:")."\n\n";
+                       $body .= _("You have at least 100 Assurance Points. If you want ".
+                                       "to become an assurer try the Assurer Challenge").
+                                       " ( https://cats.cacert.org ).\n\n";
+                       $body .= _("To make it easier for others in your area to find ".
+                                       "you, it's helpful to list yourself as an assurer (this ".
+                                       "is voluntary), as well as a physical location where you ".
+                                       "live or work the most. You can flag your account to be ".
+                                       "listed, and add a comment to the display by going to:")."\n";
                        $body .= "https://www.cacert.org/wot.php?id=8\n\n";
-                       $body .= _("You can list your location by going to:")."\n\n";
+                       $body .= _("You can list your location by going to:")."\n";
                        $body .= "https://www.cacert.org/wot.php?id=13\n\n";
                }