gtker / wow_messages

Auto generated messages for the World of Warcraft network protocol
Apache License 2.0
25 stars 10 forks source link

Improve fuzzability #83

Open kerhong opened 11 months ago

kerhong commented 11 months ago

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:

Fuzzing is usually a separate crate that depends on your crate, so it can only access pub items.

This needs:

from #77

gtker commented 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?