Skip to content

Commit

Permalink
Merge pull request #2229 from luisa-ball/ELY-2814
Browse files Browse the repository at this point in the history
[ELY-2814] Update UnixSHACryptPasswordImpl to make use of MessageDigest.isEqual to avoid a potential timing attack
  • Loading branch information
fjuma authored Oct 5, 2024
2 parents 642b43f + 837fb1a commit 1887489
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 1887489

Please sign in to comment.