This is an automated email from the ASF dual-hosted git repository.

dkuzmenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new b418e3c9f47 HIVE-28030: LLAP util code refactor (Denys Kuzmenko, 
reviewed by Ayush Saxena)
b418e3c9f47 is described below

commit b418e3c9f479ba8e7d31e6470306111002ffa809
Author: Denys Kuzmenko <[email protected]>
AuthorDate: Thu Jan 25 12:18:19 2024 +0200

    HIVE-28030: LLAP util code refactor (Denys Kuzmenko, reviewed by Ayush 
Saxena)
    
    Closes #5030
---
 .../java/org/apache/hadoop/hive/llap/security/LlapSignerImpl.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapSignerImpl.java 
b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapSignerImpl.java
index a7fc398892f..047e17686b7 100644
--- 
a/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapSignerImpl.java
+++ 
b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapSignerImpl.java
@@ -18,7 +18,7 @@
 package org.apache.hadoop.hive.llap.security;
 
 import java.io.IOException;
-import java.util.Arrays;
+import java.security.MessageDigest;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.security.UserGroupInformation;
@@ -58,7 +58,9 @@ public class LlapSignerImpl implements LlapSigner {
   public void checkSignature(byte[] message, byte[] signature, int keyId)
       throws SecurityException {
     byte[] expectedSignature = secretManager.signWithKey(message, keyId);
-    if (Arrays.equals(signature, expectedSignature)) return;
+    if (MessageDigest.isEqual(signature, expectedSignature)) {
+      return;
+    }
     throw new SecurityException("Message signature does not match");
   }
 

Reply via email to