summaryrefslogtreecommitdiff
path: root/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c')
-rw-r--r--regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c b/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
index c6b5c29d1..7c7cb2bfd 100644
--- a/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
+++ b/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: test_sshbuf_getput_fuzz.c,v 1.2 2014/05/02 02:54:00 djm Exp $ */ 1/* $OpenBSD: test_sshbuf_getput_fuzz.c,v 1.3 2018/10/17 23:28:05 djm Exp $ */
2/* 2/*
3 * Regress test for sshbuf.h buffer API 3 * Regress test for sshbuf.h buffer API
4 * 4 *
@@ -115,11 +115,15 @@ sshbuf_getput_fuzz_tests(void)
115 0x55, 0x0f, 0x69, 0xd8, 0x0e, 0xc2, 0x3c, 0xd4, 115 0x55, 0x0f, 0x69, 0xd8, 0x0e, 0xc2, 0x3c, 0xd4,
116 }; 116 };
117 struct fuzz *fuzz; 117 struct fuzz *fuzz;
118 u_int fuzzers = FUZZ_1_BIT_FLIP | FUZZ_2_BIT_FLIP |
119 FUZZ_1_BYTE_FLIP | FUZZ_2_BYTE_FLIP |
120 FUZZ_TRUNCATE_START | FUZZ_TRUNCATE_END;
121
122 if (test_is_fast())
123 fuzzers &= ~(FUZZ_2_BYTE_FLIP|FUZZ_2_BIT_FLIP);
118 124
119 TEST_START("fuzz blob parsing"); 125 TEST_START("fuzz blob parsing");
120 fuzz = fuzz_begin(FUZZ_1_BIT_FLIP | FUZZ_2_BIT_FLIP | 126 fuzz = fuzz_begin(fuzzers, blob, sizeof(blob));
121 FUZZ_1_BYTE_FLIP | FUZZ_2_BYTE_FLIP |
122 FUZZ_TRUNCATE_START | FUZZ_TRUNCATE_END, blob, sizeof(blob));
123 TEST_ONERROR(onerror, fuzz); 127 TEST_ONERROR(onerror, fuzz);
124 for(; !fuzz_done(fuzz); fuzz_next(fuzz)) 128 for(; !fuzz_done(fuzz); fuzz_next(fuzz))
125 attempt_parse_blob(blob, sizeof(blob)); 129 attempt_parse_blob(blob, sizeof(blob));