pub fn handle_query(query: &str) {
match query {
"cipher" => {
println!("aes128-ctr\naes192-ctr\naes256-ctr");
println!("aes128-gcm@openssh.com\naes256-gcm@openssh.com");
println!("chacha20-poly1305@openssh.com");
}
"cipher-auth" => {
println!("aes128-gcm@openssh.com\naes256-gcm@openssh.com");
println!("chacha20-poly1305@openssh.com");
}
"mac" => {
println!("hmac-sha2-256\nhmac-sha2-512\nhmac-sha1");
}
"kex" => {
println!("curve25519-sha256\ncurve25519-sha256@libssh.org");
println!("ecdh-sha2-nistp256\necdh-sha2-nistp384\necdh-sha2-nistp521");
}
"key" | "key-plain" | "key-cert" | "key-sig" => {
println!("ssh-rsa\nssh-ed25519");
println!("ecdsa-sha2-nistp256\necdsa-sha2-nistp384\necdsa-sha2-nistp521");
}
"protocol-version" => {
println!("2");
}
"help" => {
println!("Available query options:");
println!(" cipher - Supported ciphers");
println!(" cipher-auth - Authenticated encryption ciphers");
println!(" mac - Supported MAC algorithms");
println!(" kex - Supported key exchange algorithms");
println!(" key - Supported key types");
println!(" protocol-version - SSH protocol version");
}
_ => {
eprintln!("Unknown query option: {query}");
eprintln!("Use 'bssh -Q help' to see available options");
std::process::exit(1);
}
}
}