Skip to content

Commit

Permalink
Use MessageDigest.isEqual() instead of Array.equals()
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security authored and nbaars committed Aug 6, 2021
1 parent 8038a1d commit 0930414
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static String decrypt(SecretKey key, String token, String footer) {

//1
if (!isNullOrEmpty(footer)) {
verify(Arrays.equals(getUrlDecoder().decode(tokenParts[3]), footer.getBytes(UTF_8)), "footer does not match");
verify(MessageDigest.isEqual(getUrlDecoder().decode(tokenParts[3]), footer.getBytes(UTF_8)), "footer does not match");
}

//2
Expand Down

0 comments on commit 0930414

Please sign in to comment.