mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 07:32:54 +00:00
Every SSH connect ran two separate ~/.ssh scans back-to-back: findDefaultPrivateKey() then findAllDefaultPrivateKeys(). They share identical filter/sort/encrypted-skip logic, so the first scan's result is exactly findAllDefaultPrivateKeys()[0]. Derive the preferred default key from the full list (scanned once) instead, and kick that single scan off before the identity-file / inline-key preparation so the filesystem work overlaps the key prep instead of running serially after it. Behavior is unchanged: auth order and fallback keys are identical. The equivalence the dedupe relies on is pinned by a new characterization test against a faked ~/.ssh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>