Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions service/src/java/org/apache/hive/service/CookieSigner.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ public String verifyAndExtract(String signedStr) {
String rawValue = signedStr.substring(0, index);
String currentSignature = getSignature(rawValue);

LOG.debug("Signature generated for {} inside verify is {}", rawValue, currentSignature);
if (!MessageDigest.isEqual(originalSignature.getBytes(), currentSignature.getBytes())) {
throw new IllegalArgumentException("Invalid sign, original = " + originalSignature +
" current = " + currentSignature);
throw new IllegalArgumentException("Invalid sign= " + originalSignature);
}
return rawValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void testVerifyAndExtractInvalidSignature() {
try {
cs.verifyAndExtract(modifedSignedStr);
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage().startsWith("Invalid sign, original = "));
assertTrue(e.getMessage().startsWith("Invalid sign= "));
return;
}
fail("Expected IllegalArgumentException checking signature");
Expand Down