Skip to content

Commit b418e3c

Browse files
authored
HIVE-28030: LLAP util code refactor (Denys Kuzmenko, reviewed by Ayush Saxena)
Closes #5030
1 parent 564d7e5 commit b418e3c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapSignerImpl.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.hadoop.hive.llap.security;
1919

2020
import java.io.IOException;
21-
import java.util.Arrays;
21+
import java.security.MessageDigest;
2222

2323
import org.apache.hadoop.conf.Configuration;
2424
import org.apache.hadoop.security.UserGroupInformation;
@@ -58,7 +58,9 @@ public SignedMessage serializeAndSign(Signable message) throws IOException {
5858
public void checkSignature(byte[] message, byte[] signature, int keyId)
5959
throws SecurityException {
6060
byte[] expectedSignature = secretManager.signWithKey(message, keyId);
61-
if (Arrays.equals(signature, expectedSignature)) return;
61+
if (MessageDigest.isEqual(signature, expectedSignature)) {
62+
return;
63+
}
6264
throw new SecurityException("Message signature does not match");
6365
}
6466

0 commit comments

Comments
 (0)