Skip to content

Commit 85593d4

Browse files
committed
Use constant time equals for HashData
1 parent 8268efc commit 85593d4

File tree

1 file changed

+2
-2
lines changed
  • modules/bcrypt/src/main/java/at/favre/lib/crypto/bcrypt

1 file changed

+2
-2
lines changed

modules/bcrypt/src/main/java/at/favre/lib/crypto/bcrypt/BCrypt.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ public boolean equals(Object o) {
344344
HashData hashData = (HashData) o;
345345
return cost == hashData.cost &&
346346
version == hashData.version &&
347-
Arrays.equals(rawSalt, hashData.rawSalt) &&
348-
Arrays.equals(rawHash, hashData.rawHash);
347+
Bytes.wrap(rawSalt).equalsConstantTime(hashData.rawSalt) &&
348+
Bytes.wrap(rawHash).equalsConstantTime(hashData.rawHash);
349349
}
350350

351351
@Override

0 commit comments

Comments
 (0)