mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-736: Replace JAXB DatatypeConverter with Guava BaseEncoding.
This commit is contained in:
@@ -235,6 +235,13 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Guava - Utility Library -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>27.0.1-jre</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Guice -->
|
<!-- Guice -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.inject</groupId>
|
<groupId>com.google.inject</groupId>
|
||||||
@@ -255,13 +262,6 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java XML -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.xml.bind</groupId>
|
|
||||||
<artifactId>jaxb-api</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.auth.cas.ticket;
|
package org.apache.guacamole.auth.cas.ticket;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
@@ -28,7 +29,6 @@ import javax.crypto.Cipher;
|
|||||||
import javax.crypto.IllegalBlockSizeException;
|
import javax.crypto.IllegalBlockSizeException;
|
||||||
import javax.crypto.NoSuchPaddingException;
|
import javax.crypto.NoSuchPaddingException;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.GuacamoleServerException;
|
import org.apache.guacamole.GuacamoleServerException;
|
||||||
import org.apache.guacamole.auth.cas.conf.ConfigurationService;
|
import org.apache.guacamole.auth.cas.conf.ConfigurationService;
|
||||||
@@ -161,7 +161,7 @@ public class TicketValidationService {
|
|||||||
cipher.init(Cipher.DECRYPT_MODE, clearpassKey);
|
cipher.init(Cipher.DECRYPT_MODE, clearpassKey);
|
||||||
|
|
||||||
// Decode and decrypt, and return a new string.
|
// 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);
|
final byte[] cipherData = cipher.doFinal(pass64);
|
||||||
return new String(cipherData, Charset.forName("UTF-8"));
|
return new String(cipherData, Charset.forName("UTF-8"));
|
||||||
|
|
||||||
|
@@ -217,6 +217,13 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Guava - Utility Library -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>27.0.1-jre</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Guice -->
|
<!-- Guice -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.inject</groupId>
|
<groupId>com.google.inject</groupId>
|
||||||
@@ -237,13 +244,6 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java XML -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.xml.bind</groupId>
|
|
||||||
<artifactId>jaxb-api</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.auth.duo.api;
|
package org.apache.guacamole.auth.duo.api;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
import org.apache.guacamole.GuacamoleClientException;
|
import org.apache.guacamole.GuacamoleClientException;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ public class DuoCookie {
|
|||||||
// Attempt to decode data as base64
|
// Attempt to decode data as base64
|
||||||
String data;
|
String data;
|
||||||
try {
|
try {
|
||||||
data = new String(DatatypeConverter.parseBase64Binary(str), "UTF-8");
|
data = new String(BaseEncoding.base64().decode(str), "UTF-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bail if invalid base64 is provided
|
// Bail if invalid base64 is provided
|
||||||
@@ -231,7 +231,7 @@ public class DuoCookie {
|
|||||||
String data = username + "|" + integrationKey + "|" + expires;
|
String data = username + "|" + integrationKey + "|" + expires;
|
||||||
|
|
||||||
// Encode resulting cookie string with base64
|
// Encode resulting cookie string with base64
|
||||||
return DatatypeConverter.printBase64Binary(data.getBytes("UTF-8"));
|
return BaseEncoding.base64().encode(data.getBytes("UTF-8"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.auth.duo.api;
|
package org.apache.guacamole.auth.duo.api;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
@@ -26,7 +27,6 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.crypto.Mac;
|
import javax.crypto.Mac;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
import org.apache.guacamole.GuacamoleClientException;
|
import org.apache.guacamole.GuacamoleClientException;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.GuacamoleServerException;
|
import org.apache.guacamole.GuacamoleServerException;
|
||||||
@@ -221,7 +221,7 @@ public class SignedDuoCookie extends DuoCookie {
|
|||||||
mac.init(new SecretKeySpec(key.getBytes("UTF-8"), SIGNATURE_ALGORITHM));
|
mac.init(new SecretKeySpec(key.getBytes("UTF-8"), SIGNATURE_ALGORITHM));
|
||||||
|
|
||||||
// Return signature as hex
|
// Return signature as hex
|
||||||
return DatatypeConverter.printHexBinary(mac.doFinal(data.getBytes("UTF-8"))).toLowerCase();
|
return BaseEncoding.base16().encode(mac.doFinal(data.getBytes("UTF-8"))).toLowerCase();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -98,13 +98,6 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java XML -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.xml.bind</groupId>
|
|
||||||
<artifactId>jaxb-api</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Guacamole Extension API -->
|
<!-- Guacamole Extension API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.guacamole</groupId>
|
<groupId>org.apache.guacamole</groupId>
|
||||||
@@ -142,7 +135,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>19.0</version>
|
<version>27.0.1-jre</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.auth.jdbc.security;
|
package org.apache.guacamole.auth.jdbc.security;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a SHA-256 based implementation of the password encryption
|
* Provides a SHA-256 based implementation of the password encryption
|
||||||
@@ -40,7 +40,7 @@ public class SHA256PasswordEncryptionService implements PasswordEncryptionServic
|
|||||||
builder.append(password);
|
builder.append(password);
|
||||||
|
|
||||||
if (salt != null)
|
if (salt != null)
|
||||||
builder.append(DatatypeConverter.printHexBinary(salt));
|
builder.append(BaseEncoding.base16().encode(salt));
|
||||||
|
|
||||||
// Hash UTF-8 bytes of possibly-salted password
|
// Hash UTF-8 bytes of possibly-salted password
|
||||||
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||||
|
@@ -190,6 +190,13 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Guava - Utility Library -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>27.0.1-jre</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Guice -->
|
<!-- Guice -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.inject</groupId>
|
<groupId>com.google.inject</groupId>
|
||||||
@@ -210,13 +217,6 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java XML -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.xml.bind</groupId>
|
|
||||||
<artifactId>jaxb-api</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- JRadius Core Library -->
|
<!-- JRadius Core Library -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.jradius</groupId>
|
<groupId>net.jradius</groupId>
|
||||||
|
@@ -19,13 +19,11 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.auth.radius;
|
package org.apache.guacamole.auth.radius;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Provider;
|
import com.google.inject.Provider;
|
||||||
import java.lang.IllegalArgumentException;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
import org.apache.guacamole.auth.radius.user.AuthenticatedUser;
|
import org.apache.guacamole.auth.radius.user.AuthenticatedUser;
|
||||||
import org.apache.guacamole.auth.radius.form.RadiusChallengeResponseField;
|
import org.apache.guacamole.auth.radius.form.RadiusChallengeResponseField;
|
||||||
import org.apache.guacamole.auth.radius.form.RadiusStateField;
|
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
|
// We have the required attributes - convert to strings and then generate the additional login box/field
|
||||||
String replyMsg = replyAttr.toString();
|
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 radiusResponseField = new RadiusChallengeResponseField(replyMsg);
|
||||||
Field radiusStateField = new RadiusStateField(radiusState);
|
Field radiusStateField = new RadiusStateField(radiusState);
|
||||||
|
|
||||||
@@ -164,7 +162,7 @@ public class AuthenticationProviderService {
|
|||||||
throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
|
throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] stateBytes = DatatypeConverter.parseHexBinary(stateString);
|
byte[] stateBytes = BaseEncoding.base16().decode(stateString);
|
||||||
radPack = radiusService.sendChallengeResponse(credentials.getUsername(),
|
radPack = radiusService.sendChallengeResponse(credentials.getUsername(),
|
||||||
challengeResponse,
|
challengeResponse,
|
||||||
stateBytes);
|
stateBytes);
|
||||||
|
@@ -221,6 +221,13 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Guava - Utility Library -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>27.0.1-jre</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Guice -->
|
<!-- Guice -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.inject</groupId>
|
<groupId>com.google.inject</groupId>
|
||||||
@@ -241,20 +248,6 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java XML -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.xml.bind</groupId>
|
|
||||||
<artifactId>jaxb-api</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Guava - Utility Library -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
<version>18.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- JUnit -->
|
<!-- JUnit -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
|
@@ -30,7 +30,6 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import javax.ws.rs.core.UriBuilder;
|
import javax.ws.rs.core.UriBuilder;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.auth.totp.user.UserTOTPKey;
|
import org.apache.guacamole.auth.totp.user.UserTOTPKey;
|
||||||
import org.apache.guacamole.auth.totp.conf.ConfigurationService;
|
import org.apache.guacamole.auth.totp.conf.ConfigurationService;
|
||||||
@@ -309,7 +308,7 @@ public class AuthenticationCodeField extends Field {
|
|||||||
|
|
||||||
// Return data URI for generated image
|
// Return data URI for generated image
|
||||||
return "data:image/png;base64,"
|
return "data:image/png;base64,"
|
||||||
+ DatatypeConverter.printBase64Binary(stream.toByteArray());
|
+ BaseEncoding.base64().encode(stream.toByteArray());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -494,6 +494,13 @@
|
|||||||
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Guava Base Libraries -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>27.0.1-jre</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.rest.auth;
|
package org.apache.guacamole.rest.auth;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation of the AuthTokenGenerator based around SecureRandom.
|
* An implementation of the AuthTokenGenerator based around SecureRandom.
|
||||||
@@ -37,7 +37,7 @@ public class SecureRandomAuthTokenGenerator implements AuthTokenGenerator {
|
|||||||
byte[] bytes = new byte[32];
|
byte[] bytes = new byte[32];
|
||||||
secureRandom.nextBytes(bytes);
|
secureRandom.nextBytes(bytes);
|
||||||
|
|
||||||
return DatatypeConverter.printHexBinary(bytes);
|
return BaseEncoding.base16().encode(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.rest.auth;
|
package org.apache.guacamole.rest.auth;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -33,7 +34,6 @@ import javax.ws.rs.Produces;
|
|||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.GuacamoleResourceNotFoundException;
|
import org.apache.guacamole.GuacamoleResourceNotFoundException;
|
||||||
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
||||||
@@ -94,7 +94,8 @@ public class TokenRESTService {
|
|||||||
|
|
||||||
// Decode base64 authorization
|
// Decode base64 authorization
|
||||||
String basicBase64 = authorization.substring(6);
|
String basicBase64 = authorization.substring(6);
|
||||||
String basicCredentials = new String(DatatypeConverter.parseBase64Binary(basicBase64), "UTF-8");
|
String basicCredentials = new String(
|
||||||
|
BaseEncoding.base64().decode(basicBase64), "UTF-8");
|
||||||
|
|
||||||
// Pull username/password from auth data
|
// Pull username/password from auth data
|
||||||
int colon = basicCredentials.indexOf(':');
|
int colon = basicCredentials.indexOf(':');
|
||||||
|
@@ -19,11 +19,11 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.tunnel;
|
package org.apache.guacamole.tunnel;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.net.GuacamoleTunnel;
|
import org.apache.guacamole.net.GuacamoleTunnel;
|
||||||
import org.apache.guacamole.protocol.GuacamoleInstruction;
|
import org.apache.guacamole.protocol.GuacamoleInstruction;
|
||||||
@@ -75,7 +75,7 @@ public class InputStreamInterceptingFilter
|
|||||||
|
|
||||||
// Send "blob" containing provided data
|
// Send "blob" containing provided data
|
||||||
sendInstruction(new GuacamoleInstruction("blob", index,
|
sendInstruction(new GuacamoleInstruction("blob", index,
|
||||||
DatatypeConverter.printBase64Binary(blob)));
|
BaseEncoding.base64().encode(blob)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
package org.apache.guacamole.tunnel;
|
package org.apache.guacamole.tunnel;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.net.GuacamoleTunnel;
|
import org.apache.guacamole.net.GuacamoleTunnel;
|
||||||
import org.apache.guacamole.protocol.GuacamoleInstruction;
|
import org.apache.guacamole.protocol.GuacamoleInstruction;
|
||||||
@@ -127,7 +127,7 @@ public class OutputStreamInterceptingFilter
|
|||||||
byte[] blob;
|
byte[] blob;
|
||||||
try {
|
try {
|
||||||
String data = args.get(1);
|
String data = args.get(1);
|
||||||
blob = DatatypeConverter.parseBase64Binary(data);
|
blob = BaseEncoding.base64().decode(data);
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException e) {
|
catch (IllegalArgumentException e) {
|
||||||
logger.warn("Received base64 data for intercepted stream was invalid.");
|
logger.warn("Received base64 data for intercepted stream was invalid.");
|
||||||
|
Reference in New Issue
Block a user