mraible opened a new pull request, #301:
URL: https://github.com/apache/roller/pull/301
`passwds.encryption.lazyUpgradeFrom` (`SHA` by default) lets passwords from
older Roller versions verify, but nothing stored them again, so they stayed in
the old encoding however often their owners logged in. On a 7.0.0 RC1 site with
`algorithm=bcrypt` and `lazyUpgradeFrom=SHA`, all nine accounts still had their
40-character unsalted SHA-1 hashes after repeated successful logins.
Spring Security re-encodes a password after a successful login only when the
login provider has a `UserDetailsPasswordService`, and Roller's didn't.
- `RollerUserDetailsService` now implements `UserDetailsPasswordService` and
saves the re-encoded password. `RollerContext` gives it to the database login
provider, next to the password encoder.
- Nothing is stored while `passwds.encryption.enabled` is off. In that mode
the encoder's "upgrade" would be to plain text, which would turn bcrypt hashes
into stored passwords.
- The password encoder factory moves unchanged from `RollerContext` to
`RollerPasswordEncoders`, so the test can use the same encoder. #300 makes the
same move.
- New `PasswordUpgradeTest` logs in through Spring's
`DaoAuthenticationProvider` against the test database, with a user whose
password is an unprefixed SHA-1 hash:
- a successful login stores a `{bcrypt}` hash, the next login still works,
and an up-to-date hash isn't rewritten;
- a failed login leaves the stored hash alone;
- with encryption off, nothing is stored.
The first test fails without the change.
- `mvn install` passes on JDK 21 (734 tests, 1 skipped).
- CHANGES has a bug-fix entry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]