mirror of
https://github.com/db9979/sshtermy.git
synced 2026-12-05 20:34:07 +01:00
* Absicherung: Tests auf Windows/macOS, govulncheck, Dependabot, Fuzz-Tests, Signatur-Anleitung - CI: Job platforms (windows-latest, macos-latest), vuln (govulncheck), fuzz (15 s je Ziel) - Go immer neuester 1.26-Patch (check-latest) statt fest 1.26.0 - Dependabot für Go-Module und Actions (wöchentlich, gruppiert) - Fuzz-Tests: Terminal-Emulator, Bildsequenzen, Telnet, PPK, LLDP/ARP/MAC, Import, Host-Übersicht, trzsz-Dateinamen - PPK: Argon2-Werte aus der Datei begrenzt (1 GiB, 1000 Durchläufe) - release.yml: Warnung bei unsigniertem Release, Abbruch bei Public Key ohne Secret - docs/signatur.md, make fuzz / make vuln Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUifSEzjZLFvqVjcUxz * Signatur-Anleitung: keygen im Repository-Ordner ausführen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUifSEzjZLFvqVjcUxz * Host-Übersicht macOS: Laufzeit aus kern.boottime richtig lesen (sed nahm usec statt sec) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUifSEzjZLFvqVjcUxz * Import ssh_config: Include nur normale Dateien bis 1 MiB, höchstens 64 (Fuzz-Fund: Import hing) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUifSEzjZLFvqVjcUxz * Windows: Switch-Auflegen auch bei WSAECONNRESET erkennen, Latenz nie 0; Tests plattformfest - isHangup: WSAECONNRESET/WSAECONNABORTED per Fehlercode (deutscher Windows-Text half der Textsuche nicht) - Keepalive-Latenz mindestens 1 ns (Windows-Uhr gröber als localhost-Rundreise) - Tests: USERPROFILE neben HOME, Unix-Rechte nur außerhalb Windows prüfen, Server-Skript-Test nicht unter Git-Bash, Windows-Pfad mit Laufwerk Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUifSEzjZLFvqVjcUxz * Sixel: Zahlen deckeln (Fuzz-Fund: überlaufende Wiederholung hielt das Terminal Sekunden bis endlos fest) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUifSEzjZLFvqVjcUxz * Eigenes Fenster (Windows): Named Pipe mit Puffer, Schreiben blockiert nicht mehr bis zum Lesen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUifSEzjZLFvqVjcUxz --------- Co-authored-by: Claude <noreply@anthropic.com>
31 lines
1.0 KiB
Go
31 lines
1.0 KiB
Go
package sshx
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
// FuzzPPK: PuTTY-Keys aus fremder Hand (Team-Ordner, Import). Kein Absturz,
|
|
// und Argon2 nie mit Werten aus der Datei, die Speicher oder Zeit sprengen.
|
|
func FuzzPPK(f *testing.F) {
|
|
for _, n := range []string{"ppk2-ed25519.ppk", "ppk3-ecdsa-enc.ppk", "ppk2-rsa-enc.ppk"} {
|
|
if b, err := os.ReadFile(filepath.Join("testdata", n)); err == nil {
|
|
f.Add(b, "test")
|
|
}
|
|
}
|
|
f.Add([]byte("PuTTY-User-Key-File-3: ssh-ed25519\nEncryption: aes256-cbc\nKey-Derivation: Argon2id\nArgon2-Memory: 4294967295\nArgon2-Passes: 4294967295\nArgon2-Parallelism: 1\nArgon2-Salt: 00\n"), "x")
|
|
f.Fuzz(func(t *testing.T, b []byte, pass string) {
|
|
IsPPK(b)
|
|
pf, err := readPPK(b)
|
|
if err != nil {
|
|
return
|
|
}
|
|
// Teure Schlüsselableitung nur mit kleinen Werten, sonst wird der Fuzzer lahm.
|
|
if pf.version == 3 && pf.enc != "none" && (pf.argMem > 1024 || pf.argPass > 4) && pf.argMem <= ppkMaxArgonMem && pf.argPass <= ppkMaxArgonPasses {
|
|
return
|
|
}
|
|
_, _ = parsePPK(b, []byte(pass))
|
|
})
|
|
}
|