File tree 1 file changed +4
-2
lines changed
llap-common/src/java/org/apache/hadoop/hive/llap/security
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 18
18
package org .apache .hadoop .hive .llap .security ;
19
19
20
20
import java .io .IOException ;
21
- import java .util . Arrays ;
21
+ import java .security . MessageDigest ;
22
22
23
23
import org .apache .hadoop .conf .Configuration ;
24
24
import org .apache .hadoop .security .UserGroupInformation ;
@@ -58,7 +58,9 @@ public SignedMessage serializeAndSign(Signable message) throws IOException {
58
58
public void checkSignature (byte [] message , byte [] signature , int keyId )
59
59
throws SecurityException {
60
60
byte [] expectedSignature = secretManager .signWithKey (message , keyId );
61
- if (Arrays .equals (signature , expectedSignature )) return ;
61
+ if (MessageDigest .isEqual (signature , expectedSignature )) {
62
+ return ;
63
+ }
62
64
throw new SecurityException ("Message signature does not match" );
63
65
}
64
66
You can’t perform that action at this time.
0 commit comments