mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-05 18:22:26 +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 {
|
public class BCryptPasswordEncoderTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
// gh-5548
|
||||||
|
public void emptyRawPasswordDoesNotMatchPassword() {
|
||||||
|
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
|
||||||
|
String result = encoder.encode("password");
|
||||||
|
assertThat(encoder.matches("", result)).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void $2yMatches() {
|
public void $2yMatches() {
|
||||||
// $2y is default version
|
// $2y is default version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user