diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 3e6ef6af..f13e327e 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -186,15 +186,15 @@ function pwd_hash($password, $enabled = true, $hashType = 'SSHA') { $hash = "{CRYPT}" . crypt($password); break; case 'MD5': - $hash = "{MD5}" . base64_encode(hex2bin(md5($password))); + $hash = "{MD5}" . base64_encode(convertHex2bin(md5($password))); break; case 'SMD5': $salt0 = substr(pack("h*", md5($rand)), 0, 8); $salt = substr(pack("H*", md5($salt0 . $password)), 0, 4); - $hash = "{SMD5}" . base64_encode(hex2bin(md5($password . $salt)) . $salt); + $hash = "{SMD5}" . base64_encode(convertHex2bin(md5($password . $salt)) . $salt); break; case 'SHA': - $hash = "{SHA}" . base64_encode(hex2bin(sha1($password))); + $hash = "{SHA}" . base64_encode(convertHex2bin(sha1($password))); break; case 'PLAIN': $hash = $password; @@ -203,7 +203,7 @@ function pwd_hash($password, $enabled = true, $hashType = 'SSHA') { default: // use SSHA if the setting is invalid $salt0 = substr(pack("h*", md5($rand)), 0, 8); $salt = substr(pack("H*", sha1($salt0 . $password)), 0, 4); - $hash = "{SSHA}" . base64_encode(hex2bin(sha1($password . $salt)) . $salt); + $hash = "{SSHA}" . base64_encode(convertHex2bin(sha1($password . $salt)) . $salt); break; } // enable/disable password diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 5c3a5875..63198962 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2003 - 2011 Roland Gruber + Copyright (C) 2003 - 2012 Roland Gruber 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 @@ -624,7 +624,7 @@ class LAMConfig { * @return String hash value */ private function hashPassword($password, $salt) { - return "{SSHA}" . base64_encode(hex2bin(sha1($password . $salt))) . " " . base64_encode($salt); + return "{SSHA}" . base64_encode(convertHex2bin(sha1($password . $salt))) . " " . base64_encode($salt); } /** @@ -1399,7 +1399,7 @@ class LAMCfgMain { * @return String hash value */ private function hashPassword($password, $salt) { - return "{SSHA}" . base64_encode(hex2bin(sha1($password . $salt))) . " " . base64_encode($salt); + return "{SSHA}" . base64_encode(convertHex2bin(sha1($password . $salt))) . " " . base64_encode($salt); } /** diff --git a/lam/lib/ldap.inc b/lam/lib/ldap.inc index beb22f17..7aade12b 100644 --- a/lam/lib/ldap.inc +++ b/lam/lib/ldap.inc @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2003 - 2011 Roland Gruber + Copyright (C) 2003 - 2012 Roland Gruber 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 @@ -37,7 +37,7 @@ include_once("config.inc"); * @param string $value HEX string * @return binary result binary */ -function hex2bin($value) { +function convertHex2bin($value) { return pack("H*", $value); }