Skip to content

Commit 814e557

Browse files
committed
pbkdf2: fix encoding issue when converting byte[] to String
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent dd5fb2e commit 814e557

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ private static boolean validateCredentials(String plainPassword, byte[] hash) {
133133
return !(plainPassword == null || plainPassword.isEmpty() || hash == null || hash.length == 0);
134134
}
135135

136-
private static String encode(byte[] input) {
137-
return new String(Base64.encode(input));
136+
private static String encode(byte[] input) throws UnsupportedEncodingException {
137+
return new String(Base64.encode(input), "UTF-8");
138138
}
139139

140140
private static byte[] decode(String input) throws UnsupportedEncodingException {

0 commit comments

Comments
 (0)