(bug 35961) Hash comparison should always be strict.
authorPlatonides <platonides@gmail.com>
Fri, 13 Apr 2012 20:37:33 +0000 (22:37 +0200)
committerPlatonides <platonides@gmail.com>
Thu, 19 Apr 2012 16:25:45 +0000 (18:25 +0200)
commitbc7840f7d47ccd69bb2dae7030acc85eada4b312
tree766ce431ca93dba8a82403ab14fc68f42fcba1b7
parent60b07ca1b4811d5025b340bed927ab8a4a32d9f7
(bug 35961) Hash comparison should always be strict.

If your salted password end up being completely numeric when
represented in hexadecimal (less than 1 password per 10 millions),
it is also possible to login by providing another password that only
matches the first 9 bytes (instead of the full 16 ones) if it turns out
to also be completely numeric with your assigned salt (which is completely unknown).
The odds of finding an equivalent password with such characteristics, over a double md5
with an unknown salt, are really low. Even if the attacker broke into the servers and
robbed the salts, making use of this property would require a preimage attack of a partial
md5 (2^18) with the output of another md5 hash, for which a full preimage would still be
needed. Breaking the hashes using conventional attacks would be easier, so this is not
a critical update.

Change-Id: I8d1153fb91ca6507bd1df91e9953561f74f12ef6
includes/User.php