fix(ssh): nur ed25519-Schlüssel speichern, die ssh2 lesen kann

ssh2.utils.generateKeyPairSync liefert in etwa 4 von 1000 Fällen einen privaten Schlüssel, an dem der eigene Parser scheitert. Ein so erzeugter Server-Schlüssel wäre dauerhaft unbrauchbar gewesen; in den Tests war es die Ursache des gelegentlich roten SSH-Tests.

Refs #014

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 16:39:54 +02:00
co-authored by Claude Opus 5.5
parent 543fc1c8b4
commit 8dca30e254
7 changed files with 52 additions and 15 deletions
+2 -3
View File
@@ -1,16 +1,15 @@
import { utils } from "ssh2";
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { POST as hostSchluesselPost } from "@/app/api/v1/server/[name]/ssh/hostschluessel/route";
import { POST as testPost } from "@/app/api/v1/server/[name]/test/route";
import { verschluesseln } from "@/lib/geheimnisse";
import { MOCK_TOKEN_GEHEIMNIS, MOCK_TOKEN_ID, ProxmoxMock } from "./proxmox-mock/mock";
import { szenarioEinrichten } from "./proxmox-mock/szenario";
import { SshMock } from "./ssh-mock";
import { SshMock, testPaar } from "./ssh-mock";
import { datenbankLeeren, datenbankVerfuegbar, testPrisma } from "./helpers/db";
import { angemeldet, anfrage, kontext } from "./helpers/anfragen";
const mock = new ProxmoxMock();
const paar = utils.generateKeyPairSync("ed25519");
const paar = testPaar();
let ssh: SshMock;
describe.runIf(datenbankVerfuegbar)("Verbindungstest über die API", () => {