Commit 3f062818 authored by alexander's avatar alexander

Fix SPARK-1803

parent 091eacf1
...@@ -41,7 +41,7 @@ public class ScramUtils { ...@@ -41,7 +41,7 @@ public class ScramUtils {
private ScramUtils() {} private ScramUtils() {}
public static byte[] createSaltedPassword(byte[] salt, String password, int iters) throws SaslException { public static byte[] createSaltedPassword(byte[] salt, String password, int iters) throws SaslException {
Mac mac = createSha1Hmac(password.getBytes(StandardCharsets.US_ASCII)); Mac mac = createSha1Hmac(password.getBytes(StandardCharsets.UTF_8));
mac.update(salt); mac.update(salt);
mac.update(new byte[]{0, 0, 0, 1}); mac.update(new byte[]{0, 0, 0, 1});
byte[] result = mac.doFinal(); byte[] result = mac.doFinal();
...@@ -61,7 +61,7 @@ public class ScramUtils { ...@@ -61,7 +61,7 @@ public class ScramUtils {
public static byte[] computeHmac(final byte[] key, final String string) public static byte[] computeHmac(final byte[] key, final String string)
throws SaslException { throws SaslException {
Mac mac = createSha1Hmac(key); Mac mac = createSha1Hmac(key);
mac.update(string.getBytes(StandardCharsets.US_ASCII)); mac.update(string.getBytes(StandardCharsets.UTF_8));
return mac.doFinal(); return mac.doFinal();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment