-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socks/v1 #12303
base: master
Are you sure you want to change the base?
Socks/v1 #12303
Conversation
} else if t == 4 { | ||
parse_connect_command_request_ipv6(i)? | ||
} else { | ||
return Err(Err::Error(make_error(i, ErrorKind::Verify))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be unreachable but the compiler is not smart enough to understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could throw an #[unreachable]
there, however it will panic if its every reached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think I prefer a debug validate bug on then, with a error handler. Would like to avoid any risk of reachable assertions.
let (i, _ver) = verify(be_u8, |&v| v == 5)(i)?; | ||
let (i, results) = be_u8(i)?; | ||
let (i, _res) = verify(be_u8, |&v| v == 0)(i)?; | ||
let (i, at) = verify(be_u8, |&v| v == 1)(i)?; // domain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be checked
tx_id: u64, | ||
tx_data: AppLayerTxData, | ||
complete: bool, | ||
pub connect: Option<SocksTransactionConnect>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
want to consolidate these 3 into an enum
rust/src/socks/socks.rs
Outdated
} | ||
} | ||
} | ||
SocksConnectionState::SocksStateAuthMethodSent => {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still need to handle these and other "invalid" states for this direction.
unsafe extern "C" fn rs_socks_probing_parser( | ||
_flow: *const Flow, _direction: u8, input: *const u8, input_len: u32, _rdir: *mut u8, | ||
) -> AppProto { | ||
// Need at least 2 bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO haven't looked much as this yet
Information: QA ran without warnings. Pipeline 23989 |
8896bff
to
b07c3de
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12303 +/- ##
==========================================
- Coverage 83.22% 83.22% -0.01%
==========================================
Files 912 915 +3
Lines 257311 258155 +844
==========================================
+ Hits 214154 214844 +690
- Misses 43157 43311 +154
Flags with carried forward coverage won't be shown. Click here to find out more. |
b07c3de
to
11756a3
Compare
Information: QA ran without warnings. Pipeline 24014 |
So it can be used in the socks parser
74af65d
to
d9416c3
Compare
Information: QA ran without warnings. Pipeline 24017 |
Information: QA ran without warnings. Pipeline 24018 |
Information: QA ran without warnings. Pipeline 24027 |
Information: QA ran without warnings. Pipeline 24032 |
Initial draft of socks parser work.
Lots of todos:
SV_BRANCH=OISF/suricata-verify#2195
https://redmine.openinfosecfoundation.org/issues/4965