Commit 5dc3d55f authored by tbrehm's avatar tbrehm
Browse files

Changed the characters that are available to be used in the password salt to...

Changed the characters that are available to be used in the password salt to avoid decoding problems with certain 64Bit Linux systems.
parent 8a072e70
...@@ -816,8 +816,10 @@ class tform { ...@@ -816,8 +816,10 @@ class tform {
$sql_insert_key .= "`$key`, "; $sql_insert_key .= "`$key`, ";
if($field['encryption'] == 'CRYPT') { if($field['encryption'] == 'CRYPT') {
$salt="$1$"; $salt="$1$";
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for ($n=0;$n<8;$n++) { for ($n=0;$n<8;$n++) {
$salt.=chr(mt_rand(64,126)); //$salt.=chr(mt_rand(64,126));
$salt.=$base64_alphabet[mt_rand(0,63)];
} }
$salt.="$"; $salt.="$";
// $salt = substr(md5(time()),0,2); // $salt = substr(md5(time()),0,2);
...@@ -849,8 +851,10 @@ class tform { ...@@ -849,8 +851,10 @@ class tform {
if($field['formtype'] == 'PASSWORD') { if($field['formtype'] == 'PASSWORD') {
if(isset($field['encryption']) && $field['encryption'] == 'CRYPT') { if(isset($field['encryption']) && $field['encryption'] == 'CRYPT') {
$salt="$1$"; $salt="$1$";
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for ($n=0;$n<8;$n++) { for ($n=0;$n<8;$n++) {
$salt.=chr(mt_rand(64,126)); //$salt.=chr(mt_rand(64,126));
$salt.=$base64_alphabet[mt_rand(0,63)];
} }
$salt.="$"; $salt.="$";
// $salt = substr(md5(time()),0,2); // $salt = substr(md5(time()),0,2);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment