mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-01 10:59:16 +00:00
Add BCrypt Test for Empty Raw Password
Issue: gh-5548
This commit is contained in:
parent
c94f13a971
commit
ae0f330f98
@ -27,6 +27,14 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class BCryptPasswordEncoderTests {
|
||||
|
||||
@Test
|
||||
// gh-5548
|
||||
public void emptyRawPasswordDoesNotMatchPassword() {
|
||||
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
|
||||
String result = encoder.encode("password");
|
||||
assertThat(encoder.matches("", result)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void $2yMatches() {
|
||||
// $2y is default version
|
||||
|
Loading…
x
Reference in New Issue
Block a user