X-Forwarded-For parsing and trusted proxy detection 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.

+7 -30
+2 -8
fuzz/dune
··· 1 1 (executable 2 2 (name fuzz) 3 3 (modules fuzz fuzz_xff) 4 - (libraries xff ipaddr crowbar fmt)) 5 - 6 - (executable 7 - (name gen_corpus) 8 - (modules gen_corpus) 9 - (libraries unix)) 4 + (libraries xff ipaddr alcobar fmt)) 10 5 11 6 (rule 12 7 (alias runtest) ··· 22 17 (= %{profile} afl)) 23 18 (deps 24 19 (source_tree corpus) 25 - fuzz.exe 26 - gen_corpus.exe) 20 + fuzz.exe) 27 21 (action 28 22 (echo "AFL fuzzer built: %{exe:fuzz.exe}\n")))
+1 -1
fuzz/fuzz.ml
··· 3 3 SPDX-License-Identifier: MIT 4 4 ---------------------------------------------------------------------------*) 5 5 6 - let () = Crowbar.run "xff" [ Fuzz_xff.suite ] 6 + let () = Alcobar.run "xff" [ Fuzz_xff.suite ]
+2 -2
fuzz/fuzz_xff.ml
··· 3 3 SPDX-License-Identifier: MIT 4 4 ---------------------------------------------------------------------------*) 5 5 6 - (* Crowbar-based fuzz testing for X-Forwarded-For parsing *) 6 + (* Alcobar-based fuzz testing for X-Forwarded-For parsing *) 7 7 8 - open Crowbar 8 + open Alcobar 9 9 10 10 (* Test that parse_xff never crashes on arbitrary input *) 11 11 let test_parse_xff_no_crash input =
+2 -2
fuzz/fuzz_xff.mli
··· 5 5 6 6 (** Fuzz tests for X-Forwarded-For parsing and trusted proxy detection. *) 7 7 8 - val suite : string * Crowbar.test_case list 9 - (** [suite] is the Crowbar fuzz test suite for [Xff]. *) 8 + val suite : string * Alcobar.test_case list 9 + (** [suite] is the Alcobar fuzz test suite for [Xff]. *)
-17
fuzz/gen_corpus.ml
··· 1 - (** Generate seed corpus for fuzz testing. *) 2 - 3 - let () = 4 - let dir = "corpus" in 5 - (try Unix.mkdir dir 0o755 with Unix.Unix_error (Unix.EEXIST, _, _) -> ()); 6 - let write name data = 7 - let oc = open_out_bin (Filename.concat dir name) in 8 - output_string oc data; 9 - close_out oc 10 - in 11 - write "seed_000" ""; 12 - write "seed_001" "\x00"; 13 - write "seed_002" "\xff"; 14 - write "seed_003" (String.make 16 '\x00'); 15 - write "seed_004" (String.make 16 '\xff'); 16 - write "seed_005" (String.init 256 Char.chr); 17 - print_endline "gen_corpus: wrote 6 seed files"