feat: complete wgcloak v1 transports
This commit is contained in:
1 parent
49ec9d8c33
commit
cedab4910e
47 files changed
+2849
-400
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#![no_main]
|
||||
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use wgcloak::transport::tls_tcp::FrameCodec;
|
||||
|
||||
const MAX_INPUT: usize = 64 * 1024;
|
||||
const MAX_FRAME: usize = 16 * 1024;
|
||||
const CHUNK: usize = 97;
|
||||
|
||||
fuzz_target!(|input: &[u8]| {
|
||||
let input = &input[..input.len().min(MAX_INPUT)];
|
||||
let Ok(mut codec) = FrameCodec::new(MAX_FRAME) else {
|
||||
return;
|
||||
};
|
||||
|
||||
// Feed deliberately uneven chunks so header/payload state transitions are
|
||||
// exercised independently of TCP read boundaries.
|
||||
for chunk in input.chunks(CHUNK) {
|
||||
if codec.feed(chunk).is_err() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let _ = codec.finish();
|
||||
});
|
||||
Reference in new issue
Block a user