Update Phase 6: Fix SFTP subsystem initialization and data handling
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

Phase 6 updates:
- Add SftpHandler integration in Channel structure
- Initialize SFTP handler on subsystem request
- Handle SFTP packets via CHANNEL_DATA
- Fix CHANNEL_DATA response handling in server loop

Phase 7 progress:
- SFTP subsystem initialization working
- SSH_FXP_INIT/VERSION handshake working
- SFTP packet format partially implemented
- Need further debugging for complete SFTP functionality

Current status:
- SSH command execution fully working (Phase 6 ✓)
- SFTP connection initialization working
- File transfer operations pending debug
This commit is contained in:
Warren
2026-06-15 10:50:08 +08:00
parent 723482f59a
commit 1be361d91a
2 changed files with 54 additions and 7 deletions

View File

@@ -330,7 +330,12 @@ fn handle_ssh_service_loop(
}
Some(&pt) if pt == PacketType::SSH_MSG_CHANNEL_DATA as u8 => {
info!("Received SSH_MSG_CHANNEL_DATA");
channel_manager.handle_channel_data(&packet)?;
if let Some(response) = channel_manager.handle_channel_data(&packet)? {
// Phase 7: SFTP响应通过CHANNEL_DATA返回
let encrypted_response = EncryptedPacket::new(&response.payload, encryption_ctx, true)?;
encrypted_response.write(stream)?;
info!("Sent SSH_MSG_CHANNEL_DATA (SFTP response)");
}
}
Some(&pt) if pt == PacketType::SSH_MSG_CHANNEL_CLOSE as u8 => {
info!("Received SSH_MSG_CHANNEL_CLOSE");