Awaiting feedback Login `hash_equals()` error

Tom

Active member
Affected version
2.0.1
Got this error showing up in the server error logs.
ErrorException: [E_WARNING] hash_equals(): Expected known_string to be a string, null given src/XF/Util/Php.php:238

Stack Trace:
Code:
#0 [internal function]: XF::handlePhpError(2, 'hash_equals(): ...', '/home/afellows/...', 238, Array)
#1 src/XF/Util/Php.php(238): hash_equals(NULL, '$1$wjoCZF1e$WkG...')
#2 src/XF/Authentication/PasswordHash.php(232): XF\Util\Php::hashEquals(NULL, '$1$wjoCZF1e$WkG...')
#3 src/XF/Authentication/IPBoard40x.php(20): XF\Authentication\PasswordHash->CheckPassword('password', NULL)
#4 src/XF/Entity/UserAuth.php(27): XF\Authentication\IPBoard40x->authenticate(115, 'password')
#5 src/XF/Service/User/Login.php(122): XF\Entity\UserAuth->authenticate('password')
#6 src/XF/Pub/Controller/Login.php(69): XF\Service\User\Login->validate('password', NULL)
#7 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Login->actionLogin(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Login', 'login', 'html', Object(XF\Mvc\ParameterBag), '', Object(XF\Pub\Controller\Login), NULL)
#9 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#11 src/XF.php(328): XF\App->run()
#12 index.php(13): XF::runApp('XF\\Pub\\App')
#13 {main}
 
Last edited:
This seems to be related to not having a hash for a user that was imported from IPB 4 (in XF1). Are you still getting this error? Does it appear to be happening for multiple users?

If so, we might need you to submit a ticket as we'll need to see exactly what is in the DB for one of these users. The code here is generally the same as it was in XF1 so I don't see why this would be failing.
 
Looks like we've only got the error once with that one particular user, so may have just been an error encountered when we migrated data from IPB 4 for that one user. Would it be easier for me to just force a password reset for the user in question?
 
That would solve the issue, though I'm sort of curious how it happened. The user presumably never logged in to XF before this point, so it's very possible it was some corruption that predates XF2.
 
If you haven't done the password reset, please. I'd need something like phpMyAdmin access to be able to pull the raw value out of the database. I'd also need to know the name/ID of the user with the problem to know where I'm looking.
 
Back
Top Bottom