Server doesn't known clear master key anymore
This commit is contained in:
@@ -29,6 +29,11 @@
|
||||
$MAX_ENTRY_LEN = 512;
|
||||
$USERS_PATH = "./users/";
|
||||
|
||||
function get_mkey_hash($mkey)
|
||||
{
|
||||
return bin2hex(hash("sha256", $mkey, true));
|
||||
}
|
||||
|
||||
function open_crypto($mkey)
|
||||
{
|
||||
if (!isset($_SESSION['td']))
|
||||
@@ -38,7 +43,7 @@ function open_crypto($mkey)
|
||||
if ($td == false)
|
||||
die("Unable to open mcrypt");
|
||||
|
||||
$ret = mcrypt_generic_init($td, hash("sha256", $mkey, true), '0000000000000000');
|
||||
$ret = mcrypt_generic_init($td, hex2bin($mkey), '0000000000000000');
|
||||
|
||||
if ($ret < 0)
|
||||
{
|
||||
@@ -225,7 +230,8 @@ function list_entries($user, $mkey)
|
||||
{
|
||||
$total_accounts++;
|
||||
|
||||
$login = decrypt($mkey, $row['login'], false);
|
||||
if ($mkey != "")
|
||||
$login = decrypt($mkey, $row['login'], false);
|
||||
|
||||
if ($login[0] != '@' && $login[1] != '@')
|
||||
{
|
||||
|
Reference in New Issue
Block a user