Bundle Protocol Security (RFC 9172) - authentication and encryption for DTN
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 -43
+2 -8
fuzz/dune
··· 1 1 (executable 2 2 (name fuzz) 3 3 (modules fuzz fuzz_bpsec) 4 - (libraries bpsec crowbar crypto-rng.unix)) 4 + (libraries bpsec alcobar crypto-rng.unix)) 5 5 6 6 (rule 7 7 (alias runtest) ··· 17 17 (= %{profile} afl)) 18 18 (deps 19 19 (source_tree corpus) 20 - fuzz.exe 21 - gen_corpus.exe) 20 + fuzz.exe) 22 21 (action 23 22 (echo "AFL fuzzer built: %{exe:fuzz.exe}\n"))) 24 - 25 - (executable 26 - (name gen_corpus) 27 - (modules gen_corpus) 28 - (libraries unix))
+1 -1
fuzz/fuzz.ml
··· 1 - let () = Crowbar.run "bpsec" [ Fuzz_bpsec.suite ] 1 + let () = Alcobar.run "bpsec" [ Fuzz_bpsec.suite ]
+1 -1
fuzz/fuzz_bpsec.ml
··· 3 3 SPDX-License-Identifier: ISC 4 4 ---------------------------------------------------------------------------*) 5 5 6 - open Crowbar 6 + open Alcobar 7 7 8 8 let () = Crypto_rng_unix.use_default () 9 9 let truncate s = if String.length s > 1024 then String.sub s 0 1024 else s
+1 -1
fuzz/fuzz_bpsec.mli
··· 1 1 (** Fuzz tests for {\!Bpsec}. *) 2 2 3 - val suite : string * Crowbar.test_case list 3 + val suite : string * Alcobar.test_case list 4 4 (** Test suite. *)
-32
fuzz/gen_corpus.ml
··· 1 - (** Generate seed corpus for 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 - (* CBOR-encoded security block samples. 12 - BPSec security blocks are CBOR arrays per RFC 9172. *) 13 - (* Empty CBOR array: 0x80 *) 14 - write "seed_000" "\x80"; 15 - (* CBOR array with 5 elements (typical security block structure): 16 - [targets, context_id, context_flags, source, parameters, results] 17 - Minimal: [[1], 1, 0, [1,0], [[]], [[]]] *) 18 - (* targets=[1], context_id=1 (BIB-HMAC-SHA2), flags=0, source=dtn:none=[1,0] *) 19 - write "seed_001" "\x86\x81\x01\x01\x00\x82\x01\x00\x80\x81\x80"; 20 - (* targets=[1], context_id=2 (BCB-AES-GCM), flags=1, source=dtn:none *) 21 - write "seed_002" "\x86\x81\x01\x02\x01\x82\x01\x00\x80\x81\x80"; 22 - (* Truncated CBOR - exercises error paths *) 23 - write "seed_003" "\x86\x81"; 24 - (* Invalid CBOR *) 25 - write "seed_004" "\xFF"; 26 - (* CBOR unsigned integer 0 *) 27 - write "seed_005" "\x00"; 28 - (* Nested CBOR array *) 29 - write "seed_006" "\x82\x81\x01\x82\x02\x03"; 30 - (* CBOR indefinite-length array *) 31 - write "seed_007" "\x9F\x01\x02\x03\xFF"; 32 - print_endline "gen_corpus: wrote 8 bpsec seed files"