From 814e5574dcabbbf52b878d9fd448be7a66118597 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Sat, 28 Feb 2015 00:42:27 +0530 Subject: [PATCH] pbkdf2: fix encoding issue when converting byte[] to String Signed-off-by: Rohit Yadav --- .../cloudstack/server/auth/PBKDF2UserAuthenticator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java b/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java index 43c32c7ae5f..58f5ea234be 100644 --- a/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java +++ b/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java @@ -133,8 +133,8 @@ public class PBKDF2UserAuthenticator extends DefaultUserAuthenticator { return !(plainPassword == null || plainPassword.isEmpty() || hash == null || hash.length == 0); } - private static String encode(byte[] input) { - return new String(Base64.encode(input)); + private static String encode(byte[] input) throws UnsupportedEncodingException { + return new String(Base64.encode(input), "UTF-8"); } private static byte[] decode(String input) throws UnsupportedEncodingException {