mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
🧷 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:
9
tests/fuzz/BaseEncodeFuzz.cpp
Normal file
9
tests/fuzz/BaseEncodeFuzz.cpp
Normal 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.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user