Skip to content

Commit

Permalink
[ELY-2814] Update UnixSHACryptPasswordImpl to make use of MessageDige…
Browse files Browse the repository at this point in the history
…st#isEqual to avoid a potential timing attack

https://issues.redhat.com/browse/ELY-2814
  • Loading branch information
luisa-ball authored Oct 4, 2024
1 parent bb6f7eb commit 837fb1a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public boolean equals(final Object obj) {
return false;
}
UnixSHACryptPasswordImpl other = (UnixSHACryptPasswordImpl) obj;
return iterationCount == other.iterationCount && algorithm.equals(other.algorithm) && Arrays.equals(hash, other.hash) && Arrays.equals(salt, other.salt);
return iterationCount == other.iterationCount && algorithm.equals(other.algorithm) && MessageDigest.isEqual(hash, other.hash) && MessageDigest.isEqual(salt, other.salt);
}

private void readObject(ObjectInputStream ignored) throws NotSerializableException {
Expand Down

0 comments on commit 837fb1a

Please sign in to comment.