From: Tim Düsterhus Date: Thu, 13 Feb 2014 22:29:52 +0000 (+0100) Subject: Add xf12 to PasswordUtil X-Git-Tag: 2.0.3~41 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=311470d695a159c1fd1f1dfc936ed10c7551677b;p=GitHub%2FWoltLab%2FWCF.git Add xf12 to PasswordUtil --- diff --git a/wcfsetup/install/files/lib/util/PasswordUtil.class.php b/wcfsetup/install/files/lib/util/PasswordUtil.class.php index 26fef06477..261360ead9 100644 --- a/wcfsetup/install/files/lib/util/PasswordUtil.class.php +++ b/wcfsetup/install/files/lib/util/PasswordUtil.class.php @@ -37,7 +37,8 @@ final class PasswordUtil { 'wbb2', // WoltLab Burning Board 2.x 'wcf1', // WoltLab Community Framework 1.x 'wcf2', // WoltLab Community Framework 2.x - 'xf1', // XenForo 1.x + 'xf1', // XenForo 1.0 / 1.1 + 'xf12', // XenForo 1.2+ 'joomla1', // Joomla 1.x 'joomla2', // Joomla 2.x 'joomla3', // Joomla 3.x @@ -590,7 +591,7 @@ final class PasswordUtil { } /** - * Validates the password hash for XenForo 1.x with (xf1). + * Validates the password hash for XenForo 1.0 / 1.1 (xf1). * * @param string $username * @param string $password @@ -609,6 +610,23 @@ final class PasswordUtil { return false; } + /** + * Validates the password hash for XenForo 1.2+ (xf12). + * + * @param string $username + * @param string $password + * @param string $salt + * @param string $dbHash + * @return boolean + */ + protected static function xf12($username, $password, $salt, $dbHash) { + if (self::secureCompare($dbHash, self::getSaltedHash($password, $dbHash))) { + return true; + } + + return false; + } + /** * Validates the password hash for Joomla 1.x (kunea) *