fix(ssh): offer chacha20-poly1305 cipher

This commit is contained in:
陈奇
2026-06-05 05:54:23 +00:00
parent 65cd8aba79
commit 8bee13c3f9
4 changed files with 90 additions and 4 deletions

View File

@@ -42,6 +42,11 @@ test("effectiveDefaultAlgorithms (modern) never seeds CBC / arcfour / MD5", () =
}
});
test("effectiveDefaultAlgorithms (modern) includes chacha20-poly1305", () => {
const result = effectiveDefaultAlgorithms(false);
assert.ok(result.cipher.includes("chacha20-poly1305@openssh.com"));
});
test("effectiveDefaultAlgorithms (legacy) appends sha1 KEX, CBC, and ssh-dss", () => {
const modern = effectiveDefaultAlgorithms(false);
const legacy = effectiveDefaultAlgorithms(true);

View File

@@ -137,6 +137,7 @@ const MODERN_DEFAULT_ALGORITHMS: Readonly<Record<SSHAlgorithmCategory, readonly
"aes128-ctr",
"aes192-ctr",
"aes256-ctr",
"chacha20-poly1305@openssh.com",
],
hmac: [
"hmac-sha2-256-etm@openssh.com",