From 7638cb1a3b07713cc490aa2909a37037f89e08b4 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Thu, 23 Nov 2023 11:50:50 +0530 Subject: [PATCH] Refactor Some Code. (#4887). (Ayush Saxena, reviewed by Denys Kuzmenko) --- service/src/java/org/apache/hive/service/CookieSigner.java | 4 +--- .../src/test/org/apache/hive/service/TestCookieSigner.java | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/service/src/java/org/apache/hive/service/CookieSigner.java b/service/src/java/org/apache/hive/service/CookieSigner.java index 49ef2c606a7c..867adc8fa267 100644 --- a/service/src/java/org/apache/hive/service/CookieSigner.java +++ b/service/src/java/org/apache/hive/service/CookieSigner.java @@ -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; } diff --git a/service/src/test/org/apache/hive/service/TestCookieSigner.java b/service/src/test/org/apache/hive/service/TestCookieSigner.java index 54801d444003..a5a6454194de 100644 --- a/service/src/test/org/apache/hive/service/TestCookieSigner.java +++ b/service/src/test/org/apache/hive/service/TestCookieSigner.java @@ -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");