benedmunds/CodeIgniter-Ion-Auth — pull request #216 by michaelbrooks (2012-05-03 21:04:04+00:00)
Title: Added unneeded hashing operation on failed login

Currently, if a user submits an identity and password to the login form, and the identity is not in the database, the form returns an error immediately. If the identity is in the database, the supplied password is checked against the stored hash, which takes a fraction of a second longer.

However, the difference is noticeable (about 100ms on my machine, using bcrypt with 10 rounds), which means that it would be possible for someone to determine if an account exists by the amount of time it takes for the login form to be processed.

I added a call to hash_password to the login() method to make the processing time when the user doesn't exist more equitable.