fix: harden SSH trust and dependency security

This commit is contained in:
Andy Dixon
2026-06-02 12:25:20 +01:00
parent fb230ee35d
commit ea6a9743d1
17 changed files with 1365 additions and 186 deletions
+26
View File
@@ -0,0 +1,26 @@
package vncclient
import "testing"
func TestNewProxyTokenIsRandomHex(t *testing.T) {
first, err := newProxyToken()
if err != nil {
t.Fatalf("newProxyToken() error = %v", err)
}
second, err := newProxyToken()
if err != nil {
t.Fatalf("newProxyToken() second error = %v", err)
}
if len(first) != 32 {
t.Fatalf("token length = %d, want 32", len(first))
}
if first == second {
t.Fatal("expected separate tokens to differ")
}
for _, ch := range first {
if !((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f')) {
t.Fatalf("token contains non-hex character %q", ch)
}
}
}