mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 06:38:21 +00:00
Fix build warning
This commit is contained in:
parent
fe92f12af0
commit
7c6d8258ef
1 changed files with 21 additions and 21 deletions
|
@ -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 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue