From: Christian Franke Date: Fri, 25 May 2018 12:31:59 +0000 (+0200) Subject: tests/isisd: remove auth when fuzzing X-Git-Tag: frr-7.1-dev~384^2~9 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9d33cf3886c6451291d019577ae6e6f1c9dbbf2a;p=mirror%2Ffrr.git tests/isisd: remove auth when fuzzing Our "deserialize, reserialize, check-equality" test fails when the fuzzer produces PDUs with incorrect cryptographic checksums. While the most realistic solution would be to validate the cryptographic checksums in the test program, that seems very silly, given that we don't want to fuzz our cryptographic auth. Given that, removing auth during fuzzing seems the next best solution. Signed-off-by: Christian Franke --- diff --git a/tests/isisd/test_fuzz_isis_tlv.c b/tests/isisd/test_fuzz_isis_tlv.c index 67a1593500..3a56f83f0a 100644 --- a/tests/isisd/test_fuzz_isis_tlv.c +++ b/tests/isisd/test_fuzz_isis_tlv.c @@ -114,7 +114,11 @@ static int test(FILE *input, FILE *output) const char *s_tlvs = isis_format_tlvs(tlvs); fprintf(output, "Unpacked TLVs:\n%s", s_tlvs); + struct isis_item *orig_auth = tlvs->isis_auth.head; + tlvs->isis_auth.head = NULL; + s_tlvs = isis_format_tlvs(tlvs); struct isis_tlvs *tlv_copy = isis_copy_tlvs(tlvs); + tlvs->isis_auth.head = orig_auth; isis_free_tlvs(tlvs); struct stream *s2 = stream_new(TEST_STREAM_SIZE);