Skip to content

fix(ssh): enable macOS UseKeychain runtime support - #316

Open
inureyes wants to merge 1 commit into
mainfrom
fix/usekeychain-runtime-support
Open

fix(ssh): enable macOS UseKeychain runtime support#316
inureyes wants to merge 1 commit into
mainfrom
fix/usekeychain-runtime-support

Conversation

@inureyes

@inureyes inureyes commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Treat Apple's macOS UseKeychain directive as runtime-supported authentication instead of emitting a false unsupported-option warning, and expose the resolved value through bssh -G.
  • Fall back to terminal input when a stored Keychain passphrase is stale, and store newly entered passphrases only after successful private-key decryption.
  • Document bssh's separate Keychain namespace and add parser, resolver, configuration-dump, and encrypted-key regression coverage.

Testing

  • cargo fmt --all --check
  • cargo clippy -- -D warnings
  • cargo test --lib use_keychain (14 passed)
  • cargo test --test ssh_config_dump_test (22 passed)
  • target/debug/bssh -G usekeychain-probe.invalid with the user's default SSH configuration (exit 0, empty stderr, usekeychain yes)

Compatibility notes

Apple OpenSSH stores passphrases in the entitlement-protected com.apple.ssh.passphrases access group. bssh cannot reuse those records directly, so it stores passphrases under its own bssh-ssh-key-passphrase service and may prompt once on the first bssh connection.

A broader cargo test --lib run completed with 1,714 passing tests and four failures in unrelated jump-authentication, control-socket permission, and known-hosts timeout tests. The Linux cross-check could not reach bssh code because the host lacks x86_64-linux-gnu-gcc required by aws-lc-sys.

Classify Apple's UseKeychain directive as a runtime-backed authentication option instead of emitting a false unsupported warning, and expose its resolved value in -G output.

Match macOS behavior by falling back when a stored passphrase is stale and storing prompted passphrases only after successful key decryption. Document bssh's Keychain namespace and add parser, resolver, dump, and encrypted-key regression coverage.

Tests: cargo fmt --all --check; cargo clippy -- -D warnings; cargo test --lib use_keychain; cargo test --test ssh_config_dump_test use_keychain_is_reported_as_runtime_supported
@inureyes inureyes added type:bug Something isn't working status:review Under review priority:medium Medium priority issue labels Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority issue status:review Under review type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant