Added RSA support for authentication. Furthered preparations for release.

This commit is contained in:
Karmaa
2025-03-06 17:52:27 -06:00
parent 963e54bf15
commit 0d464cdf56
4 changed files with 95 additions and 20 deletions

View File

@@ -18,13 +18,13 @@ io.on("connection", (socket) => {
let stream = null;
socket.on("connectToHost", (cols, rows, hostConfig) => {
if (!hostConfig || !hostConfig.ip || !hostConfig.user || !hostConfig.password || !hostConfig.port) {
if (!hostConfig || !hostConfig.ip || !hostConfig.user || (!hostConfig.password && !hostConfig.rsaKey) || !hostConfig.port) {
console.error("Invalid hostConfig received:", hostConfig);
return;
}
console.log("Received hostConfig:", hostConfig);
const { ip, port, user, password } = hostConfig;
const { ip, port, user, password, rsaKey } = hostConfig;
const conn = new SSHClient();
conn
@@ -89,6 +89,7 @@ io.on("connection", (socket) => {
port: port,
username: user,
password: password,
privateKey: rsaKey ? Buffer.from(rsaKey) : undefined,
});
});