Merge pull request #107 from p-l-/fix-warning

Fix build warning
This commit is contained in:
Pierre 2023-02-14 00:29:07 +01:00 committed by GitHub
commit 8620c5ff20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,27 +57,6 @@ impl ProtocolState {
} }
} }
/* Reconstruct client's banner from the parsed information */
fn ssh_banner(pstate: &ProtocolState) -> Vec<u8> {
let mut banner = b"SSH-".to_vec();
for b in &pstate.ssh_version {
banner.push(*b);
}
banner.push(b'-');
for b in &pstate.ssh_software {
banner.push(*b);
}
if pstate.ssh_comment.len() > 0 {
banner.push(b' ');
for b in &pstate.ssh_comment {
banner.push(*b);
}
}
banner.push(b'\r');
banner.push(b'\n');
banner
}
fn ssh_parse(pstate: &mut ProtocolState, data: &[u8]) { fn ssh_parse(pstate: &mut ProtocolState, data: &[u8]) {
/* RFC 4253: /* RFC 4253:
* *
@ -205,6 +184,27 @@ pub fn repl<'a>(
mod tests { mod tests {
use super::*; use super::*;
/* Reconstruct client's banner from the parsed information */
fn ssh_banner(pstate: &ProtocolState) -> Vec<u8> {
let mut banner = b"SSH-".to_vec();
for b in &pstate.ssh_version {
banner.push(*b);
}
banner.push(b'-');
for b in &pstate.ssh_software {
banner.push(*b);
}
if pstate.ssh_comment.len() > 0 {
banner.push(b' ');
for b in &pstate.ssh_comment {
banner.push(*b);
}
}
banner.push(b'\r');
banner.push(b'\n');
banner
}
#[test] #[test]
fn ssh_2_banner_parse() { fn ssh_2_banner_parse() {
/* all at once */ /* all at once */