Skip to content

Commit

Permalink
Merge pull request #68 from RetGal/unique_certs
Browse files Browse the repository at this point in the history
Closes #60
  • Loading branch information
RetGal authored Nov 4, 2023
2 parents b4a5dd0 + 6cc37d2 commit 4d8d1ca
Show file tree
Hide file tree
Showing 56 changed files with 382 additions and 380 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ You don't have to be a programmer!

For example translations for additional languages would make this app more useful for more earthlings - see: [src/main/resources/Babylon.properties](https://github.com/RetGal/Dayon/blob/master/src/main/resources/Babylon.properties) or [docs](https://github.com/RetGal/Dayon/tree/master/docs)

Also improvements of the existing translations and documentation are very welcome! For example, my current knowledge of Chinese is far below zero - and my knowledge of Russian or Turkish just fractions better..
Also, improvements of the existing translations and documentation are very welcome! For example, my current knowledge of Chinese is far below zero - and my knowledge of Russian or Turkish just fractions better..

Some additional testing, especially on macOS would also be highly appreciated.
Binary file modified docs/assistant_capture_settings.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_clipboard.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_compression_settings.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_control.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_copy_token.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_create_token.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_incoming_connection.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_network_addresses.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_network_addresses_ex.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_network_settings_noupnp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_network_settings_upnp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_start.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assistant_windows_key.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dayon.screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 25 additions & 24 deletions docs/de_support.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ <h2>Hilfe</h2>
<h3>Bekannte Einschränkungen</h3>
<ul>
<li>
Es existiert keine Möglichkeit gewisse Tastenkombinationen wie etwa
<code>Ctrl-Alt-Del</code>
Es existiert keine Möglichkeit gewisse Tastenkombinationen wie etwa <code>Ctrl-Alt-Del</code>
an den entfernten Computer zu senden.
</li>

Expand All @@ -53,30 +52,20 @@ <h3>Bekannte Einschränkungen</h3>

<h3>Dayon! Heimverzeichnis</h3>
<p>
Das Verzeichnis
<code>.dayon</code>
wird im Standardbenutzerverzeichnis des eingelogten Benutzers oder via
JAVA-Property definierten Benutzerverzeichnis
<code>user.home</code>
erstellt und enthält nebst den gespeicherten Einstellungen auch die
Logdatei(en).
Das Verzeichnis <code>.dayon</code> wird im Standardbenutzerverzeichnis des eingelogten Benutzers oder via
JAVA-Property definierten Benutzerverzeichnis <code>user.home</code> erstellt und enthält nebst den
gespeicherten Einstellungen auch die Logdatei(en).
</p>

<h3>CRC Checksumme</h3>
<p>
Auf der Seite des
<em>Assistierten</em>
wird der Bildschirm in
<em>Kacheln</em>
genannte Bereiche aufgeteilt. Bloss veränderte Kacheln werden über das
Netzwerk zum
<em>Assistenten</em>
gesendet. Um zu entscheiden ob sich eine Kachel seit der letzten
Auf der Seite des <em>Assistierten</em> wird der Bildschirm in <em>Kacheln</em>
genannte Bereiche aufgeteilt. Bloss veränderte Kacheln werden über das Netzwerk zum
<em>Assistenten</em> gesendet. Um zu entscheiden ob sich eine Kachel seit der letzten
Erfassung verändert hat, wird ein CRC-Code berechnet (ein eindeutiger
Wert für die in einer Kachel enthaltenen Pixel). Dieses Verfahren ist
hinsichtlich der Verarbeitungsgeschwindigkeit nicht die optimale
Lösung. Es kann mitunter vorkommen, dass einige
<em>veränderte</em>
Lösung. Es kann mitunter vorkommen, dass einige <em>veränderte</em>
Kacheln nicht an den Assistenten gesandt werden.
</p>

Expand All @@ -103,11 +92,9 @@ <h3>Statistiken in Statusleiste</h3>
Anzahl Kacheln: Anzahl übermittelter Kacheln (inkl. Puffer-Treffer).
</li>
<li>
Anzahl übersprungener Bildschirmaufnahmen: Anzahl
Bildschirmaufnahmen, welche wegen eines zu kurzen
Aktualisierungsintervall (für die entsprechende Hardware)
übersprungen worden sind. Um diese Anzahl zu reduzieren, erhöhen Sie
das Erfassungsintervall.
Anzahl übersprungener Bildschirmaufnahmen: Anzahl Bildschirmaufnahmen, welche wegen eines zu kurzen
Aktualisierungsintervall (für die entsprechende Hardware) übersprungen worden sind.
Um diese Anzahl zu reduzieren, erhöhen Sie das Erfassungsintervall.
</li>

<li>
Expand All @@ -122,6 +109,20 @@ <h3>Statistiken in Statusleiste</h3>
<li>Dauer der aktuellen oder der letzten Sitzung</li>
</ol>

<h3>Zertifikatsfingerabdrücke</h3>
<p>
Um "Men in the Middle"-Angriffe zu verhindern, werden die Zertifikatsfingerabdrücke der beiden verbindenden Seiten angezeigt.
Die beiden Fingerabdrücke müssen übereinstimmen - tun sie es nicht, dann ist etwas Merkwürdiges im Gange.
Diese zusätzliche Sicherheitsfunktion wurde mit Version 13 von Dayon eingeführt.
</p>
<p>
<img src="dayon_fingerprints.jpg" alt="Fingerprints"/>
</p>
<p>
<strong>Achtung</strong>: Um die Verbindung mit älteren Clients zu ermöglichen, muss der Kompatibilitätsmodus
<img src="https://raw.githubusercontent.com/RetGal/Dayon/master/src/main/resources/images/compatibility.png" alt="compatibility"/> aktiviert werden.
</p>

<h3>Schematische Darstellung des Verbindungsaufbaus</h3>
<p>
<img src="dayon.connection.diagram.svg" alt="Dayon! connection diagram"/>
Expand Down
14 changes: 14 additions & 0 deletions docs/fr_support.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ <h3>Compteurs de statistiques</h3>
<li>Durée de la session d'assistance active ou de la dernière</li>
</ol>

<h3>Empreintes des certificats</h3>
<p>
Pour éviter les attaques "Men in the Middle", les empreintes digitales des certificats des deux côtés qui se connectent sont affichées.
Les deux empreintes digitales doivent correspondre - si elles ne correspondent pas, cela signifie que quelque chose d'étrange est en cours.
Cette fonction de sécurité supplémentaire a été introduite dans la version 13 de Dayon.
</p>
<p>
<img src="dayon_fingerprints.jpg" alt="Fingerprints"/>
</p>
<p>
<strong>Attention</strong>: pour permettre la connexion avec des clients plus anciens, le mode de compatibilité
<img src="https://raw.githubusercontent.com/RetGal/Dayon/master/src/main/resources/images/compatibility.png" alt="compatibility"/> doit être activé.
</p>

<h3>Etablissement de la connexion</h3>
<p>
<img src="dayon.connection.diagram.svg" alt="Dayon! connection diagram"/>
Expand Down
40 changes: 22 additions & 18 deletions docs/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ <h3>Known Limitations</h3>
<ul>
<li>
There's currently no way to send certain key combinations to the
assisted computer (e.g.,
<code>Ctrl-Alt-Del</code>
).
assisted computer (e.g.,<code>Ctrl-Alt-Del</code>).
</li>
<li>
Ideally, the computers of the assistant and the assisted use both
Expand All @@ -52,34 +50,26 @@ <h3>Known Limitations</h3>

<h3>Dayon! Home Directory</h3>
<p>
The directory
<code>.dayon</code>
is created within the default home directory of the logged-in user or
within the directory referenced by the JAVA property
<code>user.home</code>
and contains the saved user preferences and default log file(s).
The directory <code>.dayon</code> is created within the default home directory of the logged-in user or
within the directory referenced by the JAVA property <code>user.home</code> and contains the saved user
preferences and default log file(s).
</p>

<h3>CRC Checksum</h3>
<p>
On the assisted side, the screen is divided into different areas
called
<em>tiles</em>
. Only tiles that have changed from the previous capture are sent over
called <em>tiles</em>. Only tiles that have changed from the previous capture are sent over
the network to the assistant side. To determine if a tile is different
I'm currently computing a CRC code (i.e., a unique integer value
representing the pixels of the tile) that is not perfect for the sake
of speed. So it might happen that some
<em>changed</em>
I'm currently computing a CRC code (i.e., a unique integer value representing the pixels of the tile)
that is not perfect for the sake of speed. So it might happen that some <em>changed</em>
tiles are not sent to the assistant.
</p>

<p>
Until now I've detected that issue during strong testing for very few
pixels. Visually, I've not noticed anything serious. But in case
things are going mad you can then restart the assisted or before try
the
<code>reset</code> action (<strong>trash bin icon</strong>)
the <code>reset</code> action (<strong>trash bin icon</strong>)
that should clear every cached data and resend a full screen capture
from scratch.
</p>
Expand Down Expand Up @@ -118,6 +108,20 @@ <h3>Statistics Counters</h3>
<li>Duration of the active or the last support session</li>
</ol>

<h3>Certificate fingerprints</h3>
<p>
To prevent "men in the middle" attacks, the certificate fingerprints of the two connecting sides are displayed.
The two fingerprints must match - if they don't, then something strange is going on.
This additional security feature was introduced with version 13 of Dayon!.
</p>
<p>
<img src="dayon_fingerprints.jpg" alt="Fingerprints"/>
</p>
<p>
<strong>Caution</strong>: To ensure connection with older clients, the compatibility mode
<img src="https://raw.githubusercontent.com/RetGal/Dayon/master/src/main/resources/images/compatibility.png" alt="compatibility"/> needs to be activated.
</p>

<h3>Connection establishment</h3>
<p>
<img src="dayon.connection.diagram.svg" alt="Dayon! connection diagram"/>
Expand Down
14 changes: 14 additions & 0 deletions docs/zh_support.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ <h3>状态统计</h3>
<li>会话时长
</ol>

<h3>证书指纹</h3>
<p>
为了防止“中间人”攻击,显示连接两侧的证书指纹。
两个指纹必须匹配——如果不匹配,就会发生奇怪的事情。
Dayon! 版本 13 引入了这一附加安全功能。
</p>
<p>
<img src="dayon_fingerprints.jpg" alt="指纹"/>
</p>
<p>
<strong>注意</strong>:为了确保与旧客户端的连接,兼容模式
<img src="https://raw.githubusercontent.com/RetGal/Dayon/master/src/main/resources/images/compatibility.png" alt="compatibility"/> 需要激活。
</p>

<h3>连接建立</h3>
<p>
<img src="dayon.connection.diagram.svg" alt="Dayon! connection diagram">
Expand Down
66 changes: 33 additions & 33 deletions ext/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
define('TOKEN_LIFETIME', 604800000);
header('Content-type: text/plain');
if (isset($_GET['port'])) {
$port = clean($_GET['port'], 6);
if (isValidPort($port)) {
$pdo = new PDO('sqlite:'.DB_NAME);
$port = clean($_GET['port'], 6);
if (isValidPort($port)) {
$pdo = new PDO('sqlite:'.DB_NAME);
echo createToken($pdo, $port),"\n";
if (rand(0, 5) == 5) {
removeOldTokens($pdo);
}
}
}
}

if (isset($_GET['token'])) {
$token = clean($_GET['token'], 7);
$pdo = new PDO('sqlite:'.DB_NAME);
echo readToken($token, $pdo),"\n";
updateToken($token, $_SERVER['REMOTE_ADDR'], $pdo);
$token = clean($_GET['token'], 7);
$pdo = new PDO('sqlite:'.DB_NAME);
echo readToken($token, $pdo),"\n";
updateToken($token, $_SERVER['REMOTE_ADDR'], $pdo);
}

function clean($val, $maxLen = "") {
$val = trim(strip_tags($val));
if (!empty($maxLen)) {
$val = substr($val, 0, $maxLen);
}
return $val;
$val = trim(strip_tags($val));
if (!empty($maxLen)) {
$val = substr($val, 0, $maxLen);
}
return $val;
}

function isValidPort($port) {
Expand All @@ -52,40 +52,40 @@ function computeToken($length) {

function insertToken($token, $address, $port, $pdo) {
$sql = "INSERT INTO tokens (token,assistant,port,ts) VALUES (:token,:address,:port,:ts)";
$date = new DateTime();
$ts = $date->getTimestamp();
$date = new DateTime();
$ts = $date->getTimestamp();
$stmt = $pdo->prepare($sql);
$stmt->bindParam(':token', $token, PDO::PARAM_STR, 7);
$stmt->bindParam(':address', $address, PDO::PARAM_STR);
$stmt->bindParam(':port', $port, PDO::PARAM_INT);
$stmt->bindParam(':ts', $ts, PDO::PARAM_INT);
$success = $stmt->execute();
if (!$success) {
// print_r($stmt->errorInfo());
return 0;
} else {
return 1;
}
// print_r($stmt->errorInfo());
return 0;
} else {
return 1;
}
}

function removeOldTokens($pdo) {
$date = new DateTime();
$ts = $date->getTimestamp();
$delete = "DELETE FROM tokens WHERE ts < ?";
$stmt = $pdo->prepare($delete);
$stmt->execute(array($ts-TOKEN_LIFETIME));
$date = new DateTime();
$ts = $date->getTimestamp();
$delete = "DELETE FROM tokens WHERE ts < ?";
$stmt = $pdo->prepare($delete);
$stmt->execute(array($ts-TOKEN_LIFETIME));
}

function readToken($token, $pdo) {
$sql = "SELECT assistant,port FROM tokens WHERE token = :token";
$sql = "SELECT assistant,port FROM tokens WHERE token = :token";
$stmt = $pdo->prepare($sql);
if ($stmt->execute([":token" => $token])) {
$stmt->bindColumn(1, $address);
$stmt->bindColumn(2, $port);
return $stmt->fetch(PDO::FETCH_BOUND) ? "$address*$port" : "";
} else {
return "";
}
if ($stmt->execute([":token" => $token])) {
$stmt->bindColumn(1, $address);
$stmt->bindColumn(2, $port);
return $stmt->fetch(PDO::FETCH_BOUND) ? "$address*$port" : "";
} else {
return "";
}
}

function updateToken($token, $address, $pdo) {
Expand Down
Binary file modified flatpak/dayon.screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/dayon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ elif [ ! -f /etc/alternatives/java ]; then
else
JAVA=$(ls -l /etc/alternatives/java | awk -F'> ' '{print $2}' | awk -F'/bin/java' '{print $1}')/bin/java
fi
JAVA_OPTS=
JAVA_OPTS="-Xmx256M"
case "$@" in
*log=console*)
LOG=
Expand Down
2 changes: 1 addition & 1 deletion resources/deb/dayon_assistant.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Dayon! Assistant
Version=1.0
Exec=/usr/bin/dayon_assistant
Exec=dayon_assistant
Comment=Offer remote assistance
Comment[de]=Remotesupport anbieten
Comment[es]=Ofrecer asistencia remota
Expand Down
2 changes: 1 addition & 1 deletion resources/deb/dayon_assisted.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Dayon! Assisted
Version=1.0
Exec=/usr/bin/dayon_assisted
Exec=dayon_assisted
Comment=Request remote assistance
Comment[de]=Remotesupport erbitten
Comment[es]=Solicitar asistencia remota
Expand Down
2 changes: 1 addition & 1 deletion resources/snap/dayon.launcher
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ case "$@" in
LOG="-Ddayon.log=file"
;;
esac
java ${LOG} -jar "$@"
java ${LOG} -Xmx256M -jar "$@"
Loading

0 comments on commit 4d8d1ca

Please sign in to comment.