aboutsummaryrefslogtreecommitdiffstats
path: root/src/extra_tests/fuzzers/jigs/redc_p384.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-12-14 14:15:42 -0500
committerJack Lloyd <[email protected]>2016-12-14 14:15:42 -0500
commit08482b59872fe590fbd73981733beebc1e72f51f (patch)
tree30b07adcced47236a1de9d7d15713d4dd0c27917 /src/extra_tests/fuzzers/jigs/redc_p384.cpp
parentf6bf79ef827aa28c285dd0e2444ca602fbb8a87b (diff)
Update fuzzers with comments from OSS-Fuzz review
Add explicit length limitations, to prevent the fuzzer from just giving us increasingly long inputs until timeout occurs due to non-linear algorithms. Use LLVM fuzzer interface in all cases, and just have AFL driver call that API when a define is set to include a main function. OSS-Fuzz will be using the LLVM API, regardless of the fuzzing engine. [ci skip]
Diffstat (limited to 'src/extra_tests/fuzzers/jigs/redc_p384.cpp')
-rw-r--r--src/extra_tests/fuzzers/jigs/redc_p384.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/extra_tests/fuzzers/jigs/redc_p384.cpp b/src/extra_tests/fuzzers/jigs/redc_p384.cpp
index 9a9ac896a..3b990fb63 100644
--- a/src/extra_tests/fuzzers/jigs/redc_p384.cpp
+++ b/src/extra_tests/fuzzers/jigs/redc_p384.cpp
@@ -10,6 +10,9 @@
void fuzz(const uint8_t in[], size_t len)
{
+ if(len > 2*384/8)
+ return;
+
static const BigInt& prime = Botan::prime_p384();
static const BigInt prime_2 = prime * prime;
static Botan::Modular_Reducer prime_redc(prime);