Browse Source

Correct input validation for 31 rounds

Closes gh-11470
pull/11649/head
Josh Cummings 3 years ago
parent
commit
37d856dca4
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
  1. 2
      crypto/src/main/java/org/springframework/security/crypto/bcrypt/BCrypt.java

2
crypto/src/main/java/org/springframework/security/crypto/bcrypt/BCrypt.java

@ -543,7 +543,7 @@ public class BCrypt { @@ -543,7 +543,7 @@ public class BCrypt {
}
else {
rounds = roundsForLogRounds(log_rounds);
if (rounds < 16 || rounds > Integer.MAX_VALUE) {
if (rounds < 16 || rounds > 2147483648L) {
throw new IllegalArgumentException("Bad number of rounds");
}
}

Loading…
Cancel
Save