mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-736: Replace JAXB DatatypeConverter with Guava BaseEncoding.
This commit is contained in:
@@ -189,6 +189,13 @@
|
||||
<version>1.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Guava - Utility Library -->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>27.0.1-jre</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Guice -->
|
||||
<dependency>
|
||||
@@ -210,13 +217,6 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Java XML -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JRadius Core Library -->
|
||||
<dependency>
|
||||
<groupId>net.jradius</groupId>
|
||||
|
@@ -19,13 +19,11 @@
|
||||
|
||||
package org.apache.guacamole.auth.radius;
|
||||
|
||||
import com.google.common.io.BaseEncoding;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Arrays;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import org.apache.guacamole.auth.radius.user.AuthenticatedUser;
|
||||
import org.apache.guacamole.auth.radius.form.RadiusChallengeResponseField;
|
||||
import org.apache.guacamole.auth.radius.form.RadiusStateField;
|
||||
@@ -100,7 +98,7 @@ public class AuthenticationProviderService {
|
||||
|
||||
// We have the required attributes - convert to strings and then generate the additional login box/field
|
||||
String replyMsg = replyAttr.toString();
|
||||
String radiusState = DatatypeConverter.printHexBinary(stateAttr.getValue().getBytes());
|
||||
String radiusState = BaseEncoding.base16().encode(stateAttr.getValue().getBytes());
|
||||
Field radiusResponseField = new RadiusChallengeResponseField(replyMsg);
|
||||
Field radiusStateField = new RadiusStateField(radiusState);
|
||||
|
||||
@@ -164,7 +162,7 @@ public class AuthenticationProviderService {
|
||||
throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
|
||||
}
|
||||
|
||||
byte[] stateBytes = DatatypeConverter.parseHexBinary(stateString);
|
||||
byte[] stateBytes = BaseEncoding.base16().decode(stateString);
|
||||
radPack = radiusService.sendChallengeResponse(credentials.getUsername(),
|
||||
challengeResponse,
|
||||
stateBytes);
|
||||
|
Reference in New Issue
Block a user