summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-09-23 12:53:44 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-09-23 12:53:44 +1000
commit9cf6814776a989cca12cf1249460268b50ae25b2 (patch)
treec268f1cff354abe711f5118225010b0efd300c63
parent699279d84aab16594505aa394fc4c9ed22cbba11 (diff)
Fix secure tripcode hardening
-rw-r--r--inc/functions.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/inc/functions.php b/inc/functions.php
index 02665952..3448e7db 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1973,14 +1973,13 @@ function generate_tripcode($name) {
if (isset($config['custom_tripcode']["##{$trip}"]))
$trip = $config['custom_tripcode']["##{$trip}"];
else
- $trip = '!!' . substr(crypt($trip, $salt . $config['secure_trip_salt']), -10);
+ $trip = '!!' . substr(crypt($trip, substr(base64_encode(sha1($trip . $config['secure_trip_salt'], true)), 0, 9)), -10);
} else {
if (isset($config['custom_tripcode']["#{$trip}"]))
$trip = $config['custom_tripcode']["#{$trip}"];
else
$trip = '!' . substr(crypt($trip, $salt), -10);
}
-
return array($name, $trip);
}