Open kerhong opened 11 months ago
As mentioned in #77 I would like to keep the library as simple to use as possible, so I don't want to expose unnecessary implementation details.
However, I might go along with exposing the required functions in a separate fuzzing
module, or another such indirect manner.
It might also be valuable to implement Arbitrary
for the opcodes
and then generate full opcode structs.
That way we can at least test the Write -> Read loop.
Couldn't it also work by just reading arbitrary bytes using ServerOpcode::read_unencrypted
?
Fuzzing of the library could help find inconsistencies between parsing and encoding payloads, and also panics reachable from inputs.
The most generic fuzzer I can think would be:
opcode
, generatesize
, generateu8[size - opcode_size]
Fuzzing is usually a separate crate that depends on your crate, so it can only access
pub
items.This needs:
read_opcodes
aspub fn read_opcodes(opcode: u16, body_size: u32, r: &mut &[u8]) -> Result<...>
write_unencrypted_server
from #77