v1.1.0
New Features
macOS Keychain Integration (Issue #59, PR #61)
- Automatic passphrase storage in macOS Keychain after successful SSH key authentication
- Automatic passphrase retrieval before prompting user, providing seamless authentication experience
- Secure memory handling with
Zeroizingfor all sensitive data (passphrases never logged) - SSH config integration via
UseKeychainoption with per-host configuration support - New module
src/ssh/keychain_macos.rs(498 lines) with complete Security Framework wrapper - Cross-platform compatible: All macOS-specific code isolated with conditional compilation
ProxyUseFdpass SSH Option (Issue #58, PR #60)
- Added
ProxyUseFdpassSSH configuration option support (OpenSSH 6.5+) - Performance optimization: ProxyCommand passes connected file descriptors back to ssh
- Reduced overhead: Eliminates lingering processes and extra read/write operations
- Comprehensive test coverage (11 new tests)
Password Authentication Fallback
- Automatic password retry when publickey authentication fails
- OpenSSH-compatible behavior for seamless user experience
- Interactive terminal detection using TTY checks to prevent unexpected prompts
- Works for both exec and interactive modes
Improvements
Security Enhancements (PR #61)
- SSH key file ownership validation: Prevents storing passphrases for keys owned by other users (macOS user ID checks via libc)
- User consent for password fallback: Explicit consent prompt with 30-second timeout before attempting password authentication
- Rate limiting: 100ms delay before connections, 1 second before password fallback (prevents brute-force and fail2ban triggers)
- Permission warnings: Alert users about world-readable SSH key files
Code Quality (PR #61)
- Eliminated 251 lines of duplication in connection logic
- Created
establish_connection()helper function for DRY code - Centralized authentication logic in auth module
- 60% reduction in connection.rs complexity
- Better separation of concerns and maintainability
Cross-Platform Support
- All macOS-specific code properly isolated with
#[cfg(target_os = "macos")] - Conditional imports prevent unused code warnings on non-macOS platforms
- Stub functions maintain API consistency across platforms
Bug Fixes
- Fixed clippy warnings on non-macOS platforms (unused_mut, unused_imports, dead_code)
- Fixed interactive mode missing
use_keychainfield causing authentication failures - Fixed password prompt not appearing when connecting to new servers in interactive mode
- Variable shadowing used for platform-specific code paths
CI/CD Improvements
None
Technical Details
Implementation
- Keychain API Integration: Uses macOS Security Framework's GenericPassword API
- Service name:
"bssh-ssh-key-passphrase" - Account name: Canonical path of SSH key file
- User authentication required when Keychain is locked (macOS managed)
- Service name:
- Security Measures:
- Passphrase length validation (max 8KB) prevents DoS attacks
- Path canonicalization prevents path traversal attacks
- All passphrases zeroized in memory after use
- No sensitive data ever logged or exposed in errors
Test Coverage
- 357 tests pass (including 7 new keychain tests + 11 ProxyUseFdpass tests)
- Keychain-specific tests cover: store/retrieve, delete, nonexistent, update, zeroization, validation, invalid paths
- Integration with existing auth tests verified
- Cross-compilation verified for Linux/macOS
Authentication Priority (6 steps)
- Password (explicit via
--passwordflag) - SSH Agent (explicit via
--use-agentflag) - Key file (specified via
-iflag or SSH config) - SSH Agent auto-detect (SSH_AUTH_SOCK environment)
- Default SSH keys (~/.ssh/id_rsa, ~/.ssh/id_ed25519, etc.)
- Password fallback (with user consent in interactive terminals)
Dependencies
- Added
security-framework = "2.12.1"for macOS Keychain API integration - Added
libcfor macOS user ID checks (conditional on macOS platform)
Breaking Changes
None
Known Issues
None
Full Changelog: v1.0.0...v1.1.0
Related Issues: #58, #59
Related PRs: #60, #61
What's Changed
- feat: Add ProxyUseFdpass SSH configuration option support by @inureyes in #60
- feat: Complete Phase 2 macOS Keychain integration for UseKeychain (#59) by @inureyes in #61
Full Changelog: v1.0.0...v1.1.0