Add BCrypt Test for Empty Raw Password

Issue: gh-5548
This commit is contained in:
Rob Winch 2019-01-08 11:54:01 -06:00
parent c94f13a971
commit ae0f330f98
1 changed files with 8 additions and 0 deletions

View File

@ -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