|
|
d1623f64d4
|
refactor(ssh): migrate to libssh callback-based API
Replace deprecated message-based authentication and channel APIs with
modern callback-based server implementation (libssh 0.9+).
Changes:
- Replace ssh_message_auth_password with auth_password_function callback
- Replace ssh_message_channel_request_pty_* with channel_pty_request_function
- Remove #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- Implement session_context_t to pass state between callbacks
- Fix event loop to wait for auth, channel open, AND channel ready (PTY/shell/exec)
Key improvements:
- Eliminates message loop complexity (libssh handles state machine)
- Proper handling of SSH exec requests (e.g., "ssh host exit")
- More maintainable and future-proof code
Testing:
- All tests passing (17/17)
- Basic functionality: 3/3
- Anonymous access: 2/2
- Security features: 11/11
- Stress test: pass
This closes the maintenance debt listed in TODO.md and ensures
compatibility with future libssh versions.
|
2026-02-07 23:04:06 +08:00 |
|