Skip to content

Commit 5dc3d55

Browse files
committed
Changed the characters that are available to be used in the password salt to avoid decoding problems with certain 64Bit Linux systems.
1 parent 8a072e7 commit 5dc3d55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

interface/lib/classes/tform.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,10 @@ function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_whe
816816
$sql_insert_key .= "`$key`, ";
817817
if($field['encryption'] == 'CRYPT') {
818818
$salt="$1$";
819+
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
819820
for ($n=0;$n<8;$n++) {
820-
$salt.=chr(mt_rand(64,126));
821+
//$salt.=chr(mt_rand(64,126));
822+
$salt.=$base64_alphabet[mt_rand(0,63)];
821823
}
822824
$salt.="$";
823825
// $salt = substr(md5(time()),0,2);
@@ -849,8 +851,10 @@ function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_whe
849851
if($field['formtype'] == 'PASSWORD') {
850852
if(isset($field['encryption']) && $field['encryption'] == 'CRYPT') {
851853
$salt="$1$";
854+
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
852855
for ($n=0;$n<8;$n++) {
853-
$salt.=chr(mt_rand(64,126));
856+
//$salt.=chr(mt_rand(64,126));
857+
$salt.=$base64_alphabet[mt_rand(0,63)];
854858
}
855859
$salt.="$";
856860
// $salt = substr(md5(time()),0,2);

0 commit comments

Comments
 (0)