You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes the M12.6 algorithm-override loop. AnvilConfig gains four
new public fields, `apply_ssh_config` honors `KexAlgorithms` /
`Ciphers` / `MACs` / `HostKeyAlgorithms` directives, and
`build_russh_config` consumes the resulting lists when building the
russh `Preferred` set.
src/config.rs:
- AnvilConfig: four new pub fields
kex_algorithms: Option<Vec<String>>
ciphers: Option<Vec<String>>
macs: Option<Vec<String>>
host_key_algorithms: Option<Vec<String>>
Each `None` selects Anvil's curated default
(`anvil_ssh::algorithms::anvil_default_*`); each `Some` is a list
that has already passed through `apply_overrides` (denylist
applied, +/-/^ resolved).
- AnvilConfigBuilder: four new pub setters mirroring the field names.
- apply_ssh_config: new private helper `apply_alg_directive` reads
one ResolvedSshConfig algorithm directive, runs it through
`algorithms::apply_overrides` against the curated default, and
stores via the corresponding setter. Malformed values (denylisted
entries) log a warn and leave the field on its None default so
the curated list is used at session-build time.
- warn_unhonored_directives: dropped the four algorithm-directive
entries from the M17 deferral warning; only ConnectTimeout +
ConnectionAttempts (M18) remain.
src/session.rs:
- build_russh_config(config: &AnvilConfig) — signature changed from
the previous (Duration) form. Now consumes config's algorithm
fields, falling back to anvil_default_* when each Option is None.
Builds russh `Preferred` from the lists via three new private
lookups (russh_kex_name / russh_cipher_name / russh_mac_name)
that map user-supplied strings to russh's published Name
constants. Unknown names are silently dropped from the set
because russh's `Name` types only accept `&'static str`; Strict
upfront validation lives in M17.4 against `algorithms::all_supported()`.
- Host-key field uses the existing russh::keys::Algorithm::FromStr
impl which round-trips unknown names via Algorithm::Other.
- New `tracing::trace!` event at CAT_KEX listing the four offered
preference vectors before connect — answers "what did Gitway TRY
to negotiate?" as a M15 / FR-66 instrumentation companion to the
existing `check_server_key` event.
- Test sites updated to call `build_russh_config(&AnvilConfig::builder("test.example").build())`.
Public API: pure additive. Existing consumers that destructure
AnvilConfig with `..` syntax keep working. Existing callers of
build_russh_config are internal-only — the signature change is
crate-private.
Plan: M17.2 of anvil-gitway-milestone-plan.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments