🧷 Fuzz testing (#98)

* Update coverage.yml

* adding a fuzz test

* adding more fuzzing

TBA how to handle input requirement of decode

* base64 encoding input to avoid "obvious" exceptions

trying out the EVP_ interface from #89

* fixing decode fuzz

* accepting exceptions are normal

After comparing with https://github.com/nlohmann/json/blob/v3.9.0/test/src/fuzzer-parse_json.cpp I must agree data can be random so it should be accepted

* decoding twice should produce the same result

again based on https://github.com/nlohmann/json/blob/v3.9.0/test/src/fuzzer-parse_json.cpp

* fixing token decode fuzzer

* adding corpus for fuzz tests + adding them to ci

* removing numbers with more meaning descriptions

* Update BaseEncodeFuzz.cpp

* Update coverage.yml

* Update coverage.yml

* shrink interations

* cleaning cmake

* Update and rename coverage.yml to jwt.yml

* Update lint.yml

* Update jwt.yml

* Update jwt.yml
This commit is contained in:
Chris Mc
2021-09-17 20:01:38 -04:00
committed by GitHub
parent 3d501217a3
commit 7fd8470cf1
17 changed files with 163 additions and 69 deletions

View File

@@ -0,0 +1,9 @@
#include <jwt-cpp/base.h>
extern "C" {
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
jwt::base::encode<jwt::alphabet::base64>(std::string{(char *)Data, Size});
return 0; // Non-zero return values are reserved for future use.
}
}