upstream: https://github.com/mirage/ocaml-mbr
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.

+5 -51
+2 -8
fuzz/dune
··· 6 6 (executable 7 7 (name fuzz) 8 8 (modules fuzz fuzz_mbr) 9 - (libraries mbr crowbar)) 9 + (libraries mbr alcobar)) 10 10 11 11 (rule 12 12 (alias runtest) ··· 22 22 (= %{profile} afl)) 23 23 (deps 24 24 (source_tree corpus) 25 - fuzz.exe 26 - gen_corpus.exe) 25 + fuzz.exe) 27 26 (action 28 27 (echo "AFL fuzzer built: %{exe:fuzz.exe}\n"))) 29 - 30 - (executable 31 - (name gen_corpus) 32 - (modules gen_corpus) 33 - (libraries mbr unix))
+1 -1
fuzz/fuzz.ml
··· 1 - let () = Crowbar.run "mbr" [ Fuzz_mbr.suite ] 1 + let () = Alcobar.run "mbr" [ Fuzz_mbr.suite ]
+1 -1
fuzz/fuzz_mbr.ml
··· 14 14 - Malformed partition entries shouldn't cause crashes 15 15 - CHS values can be crafted to cause issues *) 16 16 17 - open Crowbar 17 + open Alcobar 18 18 19 19 (** Truncate input to reasonable size. *) 20 20 let truncate ?(max_len = 512) buf =
+1 -1
fuzz/fuzz_mbr.mli
··· 1 1 (** Fuzz tests for {!Mbr}. *) 2 2 3 - val suite : string * Crowbar.test_case list 3 + val suite : string * Alcobar.test_case list 4 4 (** Test suite. *)
-40
fuzz/gen_corpus.ml
··· 1 - (** Generate seed corpus for MBR 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 - (* Valid MBR with one partition *) 12 - let p1 = 13 - match 14 - Mbr.Partition.make ~active:false ~partition_type:0x83 2048l 1048576l 15 - with 16 - | Ok p -> p 17 - | Error _ -> failwith "failed to create partition" 18 - in 19 - let mbr = match Mbr.v [ p1 ] with Ok m -> m | Error _ -> failwith "mbr" in 20 - write "seed_000" (Mbr.to_string mbr); 21 - (* Active partition with FAT32 type *) 22 - let p2 = 23 - match Mbr.Partition.make ~active:true ~partition_type:0x0C 2048l 4096l with 24 - | Ok p -> p 25 - | Error _ -> failwith "failed to create partition" 26 - in 27 - let mbr2 = match Mbr.v [ p2 ] with Ok m -> m | Error _ -> failwith "mbr" in 28 - write "seed_001" (Mbr.to_string mbr2); 29 - (* Too short - exercises error paths *) 30 - write "seed_002" "\x00\x00\x00\x00"; 31 - (* All zeros, 512 bytes *) 32 - write "seed_003" (String.make 512 '\x00'); 33 - (* All ones, 512 bytes *) 34 - write "seed_004" (String.make 512 '\xFF'); 35 - (* Valid boot signature at end but garbage elsewhere *) 36 - let buf = Bytes.make 512 '\x00' in 37 - Bytes.set buf 510 '\x55'; 38 - Bytes.set buf 511 '\xAA'; 39 - write "seed_005" (Bytes.to_string buf); 40 - print_endline "gen_corpus: wrote 6 MBR seed files"