From 311470d695a159c1fd1f1dfc936ed10c7551677b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 13 Feb 2014 23:29:52 +0100 Subject: [PATCH] Add xf12 to PasswordUtil --- .../files/lib/util/PasswordUtil.class.php | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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) * -- 2.20.1