summaryrefslogtreecommitdiff
path: root/regress/unittests/test_helper/test_helper.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-01-18 19:52:44 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 00:24:39 +1100
commit80603c0daa2538c349c1c152405580b164d5475f (patch)
treef9af28a55dfd54dd4b35053de8f19406ed6b9957 /regress/unittests/test_helper/test_helper.h
parent87d5495bd337e358ad69c524fcb9495208c0750b (diff)
upstream commit
add a fuzz_matches_original() function to the fuzzer to detect fuzz cases that are identical to the original data. Hacky implementation, but very useful when you need the fuzz to be different, e.g. when verifying signature
Diffstat (limited to 'regress/unittests/test_helper/test_helper.h')
-rw-r--r--regress/unittests/test_helper/test_helper.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/regress/unittests/test_helper/test_helper.h b/regress/unittests/test_helper/test_helper.h
index 48c888ac3..1d9c66986 100644
--- a/regress/unittests/test_helper/test_helper.h
+++ b/regress/unittests/test_helper/test_helper.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: test_helper.h,v 1.5 2015/01/15 07:36:28 djm Exp $ */ 1/* $OpenBSD: test_helper.h,v 1.6 2015/01/18 19:52:44 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Damien Miller <djm@mindrot.org> 3 * Copyright (c) 2011 Damien Miller <djm@mindrot.org>
4 * 4 *
@@ -283,6 +283,13 @@ void fuzz_cleanup(struct fuzz *fuzz);
283/* Prepare the next fuzz case in the series */ 283/* Prepare the next fuzz case in the series */
284void fuzz_next(struct fuzz *fuzz); 284void fuzz_next(struct fuzz *fuzz);
285 285
286/*
287 * Check whether this fuzz case is identical to the original
288 * This is slow, but useful if the caller needs to ensure that all tests
289 * generated change the input (e.g. when fuzzing signatures).
290 */
291int fuzz_matches_original(struct fuzz *fuzz);
292
286/* Determine whether the current fuzz sequence is exhausted (nonzero = yes) */ 293/* Determine whether the current fuzz sequence is exhausted (nonzero = yes) */
287int fuzz_done(struct fuzz *fuzz); 294int fuzz_done(struct fuzz *fuzz);
288 295
@@ -292,4 +299,5 @@ u_char *fuzz_ptr(struct fuzz *fuzz);
292 299
293/* Dump the current fuzz case to stderr */ 300/* Dump the current fuzz case to stderr */
294void fuzz_dump(struct fuzz *fuzz); 301void fuzz_dump(struct fuzz *fuzz);
302
295#endif /* _TEST_HELPER_H */ 303#endif /* _TEST_HELPER_H */