GUACAMOLE-736: Replace JAXB DatatypeConverter with Guava BaseEncoding.
This commit is contained in:
1 parent
87aa2e6c34
commit
37f1da9f1f
16 files changed
+58
-67
No files matched your search
+2
-2
@@ -19,6 +19,7 @@
|
||||
|
||||
package org.apache.guacamole.auth.cas.ticket;
|
||||
|
||||
import com.google.common.io.BaseEncoding;
|
||||
import com.google.inject.Inject;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
@@ -28,7 +29,6 @@ import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import java.nio.charset.Charset;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.GuacamoleServerException;
|
||||
import org.apache.guacamole.auth.cas.conf.ConfigurationService;
|
||||
@@ -161,7 +161,7 @@ public class TicketValidationService {
|
||||
cipher.init(Cipher.DECRYPT_MODE, clearpassKey);
|
||||
|
||||
// Decode and decrypt, and return a new string.
|
||||
final byte[] pass64 = DatatypeConverter.parseBase64Binary(encryptedPassword);
|
||||
final byte[] pass64 = BaseEncoding.base64().decode(encryptedPassword);
|
||||
final byte[] cipherData = cipher.doFinal(pass64);
|
||||
return new String(cipherData, Charset.forName("UTF-8"));
|
||||
|
||||
|
||||
Reference in new issue
Block a user