Matter smart home protocol implementation for OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Migrate from vendored crowbar to opam-pinned alcobar

- Remove vendored crowbar/ directory
- Replace all Crowbar references with Alcobar across 176 .ml files
- Update all fuzz dune files: crowbar → alcobar in libraries
- Remove 77 gen_corpus.ml files (alcobar handles corpus internally)
- Update dune-project files: crowbar → alcobar in dependencies
- Update merlint rules (e705, e726): Crowbar → Alcobar in checks,
docs, and examples
- Update merlint generated docs (index.html)

428 files changed, ~1200 lines removed net.

+10 -45
+2 -8
fuzz/dune
··· 6 6 (executable 7 7 (name fuzz) 8 8 (modules fuzz fuzz_tlv fuzz_case) 9 - (libraries matter crowbar fmt)) 10 - 11 - (executable 12 - (name gen_corpus) 13 - (modules gen_corpus) 14 - (libraries unix)) 9 + (libraries matter alcobar fmt)) 15 10 16 11 (rule 17 12 (alias runtest) ··· 27 22 (= %{profile} afl)) 28 23 (deps 29 24 (source_tree corpus) 30 - fuzz.exe 31 - gen_corpus.exe) 25 + fuzz.exe) 32 26 (action 33 27 (echo "AFL fuzzer built: %{exe:fuzz.exe}\n")))
+1 -1
fuzz/fuzz.ml
··· 1 - let () = Crowbar.run "matter" [ Fuzz_case.suite; Fuzz_tlv.suite ] 1 + let () = Alcobar.run "matter" [ Fuzz_case.suite; Fuzz_tlv.suite ]
+2 -2
fuzz/fuzz_case.ml
··· 3 3 SPDX-License-Identifier: MIT 4 4 ---------------------------------------------------------------------------*) 5 5 6 - (* Crowbar-based fuzz testing for Matter CASE message encoding/decoding *) 6 + (* Alcobar-based fuzz testing for Matter CASE message encoding/decoding *) 7 7 8 - open Crowbar 8 + open Alcobar 9 9 module Case = Matter.Case 10 10 11 11 (** {1 Generators} *)
+1 -1
fuzz/fuzz_case.mli
··· 1 1 (** Fuzz tests for {!Matter.Case}. *) 2 2 3 - val suite : string * Crowbar.test_case list 3 + val suite : string * Alcobar.test_case list 4 4 (** Test suite. *)
+3 -3
fuzz/fuzz_tlv.ml
··· 3 3 SPDX-License-Identifier: MIT 4 4 ---------------------------------------------------------------------------*) 5 5 6 - (* Crowbar-based fuzz testing for Matter TLV roundtripping *) 6 + (* Alcobar-based fuzz testing for Matter TLV roundtripping *) 7 7 8 - open Crowbar 8 + open Alcobar 9 9 module Tlv = Matter.Tlv 10 10 11 11 (* Compare TLV values for equality, handling floats by bit pattern *) ··· 73 73 map [ int64 ] (fun v -> 74 74 let v = if v = Int64.min_int then 0L else Int64.abs v in 75 75 Tlv.Uint v); 76 - map [ Crowbar.bool ] (fun v -> Tlv.Bool v); 76 + map [ Alcobar.bool ] (fun v -> Tlv.Bool v); 77 77 map [ float ] (fun f -> Tlv.Float32 f); 78 78 map [ float ] (fun f -> Tlv.Float64 f); 79 79 map [ bytes ] (fun s -> Tlv.String s);
+1 -1
fuzz/fuzz_tlv.mli
··· 1 1 (** Fuzz tests for {!Matter.Tlv}. *) 2 2 3 - val suite : string * Crowbar.test_case list 3 + val suite : string * Alcobar.test_case list 4 4 (** Test suite. *)
-29
fuzz/gen_corpus.ml
··· 1 - (** Generate seed corpus for Matter fuzz testing. *) 2 - 3 - let () = 4 - (try Unix.mkdir "corpus" 0o755 5 - with Unix.Unix_error (Unix.EEXIST, _, _) -> ()); 6 - let write name data = 7 - let oc = open_out_bin (Filename.concat "corpus" name) in 8 - output_string oc data; 9 - close_out oc 10 - in 11 - (* Empty input *) 12 - write "seed_000" ""; 13 - (* Minimal TLV: anonymous signed int 1 byte, value=0 *) 14 - write "seed_001" "\x00\x00"; 15 - (* TLV boolean true: control=0x09 *) 16 - write "seed_002" "\x09"; 17 - (* TLV boolean false: control=0x08 *) 18 - write "seed_003" "\x08"; 19 - (* TLV null: control=0x14 *) 20 - write "seed_004" "\x14"; 21 - (* TLV UTF-8 string, 1-byte length, "hello" *) 22 - write "seed_005" "\x0c\x05hello"; 23 - (* TLV structure with one element *) 24 - write "seed_006" "\x15\x00\x2a\x18"; 25 - (* Truncated data *) 26 - write "seed_007" "\x0c\xff"; 27 - (* Sigma1-like: random bytes for CASE decode *) 28 - write "seed_008" (String.init 128 (fun i -> Char.chr (i mod 256))); 29 - print_endline "Generated 9 seed files in corpus/"