diff options
author | Simon Rettberg | 2020-06-18 11:30:47 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-06-18 11:30:47 +0200 |
commit | efd9614198fb8d6c9b72550c719572b7976cc767 (patch) | |
tree | 07dd11abe29ce9d3ee208ed0d6ce49cc13a03d7e /src/main/java/de/bwlehrpool | |
parent | Change RPC port (diff) | |
download | bwlp-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/java/de/bwlehrpool')
-rw-r--r-- | src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java | 8 |
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); |