20 Commits

Author SHA1 Message Date
Thibaut Vandervelden
43a4f9d6e7 fix fuzzer 2023-09-18 10:58:24 +02:00
Thibaut Vandervelden
29abfa35e9
fix: check length field of NDISC redirected head
If the length field indicates a lenght bigger than the actual data that
it is carying, then the packet is just wrong. Emitting such a packet is
also not allowed. We now also parse the IPv6 header in an NDISC
redirected packet and check that the length is correct.

Signed-off-by: Thibaut Vandervelden <thvdveld@vub.be>
2023-05-10 14:35:32 +02:00
Dario Nieuwenhuis
3a9d017354 Remove unneeded ref patterns and destructures.
This brings the code to a more modern Rust style.

- Dstructuring is not so necessary nowadays, with the borrow checker being smarter, especially around partial captures in closures.
- "ref" is barely needed anymore, with [match ergonomics](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html).
2023-02-05 23:57:42 +01:00
Dario Nieuwenhuis
4300e7cc3b GAT-based Device trait.
The current `'a` lifetime in the `Device` trait is essentially a workaround for lack of GATs.
I'm just experimenting how this would look like, it'll have to wait until GATs are stable to go in.

The main benefit is structs implementing `Device` can now borrow stuff. This wasn't possible
before because the `for<'d> T: Device<'d>` bounds would essentially imply `T: 'static`.
2022-11-06 21:18:02 +01:00
Thibaut Vandervelden
d2e8e993fe add addr resolv with context 2022-10-10 11:17:25 +02:00
Thibaut Vandervelden
4767aadcb4 Update sixlowpan fuzzer 2022-07-01 18:57:56 +02:00
Dario Nieuwenhuis
d703a66d1d iface: borrow the device instead of owning it. 2022-06-06 02:26:45 +02:00
Thibaut Vandervelden
adf56a1701 sixlowpan: add fragmentation logic in interface 2022-05-23 15:44:20 +02:00
Dario Nieuwenhuis
72a9ee46ce socket: reorganize module structure, with one module per protocol. 2022-05-20 02:18:00 +02:00
Anuvrat
8ba8830378 Corrects minor spelling errors 2022-04-24 13:10:01 +05:30
Thibaut Vandervelden
b540ec30b4 Add fuzz tests for 6LoWPAN_IPHC and 6LoWPAN_UDP
Adding fuzz tests for 6LoWPAN_IPHC and 6LoWPAN_UDP.
Some bugs were found.

Ran for 10 minutes.
2021-11-05 10:05:12 +01:00
Thibaut Vandervelden
d9f114a2ab Add fuzzing for IEEE802.15.4
Because IEEE802.15.4 uses a lot of compression in its frame, fuzzing it
is maybe a good idea. Adding this fuzz target showed that some frame
methods were panicking. `check_len` now checks if accessors will panic
or not.

I ran the fuzzer for about 15 minutes and nothing showed up.
2021-11-04 12:01:03 +01:00
Alexandra Sandulescu
858968bb26 fuzz: DHCP header parser 2021-10-28 10:37:57 +02:00
qiujiangkun
a4275a5966 use micros in Instant and Duration 2021-10-05 22:33:58 +02:00
Dario Nieuwenhuis
a5e4e5a0fb fuzz: Modernize fuzz crate, fix tcp_headers not compiling. 2021-10-03 21:29:40 +02:00
Dario Nieuwenhuis
49fa987cdc Add defmt logging support 2021-04-01 01:30:47 +02:00
Dario Nieuwenhuis
d352e151f6 Add support for IP mediums.
- Add `medium` in `DeviceCapabilities`.
- Rename EthernetInterface to Interface.
- Add support to Interface for both Ethernet and IP mediums. The medium to use is detected from `device.capabilities().medium`.
- Ethernet-only features are gated behind the "ethernet" feature, as before.
- IP features are always enabled for now.
2021-03-31 17:05:09 +02:00
jhwgh1968
a315dd1e98 Add TCP header fuzzer
Closes: #284
Approved by: whitequark
2019-05-19 06:41:07 +08:00
whitequark
96b631cee9 Add some ICMPv4 and ICMPv6 packets to fuzz corpus. 2018-01-26 18:43:39 +00:00
whitequark
6271dc7270 Add packet parser fuzzer. 2017-06-24 11:43:12 +00:00