fuzz: Create fuzzers with default and custom crypto plugins
The pa_tnc fuzzer does not rely on any plugins and the pb_tnc fuzzer is a bit special in that it does use code from the tnccs-20 plugin, but that doesn't actually have to be loaded as such. The fuzzer directly calls statically linked code from the plugin.
This commit is contained in:
+1
-6
@@ -31,12 +31,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
|
||||
|
||||
dbg_default_set_level(-1);
|
||||
library_init(NULL, "fuzz_pa_tnc");
|
||||
plugin_loader_add_plugindirs(PLUGINDIR, PLUGINS);
|
||||
if (!lib->plugins->load(lib->plugins, PLUGINS))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
libimcv_init(FALSE);
|
||||
|
||||
chunk = chunk_create((u_char*)buf, len);
|
||||
|
||||
/* Parse incoming PA-TNC message */
|
||||
@@ -68,7 +64,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
|
||||
msg->destroy(msg);
|
||||
|
||||
libimcv_deinit();
|
||||
lib->plugins->unload(lib->plugins);
|
||||
library_deinit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user