Skip to content

Commit

Permalink
Support bcrypt minor b
Browse files Browse the repository at this point in the history
  • Loading branch information
yurem committed Jun 13, 2024
1 parent 7477557 commit 606c6d6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ public static String hashpw(String password, String salt) {
}
else {
minor = salt.charAt(2);
if (minor != 'a' || salt.charAt(3) != '$') {
if (!((minor == 'a') || (minor == 'b')) || salt.charAt(3) != '$') {
throw new IllegalArgumentException("Invalid salt revision");
}
off = 4;
Expand Down Expand Up @@ -745,7 +745,7 @@ public static String hashpw(byte[] password, String salt) {
}
else {
minor = salt.charAt(2);
if (minor != 'a' || salt.charAt(3) != '$') {
if (!((minor == 'a') || (minor == 'b')) || salt.charAt(3) != '$') {
throw new IllegalArgumentException("Invalid salt revision");
}
off = 4;
Expand Down

0 comments on commit 606c6d6

Please sign in to comment.