Repository: cloudstack
Updated Branches:
  refs/heads/master 3786aa0e6 -> 694a69486


pbkdf2: fix encoding issue when converting byte[] to String

Signed-off-by: Rohit Yadav <[email protected]>
(cherry picked from commit 814e5574dcabbbf52b878d9fd448be7a66118597)
Signed-off-by: Rohit Yadav <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/694a6948
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/694a6948
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/694a6948

Branch: refs/heads/master
Commit: 694a6948600aec8584d02ab8dc00d6642b46e3c7
Parents: 3786aa0
Author: Rohit Yadav <[email protected]>
Authored: Sat Feb 28 00:42:27 2015 +0530
Committer: Rohit Yadav <[email protected]>
Committed: Sat Feb 28 00:44:20 2015 +0530

----------------------------------------------------------------------
 .../apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/694a6948/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java
----------------------------------------------------------------------
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 43c32c7..58f5ea2 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 {

Reply via email to