handle unknown header on server
This commit is contained in:
parent
d5511e1938
commit
270ef5cf84
1 changed files with 16 additions and 12 deletions
|
@ -102,20 +102,24 @@ async fn handle_request(
|
||||||
stack = match (stack, n) {
|
stack = match (stack, n) {
|
||||||
(0, b'\r') => 1,
|
(0, b'\r') => 1,
|
||||||
(1, b'\n') => {
|
(1, b'\n') => {
|
||||||
if key == b"Host" {
|
if !status {
|
||||||
remote = String::from_utf8(value.clone())?;
|
if key == b"Host" {
|
||||||
} else if key == b"Authentication" {
|
remote = String::from_utf8(value.clone())?;
|
||||||
let passhash = String::from_utf8(value.clone())?;
|
} else if key == b"Authentication" {
|
||||||
if !bcrypt::verify(password.clone(), &format!("{stable_id}{passhash}"))? {
|
let passhash = String::from_utf8(value.clone())?;
|
||||||
return Err("bad passhash error!!! not nice env!!".into());
|
if !bcrypt::verify(password.clone(), &format!("{stable_id}{passhash}"))? {
|
||||||
|
return Err("bad passhash error!!! not nice env!!".into());
|
||||||
|
}
|
||||||
|
} else if key == b"UDP" {
|
||||||
|
udp = value == b"1";
|
||||||
|
} else {
|
||||||
|
return Err("unknown header provided!! malware connection".into());
|
||||||
}
|
}
|
||||||
} else if key == b"UDP" {
|
|
||||||
udp = value == b"1";
|
|
||||||
}
|
|
||||||
|
|
||||||
is_key = true;
|
is_key = true;
|
||||||
key.clear();
|
key.clear();
|
||||||
value.clear();
|
value.clear();
|
||||||
|
}
|
||||||
2
|
2
|
||||||
},
|
},
|
||||||
(2, b'\r') => 3,
|
(2, b'\r') => 3,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue