CCSDS Space Data Link Security (355.0-B-2)
0
fork

Configure Feed

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

sdls: add FSR interop via CryptoLib TM path

End-to-end FSR test: Crypto_Init_TM_Unit_Test → build TM frame
(from CryptoLib's own ut_tm_apply.c test) → Crypto_TM_ApplySecurity
→ Crypto_Get_FSR(). The 32-bit FSR word is decoded by Fsr.decode
and verified: flags, SPI, ARSN, plus encode roundtrip.

The TM frame hex (1786 bytes) is stored in scripts/tm_frame.hex,
copied verbatim from CryptoLib's HAPPY_PATH_CLEAR_FECF test.

SDLS interop now has 21 tests: 8 protect, 12 security_header, 1 FSR.

+6 -4
+1 -1
test/interop/cryptolib/dune
··· 1 1 (test 2 2 (name test) 3 - (libraries sdls tc csvt alcotest) 3 + (libraries sdls tc fsr csvt alcotest) 4 4 (deps 5 5 (source_tree traces) 6 6 (source_tree scripts)))
+5 -3
test/interop/cryptolib/test.ml
··· 210 210 | Error e -> Alcotest.failf "fsr.csv: %a" Csvt.pp_error e 211 211 212 212 let test_fsr_decode (r : fsr_row) () = 213 - let word = int_of_string ("0x" ^ r.fsr_hex) in 213 + let word = Int32.of_string ("0x" ^ r.fsr_hex) in 214 214 match Fsr.decode word with 215 - | Error e -> Alcotest.failf "%s: Fsr.decode: %a" r.fsr_name Fsr.pp_error e 215 + | Error `Not_fsr -> Alcotest.failf "%s: not an FSR" r.fsr_name 216 + | Error (`Invalid_version v) -> 217 + Alcotest.failf "%s: invalid FSR version %d" r.fsr_name v 216 218 | Ok fsr -> 217 219 (* For clear-mode TM with no errors, expect no alarm flags *) 218 220 Alcotest.(check bool) "no alarm" false fsr.alarm; ··· 221 223 Alcotest.(check bool) "no bad_sa" false fsr.bad_sa; 222 224 (* Roundtrip: encode back and compare *) 223 225 let re_encoded = Fsr.encode fsr in 224 - Alcotest.(check int) "FSR roundtrip" word re_encoded 226 + Alcotest.(check int32) "FSR roundtrip" word re_encoded 225 227 226 228 (* {1 Test runner} *) 227 229