summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorSimon Rettberg2020-06-18 11:30:47 +0200
committerSimon Rettberg2020-06-18 11:30:47 +0200
commitefd9614198fb8d6c9b72550c719572b7976cc767 (patch)
tree07dd11abe29ce9d3ee208ed0d6ce49cc13a03d7e /src/main
parentChange RPC port (diff)
downloadbwlp-guacamole-ext-efd9614198fb8d6c9b72550c719572b7976cc767.tar.gz
bwlp-guacamole-ext-efd9614198fb8d6c9b72550c719572b7976cc767.tar.xz
bwlp-guacamole-ext-efd9614198fb8d6c9b72550c719572b7976cc767.zip
Base64 encode LoginRPC data
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java b/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java
index d8c95ae..664bc3f 100644
--- a/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java
@@ -2,7 +2,9 @@ package de.bwlehrpool.bwlp_guac;
import java.io.*;
import java.net.Socket;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
+import java.util.Base64;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.guacamole.net.auth.Credentials;
@@ -211,12 +213,10 @@ public class AvailableClient implements Cloneable {
int version = 1;
output.write(version & 0xFF);
output.write(version >> 8);
-
String data = username + "\n" + credentials.getPassword() + "\n" + resolution;
- output.write(data.getBytes());
-
+ byte[] enc = Base64.getEncoder().encode(data.getBytes(StandardCharsets.UTF_8));
+ output.write(enc);
output.flush();
-
socket.close();
} catch (IOException e) {
LOGGER.warn("Login failed. User: " + username + " Client: " + this, e);