Skip to content

Commit 37d856d

Browse files
committed
Correct input validation for 31 rounds
Closes gh-11470
1 parent c57853e commit 37d856d

File tree

1 file changed

+1
-1
lines changed
  • crypto/src/main/java/org/springframework/security/crypto/bcrypt

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ private byte[] crypt_raw(byte password[], byte salt[], int log_rounds, boolean s
543543
}
544544
else {
545545
rounds = roundsForLogRounds(log_rounds);
546-
if (rounds < 16 || rounds > Integer.MAX_VALUE) {
546+
if (rounds < 16 || rounds > 2147483648L) {
547547
throw new IllegalArgumentException("Bad number of rounds");
548548
}
549549
}

0 commit comments

Comments
 (0)